-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.js
98 lines (96 loc) · 2.62 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const baseParserOptions = {
ecmaVersion: 2022,
};
const baseRules = {
'no-console': ['error', { allow: ['info', 'error'] }],
'prettier/prettier': 'error',
'class-methods-use-this': 'off',
'no-underscore-dangle': [
'error',
{
allow: ['_id', '_csrf', '_getBuffer', '_getData', '_getHeaders', '_getStatusCode', '_getRedirectUrl', '_getRenderData', '_getRenderView', '_isEndCalled'],
},
],
'import/extensions': 'off',
'import/no-named-as-default': 'off',
'implicit-arrow-linebreak': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.test.{js,ts}',
'**/*.ff-test.{js,ts}',
'**/*.api-test.{js,ts}',
'**/*.spec.{js,ts}',
'**/webpack.*.{js,ts}',
'**/api-test*/**',
'**/__mocks__/**',
],
},
],
'import/prefer-default-export': 'off',
'comma-dangle': 'off',
'no-loop-func': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'no-return-await': 'off',
'no-use-before-define': [
'error',
{
functions: false,
},
],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'object-curly-newline': [
'error',
{
consistent: true,
},
],
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['draft', 'req', 'res'] }],
};
module.exports = {
extends: ['airbnb-base', 'plugin:prettier/recommended'],
env: {
jest: true,
browser: true,
},
root: true,
ignorePatterns: ['**/node_modules/**'],
rules: baseRules,
settings: {
'import/resolver': {
typescript: {},
},
},
parserOptions: baseParserOptions,
overrides: [
// Typescript files only
{
files: ['*.ts'],
extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended-type-checked', 'plugin:prettier/recommended'],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
...baseParserOptions,
project: './tsconfig.eslint.json',
tsconfigRootDir: __dirname,
},
rules: {
...baseRules,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-floating-promises': ['error', { ignoreIIFE: true }],
'@typescript-eslint/restrict-template-expressions': ['error', { allowNever: true }],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
],
};