Skip to content

Commit 43ef541

Browse files
committed
Update to latest ESLint and eslint-config-airbnb
1 parent ed897ec commit 43ef541

File tree

6 files changed

+3271
-5368
lines changed

6 files changed

+3271
-5368
lines changed

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,57 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

77
## Unreleased
88

9+
## Features
10+
11+
- Update to ESLint v7 and [eslint-config-airbnb v18.2.1](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/CHANGELOG.md), changing rules that are applied with this config.
12+
13+
Here is a summary of significant rule changes:
14+
15+
```diff
16+
jsx-a11y/aria-role (https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md):
17+
-`error, ignoreNonDom: false`
18+
+`error, ignoreNonDOM: false`
19+
react/sort-comp (https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md):
20+
-`error, order: static-methods, instance-variables, lifecycle,…`
21+
+`error, order: static-variables, static-methods, instance-var…`
22+
react/jsx-props-no-spreading (https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md):
23+
-`error, html: enforce, custom: enforce, exceptions:`
24+
+`error, html: enforce, custom: enforce, explicitSpread: ignore`
25+
import/order (https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md):
26+
-`error, groups: builtin, external, internal`
27+
+`error, groups: builtin, external, internal, warnOnUnassigned…`
28+
import/no-cycle (https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-cycle.md):
29+
-`error, maxDepth: null`
30+
+`error, maxDepth: ∞, ignoreExternal: false`
31+
import/no-useless-path-segments (https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-useless-path-segments.md)
32+
- `error`
33+
+`error, commonjs: true`
34+
array-callback-return (https://eslint.org/docs/rules/array-callback-return):
35+
-`error, allowImplicit: true`
36+
+`error, allowImplicit: true, checkForEach: false`
37+
38+
No longer enforced:
39+
40+
- jsx-a11y/accessible-emoji (https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md) (deprecated)
41+
```
42+
43+
### BREAKING CHANGES
44+
45+
This release updates most of the dependencies of the config:
46+
47+
| package | from | to |
48+
| ------------------------- | ------- | ------- |
49+
| eslint | ^6.0.0 | ^7.2.0 |
50+
| eslint-config-airbnb | ^18.0.0 | ^18.2.1 |
51+
| eslint-plugin-react | ^7.16.0 | ^7.24.0 |
52+
| eslint-plugin-react-hooks | ^1.7.0 | ^4.2.0 |
53+
| eslint-plugin-jsx-a11y | ^6.2.0 | ^6.4.1 |
54+
| eslint-plugin-import | ^2.18.0 | ^2.23.4 |
55+
56+
Users of npm v7 can `npm install --save-dev eslint-config-torchbox@latest` and this will automatically install all required peer dependencies.
57+
58+
For older versions of npm, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all other peerDependencies are updated as well.
59+
960
## [0.3.3](https://github.com/torchbox/eslint-config-torchbox/compare/v0.3.2...v0.3.3) (2020-03-12)
1061

1162
### Bug fixes

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
Install the config along with its peer dependencies:
1010

1111
```sh
12+
# npm v7:
13+
npm install --save-dev eslint-config-torchbox@latest
14+
# npm v6 and below:
1215
npx install-peerdeps --dev eslint-config-torchbox@latest
1316
```
1417

@@ -184,8 +187,8 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
184187

