-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc
More file actions
118 lines (114 loc) · 4.26 KB
/
Copy path.eslintrc
File metadata and controls
118 lines (114 loc) · 4.26 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
"extends": "react-app",
"globals": {
"If": true,
"Choose": true,
"When": true,
"Otherwise": true,
"render": true,
"mount": true,
"shallow": true,
"enzumeToJson": true,
"shallowSnapshots": true,
"renderSnapshots": true
},
"rules": {
"no-unexpected-multiline": "off",
"jsx-a11y/img-redundant-alt": "off",
//styles
"block-spacing": ["error"],
"array-bracket-spacing": ["warn", "never"],
"comma-dangle": ["warn", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}],
"comma-spacing": ["warn", { "before": false, "after": true }],
"computed-property-spacing": ["warn"],
"indent": ["warn", 2, { "SwitchCase": 1 }],
"jsx-quotes": ["warn"],
"key-spacing": ["warn", { "afterColon": true }],
"keyword-spacing": ["warn", { "before": true }],
"no-multiple-empty-lines": ["warn", { "max": 2, "maxBOF": 0}],
"object-curly-spacing": ["warn", "always", { "objectsInObjects": false }],
"operator-assignment": ["error", "always"],
"quotes": ["warn", "single"],
"quote-props": ["warn", "as-needed"],
"semi": ["warn", "always"],
"semi-spacing": "warn",
"space-before-blocks": "warn",
"space-in-parens": ["warn", "never"],
"space-infix-ops": "warn",
"space-unary-ops": "warn",
"arrow-spacing": "warn",
"template-curly-spacing": "warn",
"no-multi-spaces": "warn",
"no-trailing-spaces": "warn",
"eol-last": ["warn", "always"],
//bad code
"no-unused-vars": "warn",
"no-multi-assign": "error",
"no-extra-semi": "error",
"semi-style": "error",
"no-unneeded-ternary": "error",
"callback-return": "error",
"import/no-duplicates": "error",
"no-useless-computed-key": "error",
"no-var": "error",
"init-declarations": ["error", "always"],
"no-delete-var": "error",
"no-restricted-globals": ["error"],
"no-use-before-define": "error",
"dot-notation": "warn",
"no-alert": "error",
"max-len": ["warn", { "code": 150, "ignoreComments": true, "ignoreStrings": true, "ignoreTemplateLiterals": true }],
//es6
"no-const-assign": "error",
"object-shorthand": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": ["error", { "object": true }],
"prefer-numeric-literals": "error",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"prefer-template": "warn",
"rest-spread-spacing": ["error", "never"],
//react
"react/default-props-match-prop-types": ["error", { "allowRequiredDefaults": true }],
"react/forbid-foreign-prop-types": "error",
"react/no-children-prop": "error",
"react/jsx-curly-spacing": [1, {"when": "always", "children": true, "allowMultiline": false, "spacing": {"objectLiterals": "never"}}],
"react/no-danger": "warn",
"react/no-danger-with-children": "error",
"react/no-direct-mutation-state": "error",
"react/no-find-dom-node": "error",
"react/no-is-mounted": "error",
//"react/no-multi-comp": "error" TODO refactor to mutch this rool
"react/no-redundant-should-component-update": "warn",
"react/no-string-refs": "error",
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "warn",
"react/no-will-update-set-state": "error",
"react/prefer-es6-class": ["error", "always"],
//"react/prop-types": "warn" TODO check this later
"react/require-render-return": "error",
"react/self-closing-comp": ["error", { "component": true, "html": true }],
"react/style-prop-object": "error",
"react/void-dom-elements-no-children": "error",
"react/jsx-boolean-value": "warn",
"react/jsx-closing-tag-location": "warn",
"react/jsx-indent": ["warn", 2],
"react/jsx-key": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-undef": [2, { "allowGlobals": true }],
/* "react/jsx-no-literals": ["warn", {"noStrings": true}], */
"react/jsx-pascal-case": "warn",
"react/jsx-tag-spacing": ["warn", "always" ],
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/jsx-wrap-multilines": "warn",
"react/jsx-curly-brace-presence": ["warn", { "props": "never" }]
}
}