-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.js
75 lines (74 loc) · 1.96 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
70
71
72
73
74
75
const path = require('path'),
globals = require('globals'),
pluginJs = require('@eslint/js'),
//plugins
eslintConfigPrettier = require('eslint-config-prettier'),
babel = require('eslint-plugin-babel'),
react = require('eslint-plugin-react'),
reactHooks = require('eslint-plugin-react-hooks'),
jest = require('eslint-plugin-jest'),
testingLibrary = require('eslint-plugin-testing-library'),
jestDom = require('eslint-plugin-jest-dom'),
prettier = require('eslint-plugin-prettier'),
babelParser = require('@babel/eslint-parser');
module.exports = [
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
it: 'readonly',
jest: 'readonly',
test: 'readonly',
expect: 'readonly',
indexedDB: 'readonly',
describe: 'readonly',
},
},
},
pluginJs.configs.recommended,
{
files: ['**/*.{js,jsx}'],
...jest.configs['flat/recommended'],
plugins: {
babel,
react,
'react-hooks': reactHooks,
jest,
'testing-library': testingLibrary,
'jest-dom': jestDom,
prettier,
},
languageOptions: {
parser: babelParser,
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
ecmaFeatures: {
jsx: true,
modules: true,
arrowFunctions: true,
restParams: true,
experimentalObjectRestSpread: true,
},
babelOptions: {
configFile: path.join(__dirname, 'babel.config.js'),
},
},
},
settings: {
'import/resolver': 'webpack',
},
rules: {
...reactHooks.configs.recommended.rules,
...jest.configs['flat/recommended'].rules,
'prettier/prettier': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'no-unused-vars': 'warn',
'no-empty': 'warn',
},
ignores: ['**/src/**/*.json', '**/public/**/*.json'],
},
eslintConfigPrettier,
];