-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
62 lines (54 loc) · 1.28 KB
/
index.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
const react = require('eslint-plugin-react');
const reactHooks = require('eslint-plugin-react-hooks');
const base = require('./base');
const globals = require('globals');
const OFF = 0;
const ERROR = 2;
const reactRules = {
'react/prefer-es6-class': [ERROR, 'always'],
'react/self-closing-comp': ERROR,
'react/jsx-pascal-case': ERROR,
'react-hooks/rules-of-hooks': ERROR,
'react-hooks/exhaustive-deps': ERROR,
'react/no-children-prop': ERROR,
'react/display-name': OFF,
'react/prop-types': OFF,
'react/jsx-curly-brace-presence': [
ERROR,
{ props: 'never', children: 'ignore', propElementValues: 'always' },
],
};
module.exports = [
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
...base,
{
plugins: {
react,
'react-hooks': reactHooks,
},
languageOptions: {
globals: globals.browser,
},
settings: {
react: {
version: 'detect',
},
},
rules: reactRules,
},
{
files: ['**/*.tsx'],
rules: {
// temporary override until everybody removes the React import
'@typescript-eslint/no-unused-vars': [
ERROR,
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
varsIgnorePattern: '^React$',
},
],
},
},
];