generated from ggondim-templates-typescript/template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslint.config.js
77 lines (77 loc) · 2.06 KB
/
.eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
module.exports = {
root: true,
ignorePatterns: [
'/.vscode/**/*',
'/build/**/*',
'/dist/**/*',
'/**/*.test.js',
'/node_modules/**/*',
'.eslintrc.js'
],
env: {
es6: true,
es2017: true,
es2020: true,
es2021: true,
es2023: true,
node: true,
},
plugins: [
'import',
'@typescript-eslint',
'eslint-comments',
],
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'plugin:eslint-comments/recommended',
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
project: './tsconfig.json'
},
globals: {
"console": process.env.NODE_ENV === 'development' ? 'readonly' : 'off',
},
rules: {
strict: 'off',
'prefer-destructuring': 'off',
'class-methods-use-this': 'off',
camelcase: 'error',
'no-new': 'error',
'no-unused-vars': 'error',
'max-len': ['error', { code: 100 }],
'import/no-dynamic-require': 0,
'padded-blocks': ['error', 'never'],
'no-unused-expressions': 'error',
// allow optionalDependencies
'import/no-extraneous-dependencies': ['error', {
optionalDependencies: ['test/unit/index.js'],
}],
// disallow reassignment of function parameters
// disallow parameter object manipulation except for specific exclusions
'no-param-reassign': ['error', {
ignorePropertyModificationsFor: [
'acc', // for reduce accumulators
'e', // for e.returnvalue
'config',
],
}],
'no-plusplus': 'off',
'comma-dangle': ['error', 'always-multiline'],
semi: ['error', 'always'],
'no-eval': 1,
'no-confusing-arrow': 'off',
'arrow-parens': 'off',
'consistent-return': 'off',
'no-alert': 'off',
'no-underscore-dangle': 'off',
'import/prefer-default-export': 'off',
'import/extensions': ['warn', 'always', { ts: 'never' }],
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
radix: 'off',
},
};