-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
55 lines (53 loc) · 1.67 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
module.exports = {
root: true,
env: { browser: true, es2020: true, 'jest/globals': true },
extends: ['airbnb', 'airbnb/hooks', 'plugin:prettier/recommended'],
ignorePatterns: ['dist', 'node_modules', 'vit-env.d.ts', '.eslintrc.cjs', 'vite.config.ts'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh', 'plugin:react/jsx-runtime', 'jest'],
overrides: [
{
// enable eslint-plugin-testing-library rules or preset only for matching testing files
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
extends: ['plugin:testing-library/react'],
},
],
settings: {
'import/resolver': {
typescript: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'max-lines-per-function': ['error', 40],
'no-magic-numbers': [
'error',
{
ignore: [0, 1, -1, 2],
ignoreArrayIndexes: true,
enforceConst: true,
detectObjects: false,
},
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/prefer-default-export': 'off', // Otherwise, it will conflict with feature-sliced-design
'jest/no-focused-tests': 'off',
// 'testing-library/await-async-queries': 'error',
// 'testing-library/no-await-sync-queries': 'error',
// 'testing-library/no-debugging-utils': 'warn',
// 'testing-library/no-dom-import': 'off',
},
};