forked from react-tags/react-tags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
84 lines (80 loc) · 2.18 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
75
76
77
78
79
80
81
82
83
84
/*
"off" or 0 - turn the rule off
"warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
"error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
*/
module.exports = {
env: {
es6: true,
node: true,
browser: true
},
extends: ["eslint:recommended", "plugin:react/recommended"],
parserOptions: {
ecmaVersion: "6",
ecmaFeatures: {
jsx: true
},
sourceType: "module"
},
plugins: ["react", "jsx-a11y"],
"parser": "babel-eslint",
rules: {
"indent": [2, 2],
"linebreak-style": [2, "unix"],
"quotes": [2, "single"],
"semi": [2, "always"],
"eqeqeq": [2, "smart"],
"no-unused-vars": 1,
"no-undef": 1,
"default-case": 1,
"comma-dangle": [2, "always-multiline"],
"no-trailing-spaces": 2,
"no-extra-bind": 1,
"no-useless-escape": 1,
/** react rules start here **/
"react/jsx-no-duplicate-props": 2,
"react/no-deprecated": 1,
"react/no-is-mounted": 2,
"react/no-unknown-property": 1,
"react/prop-types": 2,
"react/no-direct-mutation-state": 2,
"react/jsx-key": 2,
"react/no-children-prop": 1,
"react/display-name": 1,
"react/no-multi-comp": 1,
"react/sort-comp": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-typos": 2,
"react/jsx-equals-spacing": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-vars": 1,
"react/no-find-dom-node": 1,
"react/no-render-return-value": 1,
/** jsx-ally rules start here **/
"jsx-a11y/alt-text": 2,
"jsx-a11y/html-has-lang": 1,
"jsx-a11y/iframe-has-title": 1,
"jsx-a11y/click-events-have-key-events": 1
},
overrides: [
{
files: [
"**/*.test.js"
],
env: {
jest: true // now **/*.test.js files' env has both es6 *and* jest
},
// Can't extend in overrides: https://github.com/eslint/eslint/issues/8813
// "extends": ["plugin:jest/recommended"]
plugins: ["jest"],
rules: {
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn"
}
}
],
};