-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
74 lines (73 loc) · 2.04 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
73
74
'use strict';
module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'latest',
},
},
env: {
browser: true,
es6: true,
node: true,
'jest/globals': true,
'cypress/globals': true,
},
plugins: ['react', 'react-hooks', 'jest', 'cypress', 'import', '@emotion'],
rules: {
curly: ['error', 'multi-line'],
'jsx-quotes': 'error',
'no-shadow': 'warn',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-unused-expressions': 'error',
'react-hooks/rules-of-hooks': 'error',
'no-unused-vars': [
'error',
{
args: 'after-used',
ignoreRestSiblings: true,
vars: 'all',
},
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*test.js',
'**/tests/**/*.js',
'**/examples/**/*.js',
'**/build/**/*.js',
],
},
],
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'react/jsx-boolean-value': 'warn',
'react/jsx-no-undef': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-wrap-multilines': 'warn',
'react/no-did-mount-set-state': 'warn',
'react/no-did-update-set-state': 'warn',
'react/no-unknown-property': 'warn',
'react/react-in-jsx-scope': 'error',
'react/self-closing-comp': 'warn',
'react/sort-prop-types': 'warn',
'react/prop-types': 'off', //TODO: enable https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
'react/no-unescaped-entities': 'warn',
semi: 'error',
strict: 'off',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:jest/recommended'],
};