Skip to content

Commit 8d152b5

Browse files
authored
Merge pull request #148 from webpack-contrib/update-eslint-configs
Simplify ESLint configs
2 parents e57a0eb + 5b6fb3f commit 8d152b5

File tree

4 files changed

+16
-326
lines changed

4 files changed

+16
-326
lines changed

.eslintrc.json

Lines changed: 2 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,7 @@
11
{
22
"root": true,
3-
"parser": "babel-eslint",
4-
"parserOptions": {
5-
"ecmaVersion": 2017,
6-
"sourceType": "module",
7-
"ecmaFeatures": {
8-
"impliedStrict": true,
9-
"experimentalObjectRestSpread": true
10-
}
11-
},
12-
"env": {
13-
"es6": true,
14-
"node": true
15-
},
3+
"extends": "th0r",
164
"rules": {
17-
"arrow-body-style": [2, "as-needed"],
18-
"array-bracket-newline": [2, "consistent"],
19-
"array-bracket-spacing": [2, "never"],
20-
"array-callback-return": [2, {"allowImplicit": false}],
21-
"arrow-parens": 0,
22-
"arrow-spacing": [2, {"before": true, "after": true}],
23-
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
24-
"camelcase": [2, {"properties": "never"}],
25-
"capitalized-comments": 0,
26-
"class-methods-use-this": 0,
27-
"comma-dangle": [2, "never"],
28-
"comma-spacing": [2, {"before": false, "after": true}],
29-
"comma-style": [2, "last"],
30-
"complexity": [2, 20],
31-
"consistent-return": 0,
32-
"constructor-super": 2,
33-
"curly": [2, "multi-line"],
34-
"dot-notation": [2, {"allowKeywords": true, "allowPattern": "^[a-z]+(_[a-z]+)+$"}],
35-
"eol-last": 0,
36-
"eqeqeq": [2, "allow-null"],
37-
"for-direction": 2,
38-
"function-paren-newline": 0,
39-
"func-call-spacing": [2, "never"],
40-
"generator-star-spacing": [2, "after"],
41-
"getter-return": 2,
42-
"handle-callback-err": 2,
43-
"indent": [2, 2, {
44-
"SwitchCase": 1,
45-
"ignoredNodes": ["TemplateLiteral"]
46-
}],
47-
"jsx-quotes": [2, "prefer-double"],
48-
"keyword-spacing": 2,
49-
"key-spacing": [1, {"beforeColon": false, "afterColon": true}],
50-
"linebreak-style": [2, "unix"],
51-
"lines-between-class-members": [2, "always", {"exceptAfterSingleLine": true}],
52-
"line-comment-position": [2, {"position": "above"}],
53-
"max-len": [2, {"code": 120, "tabWidth": 4}],
54-
"newline-per-chained-call": [2, {"ignoreChainWithDepth": 2}],
55-
"new-cap": [2, {"newIsCap": true, "capIsNew": false}],
56-
"new-parens": 0,
57-
"nonblock-statement-body-position": ["error", "beside"],
58-
"no-alert": 0,
59-
"no-array-constructor": 2,
60-
"no-await-in-loop": 0,
61-
"no-buffer-constructor": 2,
62-
"no-caller": 2,
63-
"no-case-declarations": 2,
64-
"no-catch-shadow": 0,
65-
"no-class-assign": 0,
66-
"no-compare-neg-zero": 2,
67-
"no-cond-assign": [2, "except-parens"],
68-
"no-confusing-arrow": [2, {"allowParens": true}],
69-
"no-console": 0,
70-
"no-control-regex": 2,
71-
"no-constant-condition": 2,
72-
"no-const-assign": 2,
73-
"no-debugger": 2,
74-
"no-delete-var": 2,
75-
"no-dupe-args": 2,
76-
"no-dupe-keys": 2,
77-
"no-duplicate-case": 2,
78-
"no-duplicate-imports": [2, {"includeExports": true}],
79-
"no-empty": 2,
80-
"no-empty-character-class": 2,
81-
"no-empty-pattern": 2,
82-
"no-eval": 2,
83-
"no-extend-native": 2,
84-
"no-extra-bind": 2,
85-
"no-extra-boolean-cast": 2,
86-
"no-extra-parens": 0,
87-
"no-ex-assign": 2,
88-
"no-fallthrough": 2,
89-
"no-floating-decimal": 2,
90-
"no-func-assign": 2,
91-
"no-global-assign": 2,
92-
"no-implied-eval": 2,
93-
"no-inner-declarations": 2,
94-
"no-invalid-regexp": 2,
95-
"no-iterator": 2,
96-
"no-labels": 0,
97-
"no-label-var": 2,
98-
"no-lone-blocks": 0,
99-
"no-loop-func": 0,
100-
"no-mixed-operators": 2,
101-
"no-mixed-spaces-and-tabs": 2,
102-
"no-multiple-empty-lines": [2, {"max": 2}],
103-
"no-multi-assign": 0,
104-
"no-multi-spaces": 2,
105-
"no-multi-str": 0,
106-
"no-new": 0,
107-
"no-new-func": 2,
108-
"no-new-object": 2,
109-
"no-new-wrappers": 2,
110-
"no-obj-calls": 2,
111-
"no-octal": 2,
112-
"no-octal-escape": 2,
113-
"no-process-exit": 0,
114-
"no-proto": 2,
115-
"no-prototype-builtins": 0,
116-
"no-redeclare": 2,
117-
"no-regex-spaces": 2,
118-
"no-restricted-syntax": [2, "WithStatement"],
119-
"no-return-assign": 0,
120-
"no-return-await": 0,
121-
"no-script-url": 2,
122-
"no-self-assign": [2, {"props": true}],
123-
"no-sequences": 2,
124-
"no-shadow": 0,
125-
"no-shadow-restricted-names": 2,
126-
"no-sparse-arrays": 2,
127-
"no-tabs": 2,
128-
"no-template-curly-in-string": 2,
129-
"no-this-before-super": 2,
130-
"no-trailing-spaces": [2, {"skipBlankLines": false}],
131-
"no-undef": 2,
132-
"no-undef-init": 2,
133-
"no-underscore-dangle": 0,
134-
"no-unsafe-finally": 2,
135-
"no-unsafe-negation": 2,
136-
"no-unused-expressions": 0,
137-
// Ignoring unused last "next" argument in Express error handlers
138-
"no-unused-vars": [2, {"argsIgnorePattern": "^next$"}],
139-
"no-useless-computed-key": 2,
140-
"no-useless-escape": 2,
141-
"no-useless-rename": 2,
142-
"no-useless-return": 2,
143-
"no-use-before-define": [1, "nofunc"],
144-
"no-var": 2,
145-
"no-with": 2,
146-
"object-curly-newline": [2, {"consistent": true}],
147-
"object-curly-spacing": [2, "always"],
148-
"object-property-newline": [2, {"allowAllPropertiesOnSameLine": true}],
149-
"object-shorthand": [2, "always"],
150-
"one-var": [2, "never"],
151-
"padding-line-between-statements": [2,
152-
{"blankLine": "always", "prev": "directive", "next": "*"}
153-
],
154-
"prefer-const": [2, {"destructuring": "all"}],
155-
"prefer-destructuring": [2, {
156-
"array": false,
157-
"object": true
158-
}],
159-
"prefer-numeric-literals": 2,
160-
"prefer-promise-reject-errors": [2, {"allowEmptyReject": true}],
161-
"prefer-reflect": 0,
162-
"prefer-spread": 2,
163-
"quotes": [2, "single", "avoid-escape"],
164-
"quote-props": 0,
165-
"require-await": 0,
166-
"require-yield": 2,
167-
"rest-spread-spacing": [2, "never"],
168-
"semi": [2, "always", {"omitLastInOneLineBlock": true}],
169-
"semi-spacing": 0,
170-
"semi-style": [2, "last"],
171-
// Setting "error" won't allow to comment blocks of code with IDE shortcut
172-
"spaced-comment": 0,
173-
"space-before-blocks": [2, "always"],
174-
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
175-
"space-infix-ops": 2,
176-
"space-unary-ops": 0,
177-
"strict": 0,
178-
"symbol-description": 2,
179-
"switch-colon-spacing": 2,
180-
"template-tag-spacing": [2, "never"],
181-
"unicode-bom": 0,
182-
"use-isnan": 2,
183-
"valid-typeof": [2, {"requireStringLiterals": true}],
184-
"wrap-iife": [2, "inside"],
185-
"yoda": [2, "never"]
5+
"object-curly-spacing": ["error", "always"]
1866
}
1877
}