185188
- [react-hooks/rules-of-hooks](https://github.com/jfmengels/eslint-rule-documentation/blob/master/contributing.md)
186189
- [react-hooks/exhaustive-deps](https://github.com/jfmengels/eslint-rule-documentation/blob/master/contributing.md)
187-
- [jsx-a11y/anchor-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md): `error, components:`
188-
- [jsx-a11y/aria-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md): `error, ignoreNonDom: false, ignoreNonDOM: false`
190+
- [jsx-a11y/anchor-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md): `error, components: `
191+
- [jsx-a11y/aria-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md): `error, ignoreNonDOM: false`
189192
- [jsx-a11y/aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md)
190193
- [jsx-a11y/aria-proptypes](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-proptypes.md)
191194
- [jsx-a11y/aria-unsupported-elements](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md)
@@ -199,29 +202,28 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
199202
- [jsx-a11y/role-has-required-aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-has-required-aria-props.md)
200203
- [jsx-a11y/role-supports-aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md)
201204
- [jsx-a11y/tabindex-no-positive](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md)
202-
- [jsx-a11y/heading-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md): `error, components:`
205+
- [jsx-a11y/heading-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md): `error, components: `
203206
- [jsx-a11y/html-has-lang](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md)
204207
- [jsx-a11y/lang](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md)
205208
- [jsx-a11y/no-distracting-elements](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-distracting-elements.md): `error, elements: marquee, blink`
206209
- [jsx-a11y/scope](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/scope.md)
207210
- [jsx-a11y/click-events-have-key-events](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md)
208211
- [jsx-a11y/no-static-element-interactions](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md): `error, handlers: onClick, onMouseDown, onMouseUp, onKeyPress…`
209212
- [jsx-a11y/no-noninteractive-element-interactions](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-interactions.md): `error, handlers: onClick, onMouseDown, onMouseUp, onKeyPress…`
210-
- [jsx-a11y/accessible-emoji](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md)
211213
- [jsx-a11y/aria-activedescendant-has-tabindex](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md)
212214
- [jsx-a11y/iframe-has-title](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/iframe-has-title.md)
213215
- [jsx-a11y/no-autofocus](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md): `error, ignoreNonDOM: true`
214216
- [jsx-a11y/no-redundant-roles](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-redundant-roles.md)
215-
- [jsx-a11y/media-has-caption](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/media-has-caption.md): `error, audio: , video: , track:`
217+
- [jsx-a11y/media-has-caption](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/media-has-caption.md): `error, audio: , video: , track: `
216218
- [jsx-a11y/no-interactive-element-to-noninteractive-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-interactive-element-to-noninteractive-role.md): `error, tr: none, presentation`
217219
- [jsx-a11y/no-noninteractive-element-to-interactive-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-to-interactive-role.md): `error, ul: listbox, menu, menubar, radiogroup, tablist, tree…`
218220
- [jsx-a11y/no-noninteractive-tabindex](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-tabindex.md): `error, tags: , roles: tabpanel`
219221
- [jsx-a11y/anchor-is-valid](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md): `error, components: Link, specialLink: to, aspects: noHref, i…`
220222
- [class-methods-use-this](https://eslint.org/docs/rules/class-methods-use-this): `error, exceptMethods: render, getInitialState, getDefaultPro…`
221-
- [react/jsx-boolean-value](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md): `error, never, always:`
223+
- [react/jsx-boolean-value](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md): `error, never, always: `
222224
- [react/jsx-no-duplicate-props](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md): `error, ignoreCase: true`
223225
- [react/jsx-no-undef](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md)
224-
- [react/jsx-pascal-case](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md): `error, allowAllCaps: true, ignore:`
226+
- [react/jsx-pascal-case](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md): `error, allowAllCaps: true, ignore: `
225227
- [react/jsx-uses-react](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md)
226228
- [react/jsx-uses-vars](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md)
227229
- [react/no-danger](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md): `warn`
@@ -237,7 +239,7 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
237239
- [react/react-in-jsx-scope](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md)
238240
- [react/require-render-return](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md)
239241
- [react/self-closing-comp](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md)
240-
- [react/sort-comp](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md): `error, order: static-methods, instance-variables, lifecycle,`
242+
- [react/sort-comp](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md): `error, order: static-variables, static-methods, instance-var`
241243
- [react/jsx-no-target-blank](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md): `error, enforceDynamicLinks: always`
242244
- [react/jsx-no-comment-textnodes](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md)
243245
- [react/no-render-return-value](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md)
@@ -263,7 +265,7 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
263265
- [react/jsx-fragments](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md): `error, syntax`
264266
- [react/state-in-constructor](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md): `error, always`
265267
- [react/static-property-placement](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md): `error, property assignment`
266-
- [react/jsx-props-no-spreading](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md): `error, html: enforce, custom: enforce, exceptions:`
268+
- [react/jsx-props-no-spreading](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md): `error, html: enforce, custom: enforce, explicitSpread: ignor…`
267269
- [strict](https://eslint.org/docs/rules/strict): `error, never`
268270
- [import/no-unresolved](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md): `error, commonjs: true, caseSensitive: true`
269271
- [import/named](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md)
@@ -275,15 +277,15 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
275277
- [import/first](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md)
276278
- [import/no-duplicates](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md)
277279
- [import/extensions](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md): `error, ignorePackages, js: never, mjs: never, jsx: never`
278-
- [import/order](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md): `error, groups: builtin, external, internal`
280+
- [import/order](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md): `error, groups: builtin, external, internal, warnOnUnassigned…`
279281
- [import/newline-after-import](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md)
280282
- [import/no-absolute-path](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md)
281283
- [import/no-dynamic-require](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md)
282284
- [import/no-webpack-loader-syntax](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md)
283285
- [import/no-named-default](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-default.md)
284286
- [import/no-self-import](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-self-import.md)
285-
- [import/no-cycle](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-cycle.md): `error, maxDepth: null`
286-
- [import/no-useless-path-segments](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-useless-path-segments.md)
287+
- [import/no-cycle](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-cycle.md): `error, maxDepth: ∞, ignoreExternal: false`
288+
- [import/no-useless-path-segments](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-useless-path-segments.md): `error, commonjs: true`
287289
- [constructor-super](https://eslint.org/docs/rules/constructor-super)
288290
- [no-class-assign](https://eslint.org/docs/rules/no-class-assign)
289291
- [no-const-assign](https://eslint.org/docs/rules/no-const-assign)
@@ -305,7 +307,7 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
305307
- [symbol-description](https://eslint.org/docs/rules/symbol-description)
306308
- [no-delete-var](https://eslint.org/docs/rules/no-delete-var)
307309
- [no-label-var](https://eslint.org/docs/rules/no-label-var)
308-
- [no-restricted-globals](https://eslint.org/docs/rules/no-restricted-globals): `error, isFinite, isNaN, addEventListener, blur, close, close`
310+
- [no-restricted-globals](https://eslint.org/docs/rules/no-restricted-globals): `error, name: isFinite, message: Use Number.isFinite instead `
309311
- [no-shadow](https://eslint.org/docs/rules/no-shadow)
310312
- [no-shadow-restricted-names](https://eslint.org/docs/rules/no-shadow-restricted-names)
311313
- [no-undef](https://eslint.org/docs/rules/no-undef)
@@ -329,7 +331,7 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
329331
- [one-var](https://eslint.org/docs/rules/one-var): `error, never`
330332
- [operator-assignment](https://eslint.org/docs/rules/operator-assignment): `error, always`
331333
- [prefer-object-spread](https://eslint.org/docs/rules/prefer-object-spread)
332-
- [spaced-comment](https://eslint.org/docs/rules/spaced-comment): `error, always, line: exceptions: -, +, markers: =, !, block:`
334+
- [spaced-comment](https://eslint.org/docs/rules/spaced-comment): `error, always, line: exceptions: -, +, markers: =, !, /, blo`
333335
- [global-require](https://eslint.org/docs/rules/global-require)
334336
- [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
335337
- [no-new-require](https://eslint.org/docs/rules/no-new-require)
@@ -365,11 +367,11 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
365367
- [no-unsafe-negation](https://eslint.org/docs/rules/no-unsafe-negation)
366368
- [use-isnan](https://eslint.org/docs/rules/use-isnan)
367369
- [valid-typeof](https://eslint.org/docs/rules/valid-typeof): `error, requireStringLiterals: true`
368-
- [array-callback-return](https://eslint.org/docs/rules/array-callback-return): `error, allowImplicit: true`
370+
- [array-callback-return](https://eslint.org/docs/rules/array-callback-return): `error, allowImplicit: true, checkForEach: false`
369371
- [block-scoped-var](https://eslint.org/docs/rules/block-scoped-var)
370372
- [consistent-return](https://eslint.org/docs/rules/consistent-return)
371373
- [default-case](https://eslint.org/docs/rules/default-case): `error, commentPattern: ^no default$`
372-
- [dot-notation](https://eslint.org/docs/rules/dot-notation): `error, allowKeywords: true, allowPattern:`
374+
- [dot-notation](https://eslint.org/docs/rules/dot-notation): `error, allowKeywords: true, allowPattern: `
373375
- [eqeqeq](https://eslint.org/docs/rules/eqeqeq): `error, always, null: ignore`
374376
- [guard-for-in](https://eslint.org/docs/rules/guard-for-in)
375377
- [max-classes-per-file](https://eslint.org/docs/rules/max-classes-per-file): `error, 1`
@@ -384,7 +386,7 @@ eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.jsx,.ts,.t
384386
- [no-extra-bind](https://eslint.org/docs/rules/no-extra-bind)
385387
- [no-extra-label](https://eslint.org/docs/rules/no-extra-label)
386388
- [no-fallthrough](https://eslint.org/docs/rules/no-fallthrough)
387-
- [no-global-assign](https://eslint.org/docs/rules/no-global-assign): `error, exceptions:`
389+
- [no-global-assign](https://eslint.org/docs/rules/no-global-assign): `error, exceptions: `
388390
- [no-implied-eval](https://eslint.org/docs/rules/no-implied-eval)
389391
- [no-iterator](https://eslint.org/docs/rules/no-iterator)
390392
- [no-labels](https://eslint.org/docs/rules/no-labels): `error, allowLoop: false, allowSwitch: false`

0 commit comments

Comments
 (0)