Skip to content

Commit 7524022

Browse files
committed
Update ESLint configuration
This has been copied from magento/magento2#32343
1 parent 6f2a73b commit 7524022

File tree

3 files changed

+105
-67
lines changed

3 files changed

+105
-67
lines changed

eslint/.eslintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"./.eslintrc-reset",
44
"./.eslintrc-magento",
55
"./.eslintrc-jquery",
6-
"./.eslintrc-misc",
7-
"./.eslintrc-jscs"
6+
"./.eslintrc-misc"
87
]
98
}

eslint/.eslintrc-jscs

Lines changed: 0 additions & 64 deletions
This file was deleted.

eslint/.eslintrc-magento

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,33 @@
22
"env": {
33
"amd": true,
44
"browser": true,
5+
"es6": true,
56
"jasmine": true,
67
"jquery": true,
78
"prototypejs": true,
89
"node": true
910
},
1011
"rules": {
12+
"array-bracket-spacing": [2, "never"],
13+
"arrow-spacing": [2, {"after": true, "before": true}],
14+
"block-spacing": [2, "always"],
15+
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
16+
"comma-dangle": [ 2, "always-multiline" ],
17+
"comma-spacing": [2, {"after": true, "before": false}],
18+
"comma-style": [2, "last"],
19+
"constructor-super": 2,
20+
"curly": [2, "all"],
21+
"dot-location": [2, "property"],
22+
"dot-notation": [2, {"allowKeywords": true}],
23+
"eol-last": 2,
1124
"eqeqeq": [2, "smart"],
25+
"func-call-spacing": [2, "never"],
26+
"generator-star-spacing": [2, {"after": true, "before": true}],
1227
"guard-for-in": 2,
28+
"indent": [2, 4],
29+
"key-spacing": [2, {"afterColon": true, "beforeColon": false}],
30+
"keyword-spacing": [2, {"after": true, "before": true}],
31+
"linebreak-style": [2, "unix"],
1332
"lines-around-comment": [
1433
2,
1534
{
@@ -18,18 +37,36 @@
1837
"allowObjectStart": true
1938
}
2039
],
40+
"lines-between-class-members": [2, "always", {"exceptAfterSingleLine": true}],
2141
"max-depth": [2, 2],
2242
"max-len": [2, 120, 4],
2343
"max-nested-callbacks": [2, 3],
44+
"multiline-ternary": [2, "always-multiline"],
45+
"new-cap": [2, {"capIsNew": false, "newIsCap": true, "properties": true}],
46+
"new-parens": 2,
2447
"newline-after-var": 2,
2548
"no-alert": 2,
2649
"no-array-constructor": 2,
2750
"no-caller": 2,
51+
"no-case-declarations": 2,
2852
"no-catch-shadow": 2,
53+
"no-class-assign": 2,
54+
"no-compare-neg-zero": 2,
2955
"no-cond-assign": 2,
56+
"no-console": 2,
57+
"no-const-assign": 2,
3058
"no-constant-condition": 2,
59+
"no-control-regex": 2,
3160
"no-debugger": 2,
61+
"no-delete-var": 2,
62+
"no-dupe-args": 2,
63+
"no-dupe-class-members": 2,
64+
"no-dupe-keys": 2,
65+
"no-duplicate-case": 2,
3266
"no-else-return": 2,
67+
"no-empty-character-class": 2,
68+
"no-empty-pattern": 2,
69+
"no-empty": [2, {"allowEmptyCatch": true}],
3370
"no-eval": 2,
3471
"no-ex-assign": 2,
3572
"no-extend-native": 2,
@@ -40,25 +77,57 @@
4077
"no-fallthrough": 2,
4178
"no-floating-decimal": 2,
4279
"no-func-assign": 2,
80+
"no-global-assign": 2,
4381
"no-implied-eval": 2,
4482
"no-inner-declarations": 2,
4583
"no-invalid-regexp": 2,
84+
"no-irregular-whitespace": 2,
85+
"no-iterator": 2,
86+
"no-labels": [2, {"allowLoop": false, "allowSwitch": false}],
4687
"no-lone-blocks": 2,
4788
"no-lonely-if": 2,
4889
"no-loop-func": 2,
90+
"no-mixed-operators": [2, {"allowSamePrecedence": true, "groups": [["==", "!=", "===", "!==", ">", ">=", "<", "<="], ["&&", "||"], ["in", "instanceof"]]}],
91+
"no-mixed-spaces-and-tabs": 2,
92+
"no-multi-spaces": 2,
4993
"no-multi-str": 2,
94+
"no-multiple-empty-lines": [2, {"max": 1, "maxEOF": 0}],
5095
"no-native-reassign": 2,
5196
"no-negated-in-lhs": 2,
97+
"no-new-func": 2,
5298
"no-new-object": 2,
99+
"no-new-symbol": 2,
100+
"no-new-wrappers": 2,
101+
"no-new": 2,
102+
"no-obj-calls": 2,
103+
"no-octal-escape": 2,
104+
"no-octal": 2,
53105
"no-proto": 2,
106+
"no-prototype-builtins": 2,
54107
"no-redeclare": 2,
55108
"no-regex-spaces": 2,
56109
"no-return-assign": 2,
110+
"no-self-assign": [2, {"props": true}],
57111
"no-self-compare": 2,
112+
"no-sequences": 2,
58113
"no-shadow": 2,
114+
"no-shadow-restricted-names": 2,
115+
"no-sparse-arrays": 2,
116+
"no-tabs": 2,
117+
"no-template-curly-in-string": 2,
118+
"no-this-before-super": 2,
119+
"no-throw-literal": 2,
120+
"no-trailing-spaces": 2,
59121
"no-undef": 2,
60122
"no-undef-init": 2,
123+
"no-unexpected-multiline": 2,
124+
"no-unmodified-loop-condition": 2,
125+
"no-unneeded-ternary": [2, {"defaultAssignment": false}],
61126
"no-unreachable": 2,
127+
"no-unsafe-finally": 2,
128+
"no-unsafe-negation": 2,
129+
"no-unused-expressions": [2, {"allowShortCircuit": true, "allowTaggedTemplates": true, "allowTernary": true}],
130+
"no-unused-labels": 2,
62131
"no-unused-vars": [
63132
2,
64133
{
@@ -68,14 +137,48 @@
68137
}
69138
],
70139
"no-use-before-define": 2,
140+
"no-useless-call": 2,
141+
"no-useless-computed-key": 2,
142+
"no-useless-constructor": 2,
143+
"no-useless-escape": 2,
144+
"no-useless-rename": 2,
145+
"no-useless-return": 2,
146+
"no-var": 2,
147+
"no-void": 2,
148+
"no-whitespace-before-property": 2,
71149
"no-with": 2,
150+
"object-curly-newline": [2, {"consistent": true, "multiline": true}],
151+
"object-curly-spacing": [2, "always"],
152+
"object-property-newline": [2, {"allowMultiplePropertiesPerLine": true}],
153+
"one-var": [2, {"initialized": "never"}],
72154
"operator-assignment": [2, "always"],
155+
"operator-linebreak": [2, "after", {"overrides": {":": "before", "?": "before", "|>": "before"}}],
156+
"padded-blocks": [2, {"blocks": "never", "classes": "never", "switches": "never"}],
157+
"prefer-const": [2, {"destructuring": "all"}],
158+
"prefer-promise-reject-errors": 2,
159+
"quote-props": [2, "as-needed"],
160+
"quotes": [2, "single", {"avoidEscape": true}],
73161
"radix": 2,
162+
"require-yield": 2,
163+
"rest-spread-spacing": [2, "never"],
74164
"semi": [2, "always"],
75165
"semi-spacing": 2,
166+
"space-before-blocks": [2, "always"],
167+
"space-before-function-paren": [2, "always"],
168+
"space-in-parens": [2, "never"],
169+
"space-infix-ops": 2,
170+
"space-unary-ops": [2, {"nonwords": false, "words": true}],
171+
"spaced-comment": [2, "always", {"block": {"balanced": true, "exceptions": ["*"], "markers": ["*package", "!", ",", ":", "::", "flow-include"]}, "line": {"markers": ["*package", "!", "/", ",", "="]}}],
76172
"strict": ["error", "function"],
173+
"symbol-description": 2,
174+
"template-curly-spacing": [2, "never"],
175+
"template-tag-spacing": [2, "never"],
176+
"unicode-bom": [2, "never"],
77177
"use-isnan": 2,
78178
"valid-typeof": 2,
79-
"vars-on-top": 2
179+
"vars-on-top": 2,
180+
"wrap-iife": [2, "any", {"functionPrototypeMethods": true}],
181+
"yield-star-spacing": [2, "both"],
182+
"yoda": [2, "never"]
80183
}
81184
}

0 commit comments

Comments
 (0)