Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eslint config: upgrade eslint-plugin-react to version 7.26.0 #3164

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"jest-runner-eslint": {
"cliOptions": {
"format": "codeframe",
"reportUnusedDisableDirectives": true
"reportUnusedDisableDirectives": "error"
}
}
}
3 changes: 2 additions & 1 deletion src/eslint-config-adeira/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Unreleased

- Rule `no-unused-vars` has been adjusted to take [`fbt`](https://facebook.github.io/fbt/) oddities into account. This reverts the version pin of `eslint-plugin-react` introduced in 6.5.1. For more details please visit: https://github.com/yannickcr/eslint-plugin-react/issues/3080
- New rule [`flowtype/no-duplicate-type-union-intersection-members`](https://github.com/gajus/eslint-plugin-flowtype/blob/1c1c009ba2a58b9660d43c43750396bef8d73904/.README/rules/no-duplicate-type-union-intersection-members.md) has been enabled (as warnings or errors in strict mode).

# 6.5.1

- Dependency `eslint-plugin-react` was temporarily pined to version 7.25.1 because of a new issue with FBT tags: https://github.com/yannickcr/eslint-plugin-react/issues/3080
- Dependency `eslint-plugin-react` has been temporarily pined to version 7.25.1 because of a new issue with FBT tags: https://github.com/yannickcr/eslint-plugin-react/issues/3080

# 6.5.0

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @flow strict

// eslint-disable-next-line no-unused-vars
const someUnusedVar = 42;

// eslint-disable-next-line no-unused-vars
function fact(n) {
if (n < 2) {
return 1;
}
return n * fact(n - 1);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This code should NOT report `no-unused-vars` error on FBT import, see:
* https://github.com/yannickcr/eslint-plugin-react/issues/3080
*
* @flow
*/

import fbt from 'fbt'; // eslint-disable-line import/no-extraneous-dependencies
import type { Node } from 'react';

export default function MyComponent(): Node {
return <fbt desc="…">test</fbt>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ Object {
"args": "after-used",
"argsIgnorePattern": "^_$",
"ignoreRestSiblings": true,
"varsIgnorePattern": "^fbt$",
},
],
"no-use-before-define": 0,
Expand Down Expand Up @@ -852,6 +853,7 @@ Object {
"ignoreStateless": true,
},
],
"react/no-namespace": 0,
"react/no-redundant-should-component-update": 2,
"react/no-render-return-value": 2,
"react/no-set-state": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ Object {
"args": "after-used",
"argsIgnorePattern": "^_$",
"ignoreRestSiblings": true,
"varsIgnorePattern": "^fbt$",
},
],
"no-use-before-define": 0,
Expand Down Expand Up @@ -948,6 +949,7 @@ Object {
"ignoreStateless": true,
},
],
"react/no-namespace": 0,
"react/no-redundant-should-component-update": 2,
"react/no-render-return-value": 2,
"react/no-set-state": 0,
Expand Down
2 changes: 1 addition & 1 deletion src/eslint-config-adeira/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "7.25.1",
"eslint-plugin-react": "^7.26.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.11.0",
"eslint-plugin-relay": "^1.8.2",
Expand Down
1 change: 1 addition & 0 deletions src/eslint-config-adeira/src/presets/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ module.exports = ({
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_$', // (_) => { … }
varsIgnorePattern: '^fbt$', // https://github.com/yannickcr/eslint-plugin-react/issues/3080
},
],
'no-use-before-define': OFF, // https://github.com/babel/babel-eslint/issues/485
Expand Down
1 change: 1 addition & 0 deletions src/eslint-config-adeira/src/presets/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module.exports = ({
'react/no-find-dom-node': ERROR,
'react/no-is-mounted': ERROR,
'react/no-multi-comp': [ERROR, { ignoreStateless: true }],
'react/no-namespace': OFF, // complains about `<fbt:param/>` and similar
'react/no-redundant-should-component-update': ERROR,
'react/no-render-return-value': ERROR,
'react/no-set-state': OFF,
Expand Down
6 changes: 0 additions & 6 deletions src/monorepo-shipit/src/ShipitConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,8 @@ export default class ShipitConfig {
getDefaultShipitFilter(): ChangesetFilter {
return (changeset: Changeset) => {
const ch1 = addTrackingData(changeset);
// React Eslint plugin bug: https://github.com/yannickcr/eslint-plugin-react/issues/3063
// eslint-disable-next-line react/no-this-in-sfc
const ch2 = stripExceptDirectories(ch1, this.getSourceRoots());
// React Eslint plugin bug: https://github.com/yannickcr/eslint-plugin-react/issues/3063
// eslint-disable-next-line react/no-this-in-sfc
const ch3 = moveDirectories(ch2, this.directoryMapping);
// React Eslint plugin bug: https://github.com/yannickcr/eslint-plugin-react/issues/3063
// eslint-disable-next-line react/no-this-in-sfc
const ch4 = stripPaths(ch3, this.strippedFiles);

// First we comment out lines marked with `@x-shipit-disable`.
Expand Down
83 changes: 78 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8345,6 +8345,30 @@ es-abstract@^1.18.0-next.2:
string.prototype.trimstart "^1.0.4"
unbox-primitive "^1.0.0"

es-abstract@^1.18.1:
version "1.18.6"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.6.tgz#2c44e3ea7a6255039164d26559777a6d978cb456"
integrity sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==
dependencies:
call-bind "^1.0.2"
es-to-primitive "^1.2.1"
function-bind "^1.1.1"
get-intrinsic "^1.1.1"
get-symbol-description "^1.0.0"
has "^1.0.3"
has-symbols "^1.0.2"
internal-slot "^1.0.3"
is-callable "^1.2.4"
is-negative-zero "^2.0.1"
is-regex "^1.1.4"
is-string "^1.0.7"
object-inspect "^1.11.0"
object-keys "^1.1.1"
object.assign "^4.1.2"
string.prototype.trimend "^1.0.4"
string.prototype.trimstart "^1.0.4"
unbox-primitive "^1.0.1"

es-abstract@^1.18.2:
version "1.18.3"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0"
Expand Down Expand Up @@ -8612,23 +8636,24 @@ eslint-plugin-react-native@^3.11.0:
"@babel/traverse" "^7.7.4"
eslint-plugin-react-native-globals "^0.1.1"

eslint-plugin-react@7.25.1:
version "7.25.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.25.1.tgz#9286b7cd9bf917d40309760f403e53016eda8331"
integrity sha512-P4j9K1dHoFXxDNP05AtixcJEvIT6ht8FhYKsrkY0MPCPaUMYijhpWwNiRDZVtA8KFuZOkGSeft6QwH8KuVpJug==
eslint-plugin-react@^7.26.0:
version "7.26.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.0.tgz#3ae019a35d542b98e5af9e2f96b89c232c74b55b"
integrity sha512-dceliS5itjk4EZdQYtLMz6GulcsasguIs+VTXuiC7Q5IPIdGTkyfXVdmsQOqEhlD9MciofH4cMcT1bw1WWNxCQ==
dependencies:
array-includes "^3.1.3"
array.prototype.flatmap "^1.2.4"
doctrine "^2.1.0"
estraverse "^5.2.0"
has "^1.0.3"
jsx-ast-utils "^2.4.1 || ^3.0.0"
minimatch "^3.0.4"
object.entries "^1.1.4"
object.fromentries "^2.0.4"
object.hasown "^1.0.0"
object.values "^1.1.4"
prop-types "^15.7.2"
resolve "^2.0.0-next.3"
semver "^6.3.0"
string.prototype.matchall "^4.0.5"

eslint-plugin-relay@^1.8.2:
Expand Down Expand Up @@ -9666,6 +9691,14 @@ get-stream@^6.0.0:
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.0.tgz#3e0012cb6827319da2706e601a1583e8629a6718"
integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==

get-symbol-description@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6"
integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==
dependencies:
call-bind "^1.0.2"
get-intrinsic "^1.1.1"

get-value@^2.0.3, get-value@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
Expand Down Expand Up @@ -9991,6 +10024,13 @@ has-symbols@^1.0.1:
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8"
integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==

has-tostringtag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25"
integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==
dependencies:
has-symbols "^1.0.2"

has-unicode@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
Expand Down Expand Up @@ -10812,6 +10852,11 @@ is-callable@^1.2.3:
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e"
integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==

is-callable@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945"
integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==

is-ci@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
Expand Down Expand Up @@ -11122,6 +11167,14 @@ is-regex@^1.1.3:
call-bind "^1.0.2"
has-symbols "^1.0.2"

is-regex@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958"
integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==
dependencies:
call-bind "^1.0.2"
has-tostringtag "^1.0.0"

is-regexp@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069"
Expand Down Expand Up @@ -11162,6 +11215,13 @@ is-string@^1.0.6:
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f"
integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==

is-string@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd"
integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==
dependencies:
has-tostringtag "^1.0.0"

is-symbol@^1.0.2, is-symbol@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937"
Expand Down Expand Up @@ -13492,6 +13552,11 @@ object-inspect@^1.10.3:
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369"
integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==

object-inspect@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==

object-inspect@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0"
Expand Down Expand Up @@ -13568,6 +13633,14 @@ object.getownpropertydescriptors@^2.1.2:
define-properties "^1.1.3"
es-abstract "^1.18.0-next.2"

object.hasown@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.0.0.tgz#bdbade33cfacfb25d7f26ae2b6cb870bf99905c2"
integrity sha512-qYMF2CLIjxxLGleeM0jrcB4kiv3loGVAjKQKvH8pSU/i2VcRRvUNmxbD+nEMmrXRfORhuVJuH8OtSYCZoue3zA==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.18.1"

object.pick@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
Expand Down