forked from zhihu/griffith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
72 lines (62 loc) · 1.59 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const OFF = 0
const ERROR = 2
module.exports = {
// parse proposal features like class fileds
parser: 'babel-eslint',
// https://eslint.org/docs/user-guide/configuring#specifying-parser-options
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
ecmaFeatures: {
// Supports JSX syntax (not the same as supporting React).
jsx: true,
},
},
// commonly used envs
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
// we use recommended configurations
extends: [
// https://eslint.org/docs/rules/
'eslint:recommended',
// https://github.com/yannickcr/eslint-plugin-react
'plugin:react/recommended',
// https://github.com/benmosher/eslint-plugin-import
'plugin:import/recommended',
// https://github.com/prettier/eslint-plugin-prettier
'plugin:prettier/recommended',
],
plugins: ['react-hooks'],
rules: {
'prettier/prettier': ['error', require('./.prettierrc')],
// disable nice-to-have rules for migrate convenience
'react/prop-types': OFF,
'react/no-find-dom-node': OFF,
'react/display-name': OFF,
// recommended rules
'prefer-const': ERROR,
'no-var': ERROR,
'react-hooks/rules-of-hooks': ERROR,
},
settings: {
// https://github.com/yannickcr/eslint-plugin-react#configuration
react: {
version: '16',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
'import/core-modules': [
'griffith',
'griffith-mp4',
'griffith-utils',
'griffith-message',
],
},
}