-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
99 lines (96 loc) · 3.12 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
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
99
module.exports = {
reportUnusedDisableDirectives: true,
ignorePatterns: ['dist/*', 'src/generated/*', 'src/vite-env.d.ts','src/routeTree.gen.ts'],
env: { browser: true, es2021: true, node: true },
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2020,
sourceType: 'module',
project: null,
},
settings: { react: { version: 'detect' } },
plugins: [
'react-refresh',
'sonarjs',
'unicorn',
'comments',
'promise',
'security',
'no-secrets',
'react',
'eslint-plugin-import',
'simple-import-sort',
'@typescript-eslint/eslint-plugin',
],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'@jetbrains',
'@jetbrains/eslint-config/node',
'plugin:sonarjs/recommended',
'plugin:security/recommended-legacy',
'plugin:eslint-comments/recommended',
'plugin:promise/recommended',
'plugin:unicorn/recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
rules: {
'react-refresh/only-export-components': 'warn',
'@typescript-eslint/no-namespace': 'off',
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages `react` related packages come first.
['^react', '^next', '^@?\\w'],
// Internal packages.
['^(@|components)(/.*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.?(styles)$'],
],
},
],
'linebreak-style': 'off',
'max-len': 'off',
'no-return-assign': 'off',
'valid-jsdoc': 'off',
radix: 'off',
'no-native-reassign': 'off',
'multiline-ternary': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-multiple-empty-lines': 'error',
'no-use-before-define': 'off',
'react/prop-types': 'off',
'no-catch-shadow': 'off',
'no-nested-ternary': 'off',
'prefer-template': 'error',
'prefer-spread': 'error',
'prefer-arrow-callback': 'error',
'no-var': 'error',
'arrow-spacing': 'error',
complexity: ['error', { max: 15 }],
'unicorn/filename-case': 'off',
'@typescript-eslint/explicit-function-return-type': 'error',
'max-lines': ['error', { max: 1000, skipBlankLines: true, skipComments: true }],
'max-params': ['error', { max: 5 }],
'max-nested-callbacks': ['error', { max: 3 }],
'max-depth': ['error', { max: 4 }],
'no-magic-numbers': ['warn', { ignore: [0, 1, -1, 2] }],
'unicorn/consistent-function-scoping': ['error', { 'checkArrowFunctions': true }],
'unicorn/prevent-abbreviations': ['error', { 'checkDefaultAndNamespaceImports': true }],
'unicorn/empty-brace-spaces': 'error',
'unicorn/no-unreadable-array-destructuring': 'error',
},
};