client/.eslintrc.json

Lines changed: 4 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,6 @@
11
{
2-
"extends": "../.eslintrc.json",
3-
"parserOptions": {
4-
"ecmaFeatures": {
5-
"jsx": true
6-
}
7-
},
8-
"env": {
9-
"browser": true,
10-
"node": false
11-
},
12-
"plugins": [
13-
"react"
14-
],
15-
"rules": {
16-
"react/boolean-prop-naming": 0,
17-
"react/button-has-type": 2,
18-
"react/display-name": 1,
19-
"react/default-props-match-prop-types": 2,
20-
"react/destructuring-assignment": 0,
21-
"react/forbid-component-props": 0,
22-
"react/forbid-elements": 0,
23-
"react/forbid-foreign-prop-types": 2,
24-
"react/forbid-prop-types": 0,
25-
"react/no-access-state-in-setstate": 0,
26-
"react/no-array-index-key": 2,
27-
"react/no-children-prop": 2,
28-
"react/no-danger": 0,
29-
"react/no-danger-with-children": 2,
30-
"react/no-deprecated": 2,
31-
"react/no-did-mount-set-state": 1,
32-
"react/no-did-update-set-state": 1,
33-
"react/no-direct-mutation-state": 2,
34-
"react/no-find-dom-node": 2,
35-
"react/no-is-mounted": 2,
36-
"react/no-multi-comp": 2,
37-
"react/no-redundant-should-component-update": 2,
38-
"react/no-render-return-value": 2,
39-
"react/no-set-state": 0,
40-
"react/no-string-refs": 0,
41-
"react/no-this-in-sfc": 2,
42-
"react/no-typos": 2,
43-
"react/no-unescaped-entities": 0,
44-
"react/no-unknown-property": 2,
45-
"react/no-unused-prop-types": 2,
46-
"react/no-unused-state": 2,
47-
"react/no-will-update-set-state": 2,
48-
"react/prefer-es6-class": 2,
49-
"react/prefer-stateless-function": 0,
50-
"react/prop-types": 0,
51-
"react/react-in-jsx-scope": 1,
52-
"react/require-default-props": [2, {"forbidDefaultForRequired": true}],
53-
"react/require-optimization": 0,
54-
"react/require-render-return": 2,
55-
"react/self-closing-comp": 2,
56-
"react/sort-comp": [2, {
57-
"order": [
58-
"static-methods",
59-
"lifecycle",
60-
"render",
61-
"eventHandlers",
62-
"everything-else"
63-
],
64-
"groups": {
65-
"lifecycle": [
66-
"displayName",
67-
"propTypes",
68-
"contextTypes",
69-
"childContextTypes",
70-
"mixins",
71-
"statics",
72-
"defaultProps",
73-
"constructor",
74-
"getDefaultProps",
75-
"getInitialState",
76-
"state",
77-
"getChildContext",
78-
"componentWillMount",
79-
"componentDidMount",
80-
"componentWillReceiveProps",
81-
"shouldComponentUpdate",
82-
"componentWillUpdate",
83-
"componentDidUpdate",
84-
"componentWillUnmount"
85-
],
86-
"eventHandlers": [
87-
"/^handle[A-Z].+$/"
88-
],
89-
"render": [
90-
"render",
91-
"/^render[A-Z].+$/"
92-
]
93-
}
94-
}],
95-
"react/sort-prop-types": 0,
96-
"react/style-prop-object": 2,
97-
"react/void-dom-elements-no-children": 2,
98-
"react/jsx-boolean-value": [2, "never"],
99-
"react/jsx-closing-bracket-location": [2, "after-props"],
100-
"react/jsx-closing-tag-location": 2,
101-
"react/jsx-curly-brace-presence": [2, "never"],
102-
"react/jsx-curly-spacing": [2, "never"],
103-
"react/jsx-equals-spacing": [2, "never"],
104-
"react/jsx-filename-extension": [2, {"extensions": [".jsx"]}],
105-
"react/jsx-first-prop-new-line": [2, "never"],
106-
"react/jsx-handler-names": [2, {
107-
"eventHandlerPrefix": "handle",
108-
"eventHandlerPropPrefix": "on"
109-
}],
110-
"react/jsx-indent-props": [2, 2],
111-
"react/jsx-indent": [2, 2],
112-
"react/jsx-key": 2,
113-
"react/jsx-max-props-per-line": 0,
114-
"react/jsx-no-bind": 1,
115-
"react/jsx-no-comment-textnodes": 2,
116-
"react/jsx-no-duplicate-props": 2,
117-
"react/jsx-no-literals": 0,
118-
"react/jsx-no-target-blank": 2,
119-
"react/jsx-no-undef": 2,
120-
"react/jsx-pascal-case": 2,
121-
"react/jsx-sort-default-props": 0,
122-
"react/jsx-sort-props": [2, {
123-
"callbacksLast": true,
124-
"shorthandLast": true,
125-
"ignoreCase": true,
126-
"noSortAlphabetically": true,
127-
"reservedFirst": true
128-
}],
129-
"react/jsx-tag-spacing": [2, {
130-
"closingSlash": "never",
131-
"beforeSelfClosing": "never",
132-
"afterOpening": "never"
133-
}],
134-
"react/jsx-uses-react": 2,
135-
"react/jsx-uses-vars": 2,
136-
"react/jsx-wrap-multilines": [2, {
137-
"declaration": "parens-new-line",
138-
"assignment": "parens-new-line",
139-
"return": "parens-new-line",
140-
"arrow": "ignore",
141-
"condition": "ignore",
142-
"logical": "ignore",
143-
"prop": "ignore"
144-
}]
145-
}
2+
"extends": [
3+
"th0r-react",
4+
"../.eslintrc.json"
5+
]
1466
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
"css-loader": "0.28.9",
6161
"del": "3.0.0",
6262
"eslint": "4.16.0",
63+
"eslint-config-th0r": "1.0.0",
64+
"eslint-config-th0r-react": "1.0.0",
6365
"eslint-plugin-react": "7.6.1",
6466
"exports-loader": "0.6.4",
6567
"gulp": "4.0.0",

yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,14 @@ escope@^3.6.0:
22152215
esrecurse "^4.1.0"
22162216
estraverse "^4.1.1"
22172217

2218+
2219+
version "1.0.0"
2220+
resolved "https://registry.npmjs.org/eslint-config-th0r-react/-/eslint-config-th0r-react-1.0.0.tgz#e828657199c1f1516e02f93050e3168c09df34ea"
2221+
2222+
2223+
version "1.0.0"
2224+
resolved "https://registry.npmjs.org/eslint-config-th0r/-/eslint-config-th0r-1.0.0.tgz#3c7315220bf48c134a52383dd7886a131fbda82d"
2225+
22182226
22192227
version "7.6.1"
22202228
resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.6.1.tgz#5d0e908be599f0c02fbf4eef0c7ed6f29dff7633"

0 commit comments

Comments
 (0)