-
Notifications
You must be signed in to change notification settings - Fork 1
/
react.js
36 lines (34 loc) · 1.12 KB
/
react.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
// @ts-check
/** @type {import("eslint").Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
plugins: ['react'],
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/button-has-type': ['warn'],
'react/function-component-definition': [
'warn',
{ namedComponents: 'arrow-function' },
],
'react/hook-use-state': ['warn'],
'react/jsx-boolean-value': ['warn'],
'react/jsx-curly-brace-presence': ['warn'],
'react/jsx-fragments': ['warn'],
'react/jsx-no-leaked-render': ['warn'],
'react/jsx-no-target-blank': ['error', { allowReferrer: true }],
'react/jsx-no-useless-fragment': ['warn', { allowExpressions: true }],
'react/jsx-pascal-case': ['warn'],
'react/jsx-sort-props': ['warn', { reservedFirst: ['key'] }],
'react/no-array-index-key': ['warn'],
'react/no-unknown-property': ['off'],
'react/no-unstable-nested-components': ['error'],
'react/prop-types': ['off'],
'react/react-in-jsx-scope': ['off'],
'react/self-closing-comp': ['warn'],
},
};
module.exports = config;