-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
63 lines (60 loc) · 1.92 KB
/
.eslintrc.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
module.exports = {
root: true,
globals: {
__dirname: true,
process: true
},
env: {
commonjs: true,
es6: true,
jest: true,
node: true
},
// See: https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:jest/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
project: 'tsconfig.eslint.json',
tsconfigRootDir: __dirname, // https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-567365174
},
rules: {
'import/order': [
'error',
{ alphabetize: { order: 'asc', caseInsensitive: true }, 'newlines-between': 'never' },
],
// Allow unbound static method references
'@typescript-eslint/unbound-method': [
'error',
{
'ignoreStatic': true
}
],
// Soften some errors
'no-restricted-syntax': ['warn', 'ForInStatement', 'LabeledStatement', 'WithStatement'], // Removes ForOfStatement from extended standards
'no-return-assign': ['error', 'except-parens'],
'no-await-in-loop': 'warn',
'no-param-reassign': 'warn',
// And turn some completely off
'class-methods-use-this': 'off',
'import/prefer-default-export': 'off',
'max-classes-per-file': 'off',
'no-underscore-dangle': 'off',
'no-void': 'off',
'no-continue': 'off',
},
overrides: [
{
files: "bin/**/*.js",
rules: {
'@typescript-eslint/no-var-requires': 'off',
}
}
]
};