Skip to content

Commit

Permalink
fix(eslint-config-react): Add static-variables to react/sort-comp
Browse files Browse the repository at this point in the history
`eslint-plugin-react` was updated (jsx-eslint/eslint-plugin-react#2408)
to support a new `static-variables` option to `react/sort-comp`. With this
change, our linting started breaking. After some investigation, it turns out
that `statics` seems to refer to some old `React.createClass` option, so
static variables actually fell into the check for `static-methods`. Now that is
fixed and `static-methods` only check for methods and `static-variables` only
check for variables. So it doesn't seem like a breaking change, but we seem to
have misused the options a bit.

By only adding `static-variables` to our list we should still support older
apps using `React.createClass` (if any), and everything will work again like
before.
  • Loading branch information
koggdal committed Oct 24, 2019
1 parent 3113468 commit f0526c0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/eslint-config-react/index.js
Expand Up @@ -53,6 +53,7 @@ module.exports = {
{
order: [
'statics',
'static-variables',
'static-methods',
'instance-variables',
'constructor',
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-react/package.json
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"eslint": "^5.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.14.2"
"eslint-plugin-react": "^7.16.0"
},
"peerDependencies": {
"eslint": ">=5.x",
Expand Down
39 changes: 32 additions & 7 deletions yarn.lock
Expand Up @@ -3206,20 +3206,20 @@ eslint-plugin-react@^7.12.4:
prop-types "^15.7.2"
resolve "^1.10.1"

eslint-plugin-react@^7.14.2:
version "7.14.2"
resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.14.2.tgz#94c193cc77a899ac0ecbb2766fbef88685b7ecc1"
integrity sha512-jZdnKe3ip7FQOdjxks9XPN0pjUKZYq48OggNMd16Sk+8VXx6JOvXmlElxROCgp7tiUsTsze3jd78s/9AFJP2mA==
eslint-plugin-react@^7.16.0:
version "7.16.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.16.0.tgz#9928e4f3e2122ed3ba6a5b56d0303ba3e41d8c09"
integrity sha512-GacBAATewhhptbK3/vTP09CbFrgUJmBSaaRcWdbQLFvUZy9yVcQxigBNHGPU/KE2AyHpzj3AWXpxoMTsIDiHug==
dependencies:
array-includes "^3.0.3"
doctrine "^2.1.0"
has "^1.0.3"
jsx-ast-utils "^2.1.0"
jsx-ast-utils "^2.2.1"
object.entries "^1.1.0"
object.fromentries "^2.0.0"
object.values "^1.1.0"
prop-types "^15.7.2"
resolve "^1.10.1"
resolve "^1.12.0"

eslint-scope@^4.0.3:
version "4.0.3"
Expand Down Expand Up @@ -5328,6 +5328,14 @@ jsx-ast-utils@^2.0.1, jsx-ast-utils@^2.1.0:
dependencies:
array-includes "^3.0.3"

jsx-ast-utils@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz#4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb"
integrity sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ==
dependencies:
array-includes "^3.0.3"
object.assign "^4.1.0"

kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
version "3.2.2"
resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
Expand Down Expand Up @@ -6700,7 +6708,7 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"

object-keys@^1.0.12:
object-keys@^1.0.11, object-keys@^1.0.12:
version "1.1.1"
resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
Expand All @@ -6712,6 +6720,16 @@ object-visit@^1.0.0:
dependencies:
isobject "^3.0.0"

object.assign@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==
dependencies:
define-properties "^1.1.2"
function-bind "^1.1.1"
has-symbols "^1.0.0"
object-keys "^1.0.11"

object.entries@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
Expand Down Expand Up @@ -7797,6 +7815,13 @@ resolve@1.x, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.3.2:
dependencies:
path-parse "^1.0.6"

resolve@^1.12.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
dependencies:
path-parse "^1.0.6"

restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
Expand Down

0 comments on commit f0526c0

Please sign in to comment.