-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
69 lines (68 loc) · 1.75 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
58
59
60
61
62
63
64
65
66
67
68
69
const reactPlugin = require('eslint-plugin-react');
const typescriptPlugin = require('@typescript-eslint/eslint-plugin');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
const prettierPlugin = require('eslint-plugin-prettier');
const importPlugin = require('eslint-plugin-import');
const typescriptParser = require('@typescript-eslint/parser');
module.exports = [
{
env: {
browser: true,
es2021: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
browser: 'readonly',
jest: 'readonly',
},
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
plugins: {
react: reactPlugin,
'@typescript-eslint': typescriptPlugin,
'react-hooks': reactHooksPlugin,
prettier: prettierPlugin,
import: importPlugin, // Added eslint-plugin-import
},
rules: {
'no-nested-ternary': 'off',
'import/prefer-default-export': 'off',
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'@typescript-eslint/no-unused-vars': 'warn',
'no-unused-vars': 'warn',
'import/no-extraneous-dependencies': 'warn', // This now works because the plugin is included
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': [
'warn',
{
enableDangerousAutofixThisMayCauseInfiniteLoops: true,
},
],
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
},
},
];