-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
73 lines (72 loc) · 2.13 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const { resolve } = require('path');
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: ['react-refresh'],
rules: {
'import/prefer-default-export': 'off',
'arrow-body-style': 'off',
'arrow-parens': ['error', 'as-needed', {
requireForBlockBody: true,
}],
'react/jsx-indent': ['error', 4],
'react/jsx-no-undef': [ "error", { "allowGlobals": true } ],
'react/require-default-props': 0,
'react/function-component-definition': 0,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'max-len': ['warn', {
'code': 140,
'ignoreUrls': true,
'ignorePattern': '(^import|d="([\\s\\S]*?)|\\srequire\\()',
'ignoreTrailingComments': true,
}],
'no-param-reassign': ['error', {
ignorePropertyModificationsFor: ['stack'], // Mutating the stack in reduce() is usually more performant
}],
'react/react-in-jsx-scope': 0,
'import/extensions': 0,
'import/no-extraneous-dependencies': ['warn', {
/* We list everything that Webpack can bundle into pure JS as deAvDependencies
for performance reasons, to keep a Docker image as small as possible. */
devDependencies: true,
/** Imports should only be validated against top-level package.json */
packageDir: '.',
}],
},
settings: {
'import/resolver': {
'alias-array': {
alias: true,
map: [
['@api', resolve(__dirname, './src/api/')],
['@components', resolve(__dirname, './src/components/')],
['@store', resolve(__dirname, './src/store/')],
['@utils', resolve(__dirname, './src/utils/')],
],
}
}
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
"no-undef": "off"
}
}
]
}