-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
59 lines (56 loc) · 2.35 KB
/
.eslintrc.cjs
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
const isProduction = process.argv.some((arg) => arg.includes('configProduction'));
const airbnb = require('eslint-config-airbnb-base/rules/style');
// Do not restrict usage of for...of
const noRestrictedSyntax = airbnb.rules['no-restricted-syntax'].slice(1).filter((r) => r.selector !== 'ForOfStatement');
const memberDelimiterStyleOverrides = {
overrides: { typeLiteral: { multiline: { delimiter: 'comma' }, singleline: { delimiter: 'comma' } } },
};
module.exports = {
env: {
browser: true,
es6: true,
},
extends: ['airbnb-typescript/base'],
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2020,
},
root: true,
plugins: ['import'],
rules: {
'no-console': 'off',
'no-debugger': isProduction ? 'error' : 'off',
'class-methods-use-this': 'off',
'function-paren-newline': 'off',
'max-len': ['error', 120],
'no-underscore-dangle': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-continue': 'off',
'no-confusing-arrow': 'off',
'no-floating-decimal': 'off',
'no-return-assign': 'off',
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'import/prefer-default-export': 'off',
'implicit-arrow-linebreak': 'off',
'object-curly-newline': ['error', { ObjectPattern: { multiline: true } }],
'prefer-const': ['error', { destructuring: 'all' }],
'no-nested-ternary': 'off',
'no-restricted-syntax': ['error', ...noRestrictedSyntax],
'@typescript-eslint/indent': ['error', 4, { SwitchCase: 1 }],
'@typescript-eslint/member-delimiter-style': ['error', memberDelimiterStyleOverrides],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
// Disable rules that are already checked by TS.
indent: 'off',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'import/no-unresolved': 'off',
'import/extensions': 'off',
},
};