From 82170f91272bcda42556c91cb40056b309b999c7 Mon Sep 17 00:00:00 2001
From: Pirasis <1pete@users.noreply.github.com>
Date: Sun, 11 Oct 2020 21:28:52 +0700
Subject: [PATCH 001/148] [guide] add eslint rule reference for
`prefer-object-spread`
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index cbd712db68..6a0e844b0a 100644
--- a/README.md
+++ b/README.md
@@ -306,7 +306,7 @@ Other Style Guides
```
- - [3.8](#objects--rest-spread) Prefer the object spread operator over [`Object.assign`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) to shallow-copy objects. Use the object rest operator to get a new object with certain properties omitted.
+ - [3.8](#objects--rest-spread) Prefer the object spread operator over [`Object.assign`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) to shallow-copy objects. Use the object rest operator to get a new object with certain properties omitted. eslint: [`prefer-object-spread`](https://eslint.org/docs/rules/prefer-object-spread)
```javascript
// very bad
From aa43bb23987a14baaa795cf795540a3f2eb41872 Mon Sep 17 00:00:00 2001
From: Daniel Paz <42693974+danielpaz6@users.noreply.github.com>
Date: Wed, 14 Oct 2020 18:48:40 +0300
Subject: [PATCH 002/148] [guide] add explanation about why to use radix when
using parseInt
I added an explanation at [22.3](https://github.com/airbnb/javascript/blob/master/README.md#coercion--numbers) why to use radix once parseInt, this explanation has been taken from [Mozilla's docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#Octal_interpretations_with_no_radix).
I think it's not clear without an explanation since people can think that it's obvious that string will be parsed to 10 base number, but it's not always the case.
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 6a0e844b0a..3c783eda89 100644
--- a/README.md
+++ b/README.md
@@ -3166,6 +3166,8 @@ Other Style Guides
- [22.3](#coercion--numbers) Numbers: Use `Number` for type casting and `parseInt` always with a radix for parsing strings. eslint: [`radix`](https://eslint.org/docs/rules/radix) [`no-new-wrappers`](https://eslint.org/docs/rules/no-new-wrappers)
+ > Why? The `parseInt` function produces an integer value dictated by interpretation of the contents of the string argument according to the specified radix. Leading whitespace in string is ignored. If radix is `undefined` or `0`, it is assumed to be `10` except when the number begins with the character pairs `0x` or `0X`, in which case a radix of 16 is assumed. This differs from ECMAScript 3, which merely discouraged (but allowed) octal interpretation. Many implementations have not adopted this behavior as of 2013. And, because older browsers must be supported, always specify a radix.
+
```javascript
const inputValue = '4';
From ee2f22a10c0b82a21eaa7743905712b6cb145fc2 Mon Sep 17 00:00:00 2001
From: Daniel Paz <42693974+danielpaz6@users.noreply.github.com>
Date: Fri, 16 Oct 2020 14:02:43 +0300
Subject: [PATCH 003/148] [guide] Better link reference to Drupal's linter
This link was taken from their Code standard page: https://www.drupal.org/docs/develop/standards/javascript/eslint-settings
The previous link wasn't very informative and required a download process in order to check their standards.
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3c783eda89..35965be830 100644
--- a/README.md
+++ b/README.md
@@ -3860,7 +3860,7 @@ Other Style Guides
- **DailyMotion**: [dailymotion/javascript](https://github.com/dailymotion/javascript)
- **DoSomething**: [DoSomething/eslint-config](https://github.com/DoSomething/eslint-config)
- **Digitpaint** [digitpaint/javascript](https://github.com/digitpaint/javascript)
- - **Drupal**: [www.drupal.org](https://www.drupal.org/project/drupal)
+ - **Drupal**: [www.drupal.org](https://git.drupalcode.org/project/drupal/blob/8.6.x/core/.eslintrc.json)
- **Ecosia**: [ecosia/javascript](https://github.com/ecosia/javascript)
- **Evernote**: [evernote/javascript-style-guide](https://github.com/evernote/javascript-style-guide)
- **Evolution Gaming**: [evolution-gaming/javascript](https://github.com/evolution-gaming/javascript)
From 2c5c88d0487db3024e8a20bb20f46933a03dd8aa Mon Sep 17 00:00:00 2001
From: Michael Flores
Date: Wed, 21 Oct 2020 23:10:31 -0500
Subject: [PATCH 004/148] [guide] Update reason for preferring object
destructuring
Fixes #2293
The reason for preferring object destructuring is quite narrow in scope. While this guide isn't intended to provide every possible reason for every preference, it perhaps should aim to provide a succinct and compelling reason. The current reasoning could be improved to meet this standard, so I'm proposing adding some additional information to clarify the benefits of what is an often controversial rule (controversial only because its introduction can require many changes in a mature codebase and has no auto fix available).
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 35965be830..987854664e 100644
--- a/README.md
+++ b/README.md
@@ -497,7 +497,7 @@ Other Style Guides
- [5.1](#destructuring--object) Use object destructuring when accessing and using multiple properties of an object. eslint: [`prefer-destructuring`](https://eslint.org/docs/rules/prefer-destructuring)
- > Why? Destructuring saves you from creating temporary references for those properties.
+ > Why? Destructuring saves you from creating temporary references for those properties, and from repetitive access of the object. Repeating object access creates more repetitive code, requires more reading, and creates more opportunities for mistakes. Destructuring objects also provides a single site of definition of the object structure that is used in the block, rather than requiring reading the entire block to determine what is used.
```javascript
// bad
From b30b0e4d917bf74d90cc39c4d74237957fe7b603 Mon Sep 17 00:00:00 2001
From: Samuel Scheiderich
Date: Sat, 24 Oct 2020 16:30:10 -0400
Subject: [PATCH 005/148] [eslint-config] [base] `no-restricted-globals`: add
better messages
---
.../eslint-config-airbnb-base/rules/variables.js | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/packages/eslint-config-airbnb-base/rules/variables.js b/packages/eslint-config-airbnb-base/rules/variables.js
index 701340ab56..6fb98bcfb6 100644
--- a/packages/eslint-config-airbnb-base/rules/variables.js
+++ b/packages/eslint-config-airbnb-base/rules/variables.js
@@ -16,7 +16,19 @@ module.exports = {
'no-label-var': 'error',
// disallow specific globals
- 'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(confusingBrowserGlobals),
+ 'no-restricted-globals': [
+ 'error',
+ {
+ name: 'isFinite',
+ message:
+ 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
+ },
+ {
+ name: 'isNaN',
+ message:
+ 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
+ },
+ ].concat(confusingBrowserGlobals),
// disallow declaration of variables already declared in the outer scope
'no-shadow': 'error',
From d3c7b84d9e513fc1388de28775574ed614ee33e6 Mon Sep 17 00:00:00 2001
From: alvyn le
Date: Wed, 23 Sep 2020 01:30:35 -0400
Subject: [PATCH 006/148] [eslint config] [patch] Fixed `handle` and `on`
ordering in `sort-comp` rule
- fixes #2116
---
packages/eslint-config-airbnb/rules/react.js | 1 +
.../test/test-react-order.js | 47 ++++++++++++++++++-
react/README.md | 3 +-
3 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js
index 84bbf6c162..4134ed5e11 100644
--- a/packages/eslint-config-airbnb/rules/react.js
+++ b/packages/eslint-config-airbnb/rules/react.js
@@ -244,6 +244,7 @@ module.exports = {
'static-methods',
'instance-variables',
'lifecycle',
+ '/^handle.+$/',
'/^on.+$/',
'getters',
'setters',
diff --git a/packages/eslint-config-airbnb/test/test-react-order.js b/packages/eslint-config-airbnb/test/test-react-order.js
index d45cac8ae1..a394fe1c3c 100644
--- a/packages/eslint-config-airbnb/test/test-react-order.js
+++ b/packages/eslint-config-airbnb/test/test-react-order.js
@@ -33,7 +33,7 @@ ${body}}
`;
}
-test('validate react prop order', (t) => {
+test('validate react methods order', (t) => {
t.test('make sure our eslintrc has React and JSX linting dependencies', (t) => {
t.plan(2);
t.deepEqual(reactRules.plugins, ['react']);
@@ -44,6 +44,8 @@ test('validate react prop order', (t) => {
t.plan(3);
const result = lint(wrapComponent(`
componentDidMount() {}
+ handleSubmit() {}
+ onButtonAClick() {}
setFoo() {}
getFoo() {}
setBar() {}
@@ -88,4 +90,47 @@ test('validate react prop order', (t) => {
t.ok(result.errorCount, 'fails');
t.deepEqual(result.messages.map((msg) => msg.ruleId), ['react/sort-comp'], 'fails due to sort');
});
+
+ t.test('order: when handler method with `handle` prefix after method with `on` prefix', (t) => {
+ t.plan(2);
+ const result = lint(wrapComponent(`
+ componentDidMount() {}
+ onButtonAClick() {}
+ handleSubmit() {}
+ setFoo() {}
+ getFoo() {}
+ render() { return ; }
+`));
+
+ t.ok(result.errorCount, 'fails');
+ t.deepEqual(result.messages.map((msg) => msg.ruleId), ['react/sort-comp'], 'fails due to sort');
+ });
+
+ t.test('order: when lifecycle methods after event handler methods', (t) => {
+ t.plan(2);
+ const result = lint(wrapComponent(`
+ handleSubmit() {}
+ componentDidMount() {}
+ setFoo() {}
+ getFoo() {}
+ render() { return ; }
+`));
+
+ t.ok(result.errorCount, 'fails');
+ t.deepEqual(result.messages.map((msg) => msg.ruleId), ['react/sort-comp'], 'fails due to sort');
+ });
+
+ t.test('order: when event handler methods after getters and setters', (t) => {
+ t.plan(2);
+ const result = lint(wrapComponent(`
+ componentDidMount() {}
+ setFoo() {}
+ getFoo() {}
+ handleSubmit() {}
+ render() { return ; }
+`));
+
+ t.ok(result.errorCount, 'fails');
+ t.deepEqual(result.messages.map((msg) => msg.ruleId), ['react/sort-comp'], 'fails due to sort');
+ });
});
diff --git a/react/README.md b/react/README.md
index 4811ddaf70..e7679d26da 100644
--- a/react/README.md
+++ b/react/README.md
@@ -667,7 +667,8 @@ We don’t recommend using indexes for keys if the order of items may change.
1. `componentWillUpdate`
1. `componentDidUpdate`
1. `componentWillUnmount`
- 1. *clickHandlers or eventHandlers* like `onClickSubmit()` or `onChangeDescription()`
+ 1. *event handlers starting with 'handle'* like `handleSubmit()` or `handleChangeDescription()`
+ 1. *event handlers starting with 'on'* like `onClickSubmit()` or `onChangeDescription()`
1. *getter methods for `render`* like `getSelectReason()` or `getFooterContent()`
1. *optional render methods* like `renderNavigation()` or `renderProfilePicture()`
1. `render`
From 05c3bb0018fcd46a41fec07a1308075c7aaea197 Mon Sep 17 00:00:00 2001
From: Alex Mercier
Date: Fri, 23 Oct 2020 13:30:37 +0100
Subject: [PATCH 007/148] [eslint config] [patch] Fix ignoreNonDOM typo in
jsx-a11y/aria-role rule
This should be `ignoreNonDOM` not `ignoreNonDom` according to [documentation](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md).
---
packages/eslint-config-airbnb/rules/react-a11y.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/eslint-config-airbnb/rules/react-a11y.js b/packages/eslint-config-airbnb/rules/react-a11y.js
index 85485b03bb..f48ebdbb4a 100644
--- a/packages/eslint-config-airbnb/rules/react-a11y.js
+++ b/packages/eslint-config-airbnb/rules/react-a11y.js
@@ -17,7 +17,7 @@ module.exports = {
// Require ARIA roles to be valid and non-abstract
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md
- 'jsx-a11y/aria-role': ['error', { ignoreNonDom: false }],
+ 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: false }],
// Enforce all aria-* props are valid.
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md
From 8996aa7c5369baef60c5c8c07df4b6eaae46279e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ky=E2=84=93e=20Hensel?=
Date: Tue, 27 Oct 2020 08:54:41 +1300
Subject: [PATCH 008/148] [eslint config] [patch] remove deprecated
`jsx-a11y/accessible-emoji` rule
---
packages/eslint-config-airbnb/rules/react-a11y.js | 4 ----
1 file changed, 4 deletions(-)
diff --git a/packages/eslint-config-airbnb/rules/react-a11y.js b/packages/eslint-config-airbnb/rules/react-a11y.js
index f48ebdbb4a..26a9256975 100644
--- a/packages/eslint-config-airbnb/rules/react-a11y.js
+++ b/packages/eslint-config-airbnb/rules/react-a11y.js
@@ -178,10 +178,6 @@ module.exports = {
]
}],
- // ensure emoji are accessible
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md
- 'jsx-a11y/accessible-emoji': 'error',
-
// elements with aria-activedescendant must be tabbable
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
From 25b64d7f46a1efc85792dc250d0d1a2eb705a0d8 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 09:59:46 -0800
Subject: [PATCH 009/148] [dev deps] update `markdownlint`, `markdownlint-cli`
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index e4fe0f3dea..77adc2e32d 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,7 @@
},
"homepage": "https://github.com/airbnb/javascript",
"devDependencies": {
- "markdownlint": "^0.20.3",
- "markdownlint-cli": "^0.23.1"
+ "markdownlint": "^0.20.4",
+ "markdownlint-cli": "^0.23.2"
}
}
From f0492d59bdee973ad1362b290a75016dea279953 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 10:00:59 -0800
Subject: [PATCH 010/148] [eslint config] [*] [dev deps] update
`@babel/runtime`, `eslint-find-rules`, `eslint-plugin-import`
---
packages/eslint-config-airbnb-base/package.json | 8 ++++----
packages/eslint-config-airbnb/package.json | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json
index 7bb31343e5..c1055e457a 100644
--- a/packages/eslint-config-airbnb-base/package.json
+++ b/packages/eslint-config-airbnb-base/package.json
@@ -53,20 +53,20 @@
},
"homepage": "https://github.com/airbnb/javascript",
"devDependencies": {
- "@babel/runtime": "^7.11.2",
+ "@babel/runtime": "^7.12.5",
"babel-preset-airbnb": "^4.5.0",
"babel-tape-runner": "^3.0.0",
"eclint": "^2.8.1",
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
- "eslint-find-rules": "^3.6.0",
- "eslint-plugin-import": "^2.22.0",
+ "eslint-find-rules": "^3.6.1",
+ "eslint-plugin-import": "^2.22.1",
"in-publish": "^2.0.1",
"safe-publish-latest": "^1.1.4",
"tape": "^5.0.1"
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
- "eslint-plugin-import": "^2.22.0"
+ "eslint-plugin-import": "^2.22.1"
},
"engines": {
"node": ">= 6"
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index 105b3811a6..e6e6b293bb 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -59,13 +59,13 @@
"object.entries": "^1.1.2"
},
"devDependencies": {
- "@babel/runtime": "^7.11.2",
+ "@babel/runtime": "^7.12.5",
"babel-preset-airbnb": "^4.5.0",
"babel-tape-runner": "^3.0.0",
"eclint": "^2.8.1",
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
- "eslint-find-rules": "^3.6.0",
- "eslint-plugin-import": "^2.22.0",
+ "eslint-find-rules": "^3.6.1",
+ "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0",
@@ -76,7 +76,7 @@
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
- "eslint-plugin-import": "^2.22.0",
+ "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.3.0",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0"
From e149b0536659a464c34dad19276f9db3e6c9a16c Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 10:03:46 -0800
Subject: [PATCH 011/148] [eslint config] [*] [deps] update
`confusing-browser-globals`, `object.assign`
---
packages/eslint-config-airbnb-base/package.json | 4 ++--
packages/eslint-config-airbnb/package.json | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json
index c1055e457a..cfc41fc77c 100644
--- a/packages/eslint-config-airbnb-base/package.json
+++ b/packages/eslint-config-airbnb-base/package.json
@@ -72,8 +72,8 @@
"node": ">= 6"
},
"dependencies": {
- "confusing-browser-globals": "^1.0.9",
- "object.assign": "^4.1.0",
+ "confusing-browser-globals": "^1.0.10",
+ "object.assign": "^4.1.2",
"object.entries": "^1.1.2"
}
}
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index e6e6b293bb..d85058c549 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -55,7 +55,7 @@
"homepage": "https://github.com/airbnb/javascript",
"dependencies": {
"eslint-config-airbnb-base": "^14.2.0",
- "object.assign": "^4.1.0",
+ "object.assign": "^4.1.2",
"object.entries": "^1.1.2"
},
"devDependencies": {
From 36f23d7886e42aaa5530d2da0541b1f3faf8b4a6 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 10:10:00 -0800
Subject: [PATCH 012/148] [eslint config] [base] v14.2.1
---
packages/eslint-config-airbnb-base/CHANGELOG.md | 8 ++++++++
packages/eslint-config-airbnb-base/package.json | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/packages/eslint-config-airbnb-base/CHANGELOG.md b/packages/eslint-config-airbnb-base/CHANGELOG.md
index 2dd956f691..5f8dddf100 100644
--- a/packages/eslint-config-airbnb-base/CHANGELOG.md
+++ b/packages/eslint-config-airbnb-base/CHANGELOG.md
@@ -1,3 +1,11 @@
+14.2.1 / 2020-11-06
+==================
+ - [base] `no-restricted-globals`: add better messages (#2320)
+ - [base] add new core eslint rules, set to off
+ - [deps] update `confusing-browser-globals`, `object.assign`
+ - [deps] update `eslint-plugin-import`, use valid `import/no-cycle` `maxDepth` option (#2250, #2249)
+ - [dev deps] update `@babel/runtime`, `eslint-find-rules`, `eslint-plugin-import`
+
14.2.0 / 2020-06-10
==================
- [new] add `eslint` `v7`
diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json
index cfc41fc77c..548e717698 100644
--- a/packages/eslint-config-airbnb-base/package.json
+++ b/packages/eslint-config-airbnb-base/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-airbnb-base",
- "version": "14.2.0",
+ "version": "14.2.1",
"description": "Airbnb's base JS ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
From b7015dd0b3811e71b9423342124d5cf135f78785 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 14:12:51 -0800
Subject: [PATCH 013/148] [eslint config] [deps] update
`eslint-config-airbnb-base`
---
packages/eslint-config-airbnb/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index d85058c549..17fb7b3bf3 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -54,7 +54,7 @@
},
"homepage": "https://github.com/airbnb/javascript",
"dependencies": {
- "eslint-config-airbnb-base": "^14.2.0",
+ "eslint-config-airbnb-base": "^14.2.1",
"object.assign": "^4.1.2",
"object.entries": "^1.1.2"
},
From eee79a5455c93bb094d673cf194df5e6403d573e Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 14:14:17 -0800
Subject: [PATCH 014/148] [eslint config] [deps] update
`eslint-plugin-jsx-a11y`, `eslint-plugin-react`
---
packages/eslint-config-airbnb/package.json | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index 17fb7b3bf3..e5e1aabb93 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -66,8 +66,8 @@
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
"eslint-find-rules": "^3.6.1",
"eslint-plugin-import": "^2.22.1",
- "eslint-plugin-jsx-a11y": "^6.3.1",
- "eslint-plugin-react": "^7.20.5",
+ "eslint-plugin-jsx-a11y": "^6.4.1",
+ "eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0",
"in-publish": "^2.0.1",
"react": ">= 0.13.0",
@@ -77,8 +77,8 @@
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
"eslint-plugin-import": "^2.22.1",
- "eslint-plugin-jsx-a11y": "^6.3.0",
- "eslint-plugin-react": "^7.20.0",
+ "eslint-plugin-jsx-a11y": "^6.4.1",
+ "eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0"
},
"engines": {
From e5de51e55f56a68891f1cb95fe234649c015e279 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 14:19:17 -0800
Subject: [PATCH 015/148] [eslint config] [patch] re-add
`jsx-a11y/accessible-emoji`, but disabled
See #2322
---
packages/eslint-config-airbnb/rules/react-a11y.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/packages/eslint-config-airbnb/rules/react-a11y.js b/packages/eslint-config-airbnb/rules/react-a11y.js
index 26a9256975..5898ca9eb3 100644
--- a/packages/eslint-config-airbnb/rules/react-a11y.js
+++ b/packages/eslint-config-airbnb/rules/react-a11y.js
@@ -178,6 +178,11 @@ module.exports = {
]
}],
+ // ensure emoji are accessible
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md
+ // disabled; rule is deprecated
+ 'jsx-a11y/accessible-emoji': 'off',
+
// elements with aria-activedescendant must be tabbable
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
From 37d48dbf6082bd8958fdc5db5df207bb1166d653 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Fri, 6 Nov 2020 14:20:24 -0800
Subject: [PATCH 016/148] [eslint config] v18.2.1
---
packages/eslint-config-airbnb/CHANGELOG.md | 9 +++++++++
packages/eslint-config-airbnb/package.json | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/packages/eslint-config-airbnb/CHANGELOG.md b/packages/eslint-config-airbnb/CHANGELOG.md
index 11595f01a6..745b541d58 100644
--- a/packages/eslint-config-airbnb/CHANGELOG.md
+++ b/packages/eslint-config-airbnb/CHANGELOG.md
@@ -1,3 +1,12 @@
+18.2.1 / 2020-11-06
+==================
+ - [patch] remove deprecated `jsx-a11y/accessible-emoji` rule (#2322)
+ - [patch] Fix ignoreNonDOM typo in jsx-a11y/aria-role rule (#2318)
+ - [patch] Fixed `handle` and `on` ordering in `sort-comp` rule (#2287)
+ - [deps] update `eslint-plugin-jsx-a11y`, `eslint-plugin-react`
+ - [deps] update `eslint-config-airbnb-base`, `object.assign`
+ - [dev deps] update `@babel/runtime`, `eslint-find-rules`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react`
+
18.2.0 / 2020-06-18
==================
- [new] add `eslint` `v7` (#2240)
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index e5e1aabb93..1f37f8fa05 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-airbnb",
- "version": "18.2.0",
+ "version": "18.2.1",
"description": "Airbnb's ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
From f0df3a8680479ff0b897cd98a1eab6b156899214 Mon Sep 17 00:00:00 2001
From: Hugo Alliaume
Date: Sat, 7 Nov 2020 08:17:29 +0100
Subject: [PATCH 017/148] [eslint config] [base]
`import/no-extraneous-dependencies`: Add .eslintrc.js to devDeps
Similar to #1168 and #1522.
---
packages/eslint-config-airbnb-base/rules/imports.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/eslint-config-airbnb-base/rules/imports.js b/packages/eslint-config-airbnb-base/rules/imports.js
index 95568d6103..ca91e9fc93 100644
--- a/packages/eslint-config-airbnb-base/rules/imports.js
+++ b/packages/eslint-config-airbnb-base/rules/imports.js
@@ -90,7 +90,8 @@ module.exports = {
'**/Gruntfile{,.js}', // grunt config
'**/protractor.conf.js', // protractor config
'**/protractor.conf.*.js', // protractor config
- '**/karma.conf.js' // karma config
+ '**/karma.conf.js', // karma config
+ '**/.eslintrc.js' // eslint config
],
optionalDependencies: false,
}],
From 5620bd5620b17184f57cd97ebf03b0efee3cc464 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Sat, 21 Nov 2020 00:59:24 -0800
Subject: [PATCH 018/148] [eslint config] [base] add
`no-nonoctal-decimal-escape` rule
---
packages/eslint-config-airbnb-base/rules/best-practices.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js
index 8e1d991304..4c73b1f11a 100644
--- a/packages/eslint-config-airbnb-base/rules/best-practices.js
+++ b/packages/eslint-config-airbnb-base/rules/best-practices.js
@@ -182,6 +182,11 @@ module.exports = {
// disallows creating new instances of String, Number, and Boolean
'no-new-wrappers': 'error',
+ // Disallow \8 and \9 escape sequences in string literals
+ // https://eslint.org/docs/rules/no-nonoctal-decimal-escape
+ // todo: semver-major: enable when v7.14 is required
+ 'no-nonoctal-decimal-escape': 'off',
+
// disallow use of (old style) octal literals
'no-octal': 'error',
From 1f786e154f6c32385607e1688370d7f2d053f88f Mon Sep 17 00:00:00 2001
From: Jeremy
Date: Wed, 11 Nov 2020 20:17:20 -0600
Subject: [PATCH 019/148] [eslint config] [base] [patch] fix spelling of "than"
you mean "than" not "then".
---
packages/eslint-config-airbnb-base/rules/best-practices.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js
index 4c73b1f11a..e3420416ef 100644
--- a/packages/eslint-config-airbnb-base/rules/best-practices.js
+++ b/packages/eslint-config-airbnb-base/rules/best-practices.js
@@ -147,7 +147,7 @@ module.exports = {
// disallow usage of __iterator__ property
'no-iterator': 'error',
- // disallow use of labels for anything other then loops and switches
+ // disallow use of labels for anything other than loops and switches
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
// disallow unnecessary nested blocks
@@ -217,7 +217,7 @@ module.exports = {
// disallow usage of __proto__ property
'no-proto': 'error',
- // disallow declaring the same variable more then once
+ // disallow declaring the same variable more than once
'no-redeclare': 'error',
// disallow certain object properties
From 63098cbb6c05376dbefc9a91351f5727540c1ce1 Mon Sep 17 00:00:00 2001
From: Hollow Man
Date: Fri, 20 Nov 2020 22:49:57 +0800
Subject: [PATCH 020/148] [eslint config] [base] [patch] arthmetic ->
arithmetic
---
packages/eslint-config-airbnb-base/rules/style.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js
index 8403ebb75b..c988fe5f3a 100644
--- a/packages/eslint-config-airbnb-base/rules/style.js
+++ b/packages/eslint-config-airbnb-base/rules/style.js
@@ -293,7 +293,7 @@ module.exports = {
// disallow un-paren'd mixes of different operators
// https://eslint.org/docs/rules/no-mixed-operators
'no-mixed-operators': ['error', {
- // the list of arthmetic groups disallows mixing `%` and `**`
+ // the list of arithmetic groups disallows mixing `%` and `**`
// with other arithmetic operators.
groups: [
['%', '**'],
From 66cd156a489f2fb82aa55fd4d556ff1c0be9b4e4 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Tue, 29 Dec 2020 21:32:08 -0800
Subject: [PATCH 021/148] [*] [dev deps] update `tape`
---
packages/eslint-config-airbnb-base/package.json | 2 +-
packages/eslint-config-airbnb/package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json
index 548e717698..22318cad12 100644
--- a/packages/eslint-config-airbnb-base/package.json
+++ b/packages/eslint-config-airbnb-base/package.json
@@ -62,7 +62,7 @@
"eslint-plugin-import": "^2.22.1",
"in-publish": "^2.0.1",
"safe-publish-latest": "^1.1.4",
- "tape": "^5.0.1"
+ "tape": "^5.1.0"
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index 1f37f8fa05..9bb77ff939 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -72,7 +72,7 @@
"in-publish": "^2.0.1",
"react": ">= 0.13.0",
"safe-publish-latest": "^1.1.4",
- "tape": "^5.0.1"
+ "tape": "^5.1.0"
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
From fb3214c9d650ed66d7e363e8b2eed0f07e514d32 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Tue, 29 Dec 2020 21:32:29 -0800
Subject: [PATCH 022/148] [*] [deps] update `object.entries`
---
packages/eslint-config-airbnb-base/package.json | 2 +-
packages/eslint-config-airbnb/package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json
index 22318cad12..b86a415362 100644
--- a/packages/eslint-config-airbnb-base/package.json
+++ b/packages/eslint-config-airbnb-base/package.json
@@ -74,6 +74,6 @@
"dependencies": {
"confusing-browser-globals": "^1.0.10",
"object.assign": "^4.1.2",
- "object.entries": "^1.1.2"
+ "object.entries": "^1.1.3"
}
}
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index 9bb77ff939..30b2da1b03 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -56,7 +56,7 @@
"dependencies": {
"eslint-config-airbnb-base": "^14.2.1",
"object.assign": "^4.1.2",
- "object.entries": "^1.1.2"
+ "object.entries": "^1.1.3"
},
"devDependencies": {
"@babel/runtime": "^7.12.5",
From b9ff0aee71a31ebc5ec7b022c8a9fab49a589d7e Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Tue, 29 Dec 2020 21:34:18 -0800
Subject: [PATCH 023/148] [eslint-config] [base] add disabled
`no-unsafe-optional-chaining` rule
---
packages/eslint-config-airbnb-base/rules/errors.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/packages/eslint-config-airbnb-base/rules/errors.js b/packages/eslint-config-airbnb-base/rules/errors.js
index fa54905ef8..71ebcdecc6 100644
--- a/packages/eslint-config-airbnb-base/rules/errors.js
+++ b/packages/eslint-config-airbnb-base/rules/errors.js
@@ -149,6 +149,11 @@ module.exports = {
// https://eslint.org/docs/rules/no-unsafe-negation
'no-unsafe-negation': 'error',
+ // disallow use of optional chaining in contexts where the undefined value is not allowed
+ // https://eslint.org/docs/rules/no-unsafe-optional-chaining
+ // TODO: enable, semver-minor, once eslint v7.15 is required (which is major)
+ 'no-unsafe-optional-chaining': ['off', { disallowArithmeticOperators: true }],
+
// Disallow useless backreferences in regular expressions
// https://eslint.org/docs/rules/no-useless-backreference
// TODO: enable, semver-minor, once eslint v7 is required (which is major)
From db8b6ceb33289b542e8aca192a6aefaf21c4a14c Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Tue, 29 Dec 2020 21:37:48 -0800
Subject: [PATCH 024/148] [eslint config] update `eslint-plugin-react`, add new
rules, disabled
---
packages/eslint-config-airbnb/package.json | 4 ++--
packages/eslint-config-airbnb/rules/react.js | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index 30b2da1b03..f3a9057e5c 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -67,7 +67,7 @@
"eslint-find-rules": "^3.6.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
- "eslint-plugin-react": "^7.21.5",
+ "eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0",
"in-publish": "^2.0.1",
"react": ">= 0.13.0",
@@ -78,7 +78,7 @@
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
- "eslint-plugin-react": "^7.21.5",
+ "eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0"
},
"engines": {
diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js
index 4134ed5e11..24d9fffaa5 100644
--- a/packages/eslint-config-airbnb/rules/react.js
+++ b/packages/eslint-config-airbnb/rules/react.js
@@ -531,6 +531,15 @@ module.exports = {
namedComponents: 'function-expression',
unnamedComponents: 'function-expression',
}],
+
+ // Enforce a new line after jsx elements and expressions
+ // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-newline.md
+ 'react/jsx-newline': 'off',
+
+ // Prevent react contexts from taking non-stable values
+ // https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md
+ // TODO: enable, semver-minor
+ 'react/jsx-no-constructed-context-values': 'off',
},
settings: {
From ea5ec0c5242a4b987eb4a2861d65298450fb05d0 Mon Sep 17 00:00:00 2001
From: marsonya
Date: Wed, 30 Dec 2020 10:44:32 +0530
Subject: [PATCH 025/148] [readme] removed dead links - 404 not found
---
README.md | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/README.md b/README.md
index 987854664e..284ca26e7f 100644
--- a/README.md
+++ b/README.md
@@ -3835,18 +3835,14 @@ Other Style Guides
This is a list of organizations that are using this style guide. Send us a pull request and we'll add you to the list.
- **123erfasst**: [123erfasst/javascript](https://github.com/123erfasst/javascript)
- - **3blades**: [3Blades](https://github.com/3blades)
- **4Catalyzer**: [4Catalyzer/javascript](https://github.com/4Catalyzer/javascript)
- **Aan Zee**: [AanZee/javascript](https://github.com/AanZee/javascript)
- - **Adult Swim**: [adult-swim/javascript](https://github.com/adult-swim/javascript)
- **Airbnb**: [airbnb/javascript](https://github.com/airbnb/javascript)
- **AltSchool**: [AltSchool/javascript](https://github.com/AltSchool/javascript)
- **Apartmint**: [apartmint/javascript](https://github.com/apartmint/javascript)
- **Ascribe**: [ascribe/javascript](https://github.com/ascribe/javascript)
- - **Avalara**: [avalara/javascript](https://github.com/avalara/javascript)
- **Avant**: [avantcredit/javascript](https://github.com/avantcredit/javascript)
- **Axept**: [axept/javascript](https://github.com/axept/javascript)
- - **BashPros**: [BashPros/javascript](https://github.com/BashPros/javascript)
- **Billabong**: [billabong/javascript](https://github.com/billabong/javascript)
- **Bisk**: [bisk](https://github.com/Bisk/)
- **Bonhomme**: [bonhommeparis/javascript](https://github.com/bonhommeparis/javascript)
@@ -3866,7 +3862,6 @@ Other Style Guides
- **Evolution Gaming**: [evolution-gaming/javascript](https://github.com/evolution-gaming/javascript)
- **EvozonJs**: [evozonjs/javascript](https://github.com/evozonjs/javascript)
- **ExactTarget**: [ExactTarget/javascript](https://github.com/ExactTarget/javascript)
- - **Expensify** [Expensify/Style-Guide](https://github.com/Expensify/Style-Guide/blob/master/javascript.md)
- **Flexberry**: [Flexberry/javascript-style-guide](https://github.com/Flexberry/javascript-style-guide)
- **Gawker Media**: [gawkermedia](https://github.com/gawkermedia/)
- **General Electric**: [GeneralElectric/javascript](https://github.com/GeneralElectric/javascript)
@@ -3878,12 +3873,10 @@ Other Style Guides
- **Happeo**: [happeo/javascript](https://github.com/happeo/javascript)
- **Honey**: [honeyscience/javascript](https://github.com/honeyscience/javascript)
- **How About We**: [howaboutwe/javascript](https://github.com/howaboutwe/javascript-style-guide)
- - **Huballin**: [huballin](https://github.com/huballin/)
- **HubSpot**: [HubSpot/javascript](https://github.com/HubSpot/javascript)
- **Hyper**: [hyperoslo/javascript-playbook](https://github.com/hyperoslo/javascript-playbook/blob/master/style.md)
- **InterCity Group**: [intercitygroup/javascript-style-guide](https://github.com/intercitygroup/javascript-style-guide)
- **Jam3**: [Jam3/Javascript-Code-Conventions](https://github.com/Jam3/Javascript-Code-Conventions)
- - **JeopardyBot**: [kesne/jeopardy-bot](https://github.com/kesne/jeopardy-bot/blob/master/STYLEGUIDE.md)
- **JSSolutions**: [JSSolutions/javascript](https://github.com/JSSolutions/javascript)
- **Kaplan Komputing**: [kaplankomputing/javascript](https://github.com/kaplankomputing/javascript)
- **KickorStick**: [kickorstick](https://github.com/kickorstick/)
@@ -3894,11 +3887,8 @@ Other Style Guides
- **Mighty Spring**: [mightyspring/javascript](https://github.com/mightyspring/javascript)
- **MinnPost**: [MinnPost/javascript](https://github.com/MinnPost/javascript)
- **MitocGroup**: [MitocGroup/javascript](https://github.com/MitocGroup/javascript)
- - **ModCloth**: [modcloth/javascript](https://github.com/modcloth/javascript)
- - **Money Advice Service**: [moneyadviceservice/javascript](https://github.com/moneyadviceservice/javascript)
- **Muber**: [muber](https://github.com/muber/)
- **National Geographic**: [natgeo](https://github.com/natgeo/)
- - **Nimbl3**: [nimbl3/javascript](https://github.com/nimbl3/javascript)
- **NullDev**: [NullDevCo/JavaScript-Styleguide](https://github.com/NullDevCo/JavaScript-Styleguide)
- **Nulogy**: [nulogy/javascript](https://github.com/nulogy/javascript)
- **Orange Hill Development**: [orangehill/javascript](https://github.com/orangehill/javascript)
@@ -3907,13 +3897,10 @@ Other Style Guides
- **Peerby**: [Peerby/javascript](https://github.com/Peerby/javascript)
- **Pier 1**: [Pier1/javascript](https://github.com/pier1/javascript)
- **Qotto**: [Qotto/javascript-style-guide](https://github.com/Qotto/javascript-style-guide)
- - **Razorfish**: [razorfish/javascript-style-guide](https://github.com/razorfish/javascript-style-guide)
- - **reddit**: [reddit/styleguide/javascript](https://github.com/reddit/styleguide/tree/master/javascript)
- **React**: [facebook.github.io/react/contributing/how-to-contribute.html#style-guide](https://facebook.github.io/react/contributing/how-to-contribute.html#style-guide)
- **REI**: [reidev/js-style-guide](https://github.com/rei/code-style-guides/)
- **Ripple**: [ripple/javascript-style-guide](https://github.com/ripple/javascript-style-guide)
- **Sainsbury’s Supermarkets**: [jsainsburyplc](https://github.com/jsainsburyplc)
- - **SeekingAlpha**: [seekingalpha/javascript-style-guide](https://github.com/seekingalpha/javascript-style-guide)
- **Shutterfly**: [shutterfly/javascript](https://github.com/shutterfly/javascript)
- **Sourcetoad**: [sourcetoad/javascript](https://github.com/sourcetoad/javascript)
- **Springload**: [springload](https://github.com/springload/)
From 9c181108a7f11be1b97191f17c9ab2dc98e28c6e Mon Sep 17 00:00:00 2001
From: Ikko Ashimine
Date: Fri, 8 Jan 2021 20:40:02 +0900
Subject: [PATCH 026/148] [meta] Fix typo in .markdownlint.json
preceeding -> preceding
---
linters/.markdownlint.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/linters/.markdownlint.json b/linters/.markdownlint.json
index 118b8a6ec6..951337dbc5 100644
--- a/linters/.markdownlint.json
+++ b/linters/.markdownlint.json
@@ -69,7 +69,7 @@
"no-multiple-space-closed-atx": true,
"comment": "MD022: Headers should be surrounded by blank lines.",
- "comment": "Some headers have preceeding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers",
+ "comment": "Some headers have preceding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers",
"blanks-around-headers": false,
"comment": "MD023: Headers must start at the beginning of the line.",
@@ -111,7 +111,7 @@
"blanks-around-fences": true,
"comment": "MD032: Lists should be surrounded by blank lines",
- "comment": "Some lists have preceeding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers",
+ "comment": "Some lists have preceding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers",
"blanks-around-lists": false,
"comment": "MD033: Disallow inline HTML",
From 711aeb650db14c3b8cc329511ac508ee05bc1af6 Mon Sep 17 00:00:00 2001
From: kimhanui <30483337+kimhanui@users.noreply.github.com>
Date: Thu, 18 Mar 2021 08:43:41 +0900
Subject: [PATCH 027/148] [editorial] Complete 19.6 example code (cut in the
middle)
Fixes #2403
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 284ca26e7f..f7e0823c55 100644
--- a/README.md
+++ b/README.md
@@ -2618,6 +2618,10 @@ Other Style Guides
// good
const leds = stage.selectAll('.led').data(data);
+ const svg = leds.enter().append('svg:svg');
+ svg.classed('led', true).attr(width', (radius + margin) * 2);
+ const g = svg.append('svg:g');
+ g.attr('transform', `translate(${radius + margin},${radius + margin})`).call(tron.led);
```
From 1b540ba14ea15c28f4028e4216373d0eeb96dde0 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Wed, 24 Mar 2021 23:32:41 -0700
Subject: [PATCH 028/148] [*] [dev deps] update `tape`
---
packages/eslint-config-airbnb-base/package.json | 2 +-
packages/eslint-config-airbnb/package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json
index b86a415362..10a35679e0 100644
--- a/packages/eslint-config-airbnb-base/package.json
+++ b/packages/eslint-config-airbnb-base/package.json
@@ -62,7 +62,7 @@
"eslint-plugin-import": "^2.22.1",
"in-publish": "^2.0.1",
"safe-publish-latest": "^1.1.4",
- "tape": "^5.1.0"
+ "tape": "^5.2.2"
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index f3a9057e5c..22e0b639cb 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -72,7 +72,7 @@
"in-publish": "^2.0.1",
"react": ">= 0.13.0",
"safe-publish-latest": "^1.1.4",
- "tape": "^5.1.0"
+ "tape": "^5.2.2"
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
From 4d837646b7ae2a37780f91423479e65949863570 Mon Sep 17 00:00:00 2001
From: Jordan Harband
Date: Wed, 24 Mar 2021 23:33:38 -0700
Subject: [PATCH 029/148] [eslint config] [deps] update `eslint-plugin-react`
---
packages/eslint-config-airbnb/package.json | 6 +++---
packages/eslint-config-airbnb/rules/react.js | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json
index 22e0b639cb..641c731139 100644
--- a/packages/eslint-config-airbnb/package.json
+++ b/packages/eslint-config-airbnb/package.json
@@ -59,7 +59,7 @@
"object.entries": "^1.1.3"
},
"devDependencies": {
- "@babel/runtime": "^7.12.5",
+ "@babel/runtime": "^7.13.10",
"babel-preset-airbnb": "^4.5.0",
"babel-tape-runner": "^3.0.0",
"eclint": "^2.8.1",
@@ -67,7 +67,7 @@
"eslint-find-rules": "^3.6.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
- "eslint-plugin-react": "^7.22.0",
+ "eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0",
"in-publish": "^2.0.1",
"react": ">= 0.13.0",
@@ -78,7 +78,7 @@
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
- "eslint-plugin-react": "^7.22.0",
+ "eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0"
},
"engines": {
diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js
index 24d9fffaa5..a077e4c113 100644
--- a/packages/eslint-config-airbnb/rules/react.js
+++ b/packages/eslint-config-airbnb/rules/react.js
@@ -540,6 +540,11 @@ module.exports = {
// https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md
// TODO: enable, semver-minor
'react/jsx-no-constructed-context-values': 'off',
+
+ // Prevent creating unstable components inside components
+ // https://github.com/yannickcr/eslint-plugin-react/blob/c2a790a3472eea0f6de984bdc3ee2a62197417fb/docs/rules/no-unstable-nested-components.md
+ // TODO: enable, semver-major
+ 'react/no-unstable-nested-components': 'off',
},
settings: {
From 730b74927432d5931f9047322e925fb7e1c07be6 Mon Sep 17 00:00:00 2001
From: Diane Ko
Date: Wed, 24 Mar 2021 18:38:08 -0700
Subject: [PATCH 030/148] [eslint config] [patch] Alphabetize the rules for
react-a11y.js
The ordering of the rules are currently not alphabetical, which can make it hard to tell whether there are rules missing or what's set for each rule from eslint-plugin-jsx-a11y.
This change alphabetizes the list so it's easier to compare to the [list of supported rules](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y#supported-rules)
---
.../eslint-config-airbnb/rules/react-a11y.js | 260 +++++++++---------
1 file changed, 132 insertions(+), 128 deletions(-)
diff --git a/packages/eslint-config-airbnb/rules/react-a11y.js b/packages/eslint-config-airbnb/rules/react-a11y.js
index 5898ca9eb3..f7bf7c79e6 100644
--- a/packages/eslint-config-airbnb/rules/react-a11y.js
+++ b/packages/eslint-config-airbnb/rules/react-a11y.js
@@ -11,13 +11,36 @@ module.exports = {
},
rules: {
+ // ensure emoji are accessible
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md
+ // disabled; rule is deprecated
+ 'jsx-a11y/accessible-emoji': 'off',
+
+ // Enforce that all elements that require alternative text have meaningful information
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
+ 'jsx-a11y/alt-text': ['error', {
+ elements: ['img', 'object', 'area', 'input[type="image"]'],
+ img: [],
+ object: [],
+ area: [],
+ 'input[type="image"]': [],
+ }],
+
// Enforce that anchors have content
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md
'jsx-a11y/anchor-has-content': ['error', { components: [] }],
- // Require ARIA roles to be valid and non-abstract
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md
- 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: false }],
+ // ensure tags are valid
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/0745af376cdc8686d85a361ce36952b1fb1ccf6e/docs/rules/anchor-is-valid.md
+ 'jsx-a11y/anchor-is-valid': ['error', {
+ components: ['Link'],
+ specialLink: ['to'],
+ aspects: ['noHref', 'invalidHref', 'preferButton'],
+ }],
+
+ // elements with aria-activedescendant must be tabbable
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md
+ 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
// Enforce all aria-* props are valid.
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md
@@ -27,45 +50,24 @@ module.exports = {
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-proptypes.md
'jsx-a11y/aria-proptypes': 'error',
+ // Require ARIA roles to be valid and non-abstract
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md
+ 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: false }],
+
// Enforce that elements that do not support ARIA roles, states, and
// properties do not have those attributes.
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md
'jsx-a11y/aria-unsupported-elements': 'error',
- // Enforce that all elements that require alternative text have meaningful information
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
- 'jsx-a11y/alt-text': ['error', {
- elements: ['img', 'object', 'area', 'input[type="image"]'],
- img: [],
- object: [],
- area: [],
- 'input[type="image"]': [],
- }],
-
- // Prevent img alt text from containing redundant words like "image", "picture", or "photo"
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-redundant-alt.md
- 'jsx-a11y/img-redundant-alt': 'error',
-
- // require that JSX labels use "htmlFor"
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-for.md
- // deprecated: replaced by `label-has-associated-control` rule
- 'jsx-a11y/label-has-for': ['off', {
- components: [],
- required: {
- every: ['nesting', 'id'],
- },
- allowChildren: false,
+ // Ensure the autocomplete attribute is correct and suitable for the form field it is used with
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/29c68596b15c4ff0a40daae6d4a2670e36e37d35/docs/rules/autocomplete-valid.md
+ 'jsx-a11y/autocomplete-valid': ['off', {
+ inputComponents: [],
}],
- // Enforce that a label tag has a text label and an associated control.
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/b800f40a2a69ad48015ae9226fbe879f946757ed/docs/rules/label-has-associated-control.md
- 'jsx-a11y/label-has-associated-control': ['error', {
- labelComponents: [],
- labelAttributes: [],
- controlComponents: [],
- assert: 'both',
- depth: 25
- }],
+ // require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md
+ 'jsx-a11y/click-events-have-key-events': 'error',
// Enforce that a control (an interactive element) has a text label.
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/control-has-associated-label.md
@@ -96,47 +98,59 @@ module.exports = {
depth: 5,
}],
- // require that mouseover/out come with focus/blur, for keyboard-only users
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
- 'jsx-a11y/mouse-events-have-key-events': 'error',
+ // ensure tags have content and are not aria-hidden
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md
+ 'jsx-a11y/heading-has-content': ['error', { components: [''] }],
- // Prevent use of `accessKey`
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md
- 'jsx-a11y/no-access-key': 'error',
+ // require HTML elements to have a "lang" prop
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md
+ 'jsx-a11y/html-has-lang': 'error',
- // require onBlur instead of onChange
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md
- 'jsx-a11y/no-onchange': 'off',
+ // ensure iframe elements have a unique title
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/iframe-has-title.md
+ 'jsx-a11y/iframe-has-title': 'error',
+
+ // Prevent img alt text from containing redundant words like "image", "picture", or "photo"
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-redundant-alt.md
+ 'jsx-a11y/img-redundant-alt': 'error',
// Elements with an interactive role and interaction handlers must be focusable
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/interactive-supports-focus.md
'jsx-a11y/interactive-supports-focus': 'error',
- // Enforce that elements with ARIA roles must have all required attributes
- // for that role.
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-has-required-aria-props.md
- 'jsx-a11y/role-has-required-aria-props': 'error',
+ // Enforce that a label tag has a text label and an associated control.
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/b800f40a2a69ad48015ae9226fbe879f946757ed/docs/rules/label-has-associated-control.md
+ 'jsx-a11y/label-has-associated-control': ['error', {
+ labelComponents: [],
+ labelAttributes: [],
+ controlComponents: [],
+ assert: 'both',
+ depth: 25
+ }],
- // Enforce that elements with explicit or implicit roles defined contain
- // only aria-* properties supported by that role.
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md
- 'jsx-a11y/role-supports-aria-props': 'error',
+ // require HTML element's lang prop to be valid
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md
+ 'jsx-a11y/lang': 'error',
- // Enforce tabIndex value is not greater than zero.
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md
- 'jsx-a11y/tabindex-no-positive': 'error',
+ // media elements must have captions
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/media-has-caption.md
+ 'jsx-a11y/media-has-caption': ['error', {
+ audio: [],
+ video: [],
+ track: [],
+ }],
- // ensure tags have content and are not aria-hidden
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md
- 'jsx-a11y/heading-has-content': ['error', { components: [''] }],
+ // require that mouseover/out come with focus/blur, for keyboard-only users
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
+ 'jsx-a11y/mouse-events-have-key-events': 'error',
- // require HTML elements to have a "lang" prop
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md
- 'jsx-a11y/html-has-lang': 'error',
+ // Prevent use of `accessKey`
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md
+ 'jsx-a11y/no-access-key': 'error',
- // require HTML element's lang prop to be valid
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md
- 'jsx-a11y/lang': 'error',
+ // prohibit autoFocus prop
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md
+ 'jsx-a11y/no-autofocus': ['error', { ignoreNonDOM: true }],
// prevent distracting elements, like