-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
89 lines (88 loc) · 2.2 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const globals = require('globals');
const pluginJs = require('@eslint/js');
const tsEslint = require('typescript-eslint');
const pluginReact = require('eslint-plugin-react');
const pluginReactHooks = require('eslint-plugin-react-hooks');
const {fixupPluginRules } = require('@eslint/compat');
const jest = require('eslint-plugin-jest');
const jestDom = require('eslint-plugin-jest-dom');
const testingLibrary = require('eslint-plugin-testing-library');
const prettierConfig = require('eslint-config-prettier');
module.exports = [
pluginJs.configs.recommended,
...tsEslint.configs.recommended,
{
ignores: [
'coverage/',
'babel.config.js',
'dist/',
'jest.config.ts',
'commitlint.config.js',
'webpack.config.js',
'webpack.*.config.js',
'lint-staged.config.js',
'eslint.config.js',
'.eslintignore',
'.prettierrc',
'.jestcache/',
'.husky',
'.gitignore',
'wallaby.js',
],
},
{
languageOptions: {
parserOptions: {
project: './tsconfig-dev.json',
},
globals: {
...globals.jest,
},
},
},
{
files: ['**/*.tsx'],
plugins: {
react: pluginReact,
'react-hooks': fixupPluginRules(pluginReactHooks),
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
'react/jsx-filename-extension': [
'warn',
{
extensions: ['.tsx'],
},
],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'import/prefer-default-export': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
},
},
{
files: ['__tests__/**', '**/__mocks__/**', '**/**/*.spec.ts[x]'],
plugins: {
jest,
jestDom,
testingLibrary,
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'testing-library/no-dom-import': 'off',
'no-console': 'off',
'react/no-children-prop': 'off',
},
},
prettierConfig
];