Skip to content

Commit 34fb973

Browse files
committed
Upgrade to ESLint v8 and latest compatible release of eslint-config-airbnb
1 parent 19881fc commit 34fb973

File tree

10 files changed

+1792
-2167
lines changed

10 files changed

+1792
-2167
lines changed

CHANGELOG.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,60 @@ 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 v8 and [eslint-config-airbnb v19.0.2](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/CHANGELOG.md), changing rules that are applied with this config.
12+
13+
There are a number of existing rules that are now enforced:
14+
15+
- [default-case-last](https://eslint.org/docs/rules/default-case-last)
16+
- [default-param-last](https://eslint.org/docs/rules/default-param-last)
17+
- [grouped-accessor-pairs](https://eslint.org/docs/rules/grouped-accessor-pairs)
18+
- [no-constructor-return](https://eslint.org/docs/rules/no-constructor-return)
19+
- [no-dupe-else-if](https://eslint.org/docs/rules/no-dupe-else-if)
20+
- [no-import-assign](https://eslint.org/docs/rules/no-import-assign)
21+
- [no-loss-of-precision](https://eslint.org/docs/rules/no-loss-of-precision)
22+
- [no-promise-executor-return](https://eslint.org/docs/rules/no-promise-executor-return)
23+
- [no-restricted-exports](https://eslint.org/docs/rules/no-restricted-exports) (restricted: default, then)
24+
- [no-setter-return](https://eslint.org/docs/rules/no-setter-return)
25+
- [no-unreachable-loop](https://eslint.org/docs/rules/no-unreachable-loop)
26+
- [no-useless-backreference](https://eslint.org/docs/rules/no-useless-backreference)
27+
- [prefer-exponentiation-operator](https://eslint.org/docs/rules/prefer-exponentiation-operator) (`**` over `Math.pow`)
28+
- [prefer-regex-literals](https://eslint.org/docs/rules/prefer-regex-literals)
29+
- [react/jsx-no-script-url](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md)
30+
- [react/jsx-no-useless-fragment](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md)
31+
32+
And brand new rules introduced with this release:
33+
34+
- [no-nonoctal-decimal-escape](https://eslint.org/docs/rules/no-nonoctal-decimal-escape)
35+
- [no-unsafe-optional-chaining](https://eslint.org/docs/rules/no-unsafe-optional-chaining)
36+
- [import/no-import-module-exports](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-import-module-exports.md)
37+
- [import/no-relative-packages](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md)
38+
- [react/no-arrow-function-lifecycle](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-arrow-function-lifecycle.md)
39+
- [react/no-invalid-html-attribute](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-invalid-html-attribute.md)
40+
- [react/no-namespace](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-namespace.md)
41+
- [react/no-unstable-nested-components](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md)
42+
- [react/no-unused-class-component-methods](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-class-component-methods.md)
43+
- [react/jsx-no-constructed-context-values](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md)
44+
45+
### BREAKING CHANGES
46+
47+
This release updates most of the dependencies of the config:
48+
49+
| package | from | to |
50+
| ------------------------- | ------- | ------- |
51+
| eslint | ^7.2.0 | ^8.2.0 |
52+
| eslint-config-airbnb | ^18.2.1 | ^19.0.2 |
53+
| eslint-config-prettier | ^8.3.0 | ^8.3.0 |
54+
| eslint-plugin-react | ^7.24.0 | ^7.27.1 |
55+
| eslint-plugin-react-hooks | ^4.2.0 | ^4.3.0 |
56+
| eslint-plugin-jsx-a11y | ^6.4.1 | ^6.5.1 |
57+
| eslint-plugin-import | ^2.23.4 | ^2.25.3 |
58+
59+
Users of npm v7 can `npm install --save-dev eslint-config-torchbox@latest` and this will automatically install all required peer dependencies.
60+
61+
For older versions of npm, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all other peerDependencies are updated as well.
62+
963
## [0.4.0](https://github.com/torchbox/eslint-config-torchbox/compare/v0.3.3...v0.4.0) (2021-07-15)
1064

1165
## Features

README.md

Lines changed: 50 additions & 22 deletions
Large diffs are not rendered by default.

config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ module.exports = {
3131
'react/jsx-no-bind': [0],
3232
// We do not want files whose content might change to have to be renamed.
3333
'react/jsx-filename-extension': [2, { extensions: ['.js'] }],
34+
// We enforce extact props with TypeScript, not PropTypes or Flow.
35+
'react/prefer-exact-props': [0],
36+
// Disabled until Airbnb configuration resolves https://github.com/airbnb/javascript/issues/2505.
37+
'react/function-component-definition': [0],
3438
// Allow devDependencies to be used in Storybook stories.
3539
'import/no-extraneous-dependencies': [
3640
2,

0 commit comments

Comments
 (0)