/
.eslintrc.js
57 lines (56 loc) · 1.33 KB
/
.eslintrc.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
const path = require('path')
module.exports = {
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['examples/**/*'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'react/no-unknown-property': [
'error',
{
ignore: ['jsx'],
},
],
'react/prop-types': 'off',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: path.join(__dirname, 'tsconfig.eslint.json'),
sourceType: 'module',
},
plugins: ['react', 'react-hooks', '@typescript-eslint', 'simple-import-sort'],
root: true,
rules: {
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react/jsx-sort-props': 'error',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'sort-imports': 'off',
'sort-keys': 'error',
},
settings: {
react: {
version: 'detect',
},
},
}