-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
57 lines (56 loc) · 2.07 KB
/
eslint.config.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
import tsParser from '@typescript-eslint/parser';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import prettier from 'eslint-config-prettier';
import eslintPluginReact from 'eslint-plugin-react';
import eslintImport from 'eslint-plugin-import';
export default [
{
name: 'base-config',
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'], // specifying which files this configuration applies to
ignores: ['node_modules/**/*', 'dist/**/*'], // specify ignored files
languageOptions: {
parser: tsParser,
sourceType: 'module',
},
plugins: {
'@typescript-eslint': typescriptPlugin,
'react-hooks': reactHooksPlugin,
react: eslintPluginReact,
import: eslintImport,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.less', '.scss'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
rules: {
'react/no-unused-prop-types': 'warn',
'react/forbid-prop-types': 0,
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-shadow': 'error',
'import/no-extraneous-dependencies': [
'warn',
{ devDependencies: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx'] },
],
'no-plusplus': [2, { allowForLoopAfterthoughts: true }],
'no-use-before-define': 'off',
'no-shadow': 'off',
'default-param-last': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'import/prefer-default-export': 'off',
},
},
{
name: 'test-specific',
files: ['*.spec.ts', '*.spec.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 0,
},
},
prettier,
];