Breaking changes ahead!
- New rules enabled:
@next/next/no-async-client-component
Breaking changes from eslint-plugin-testing-library
v6 were implemented, specifically:
testing-library/no-await-sync-query
is now calledtesting-library/no-await-sync-queries
testing-library/no-debugging-utils
now enables all debug methods in all configs by defaulttesting-library/no-global-regexp-flag-in-query
is now enabled by default in all configstesting-library/prefer-wait-for
is now removedtesting-library/no-wait-for-empty-callback
is now removed
For more details see: https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/migration-guides/v6.md
- New rule enabled:
jest/no-confusing-set-timeout
(warnings or errors in strict mode)
- New rules enabled:
testing-library/prefer-query-matchers
, andreact/jsx-curly-brace-presence
(warnings or errors in strict mode)
- New rules enabled (warnings or errors in strict mode):
- Enable new rule
promise/no-multiple-resolved
(warnings or errors in the strict mode). - New rules
no-empty-static-block
andno-new-native-nonconstructor
enabled (warnings or errors in the strict mode).
The Eslint Config now requires hermes-eslint
as an Eslint parser. Technically, the config works with any other parser (say @babel/eslint-parser
) as well, however, some rules were adjusted for hermes-eslint
. Notably:
no-undef
was turned off (not needed, especially in combination with Flow - superfluous rule)ft-flow/define-flow-type
turned off (not needed with Hermes)ft-flow/use-flow-type
turned off (not needed with Hermes)react/jsx-uses-react
turned off (not needed with Hermes)react/jsx-uses-vars
turned off (not needed with Hermes)
Some rules previously showing warnings (or errors in the strict mode) were upgraded to errors:
no-constant-binary-expression
fbt/no-empty-strings
ft-flow/boolean-style
jest/no-alias-methods
,jest/prefer-comparison-matcher
,jest/prefer-equality-matcher
,jest/prefer-hooks-in-order
react/iframe-missing-sandbox
,react/jsx-no-leaked-render
jest-dom/prefer-checked
,jest-dom/prefer-empty
,jest-dom/prefer-enabled-disabled
,jest-dom/prefer-focus
,jest-dom/prefer-in-document
,jest-dom/prefer-required
,jest-dom/prefer-to-have-attribute
,jest-dom/prefer-to-have-class
,jest-dom/prefer-to-have-style
,jest-dom/prefer-to-have-text-content
,jest-dom/prefer-to-have-value
testing-library/no-global-regexp-flag-in-query
@next/next/no-assign-module-variable
,@next/next/no-before-interactive-script-outside-document
,@next/next/no-head-element
, and@next/next/no-styled-jsx-in-document
Additionally:
- New rule
jest/prefer-each
enabled (warnings or errors in strict mode).
- New rule
@next/next/no-styled-jsx-in-document
enabled.
- New rule
no-constant-binary-expression
enabled (warnings or errors in strict mode). - New Next.js rules
@next/next/no-assign-module-variable
and@next/next/no-before-interactive-script-outside-document
enabled (warnings or errors in strict mode). - New React rule
react/jsx-no-leaked-render
enabled (warnings or errors in strict mode). - New rule
prefer-hooks-in-order
- New rule
testing-library/no-global-regexp-flag-in-query
enabled (in a backward compatible fashion). - Rule
testing-library/no-await-sync-events
disabled as it is no longer valid in @testing-library/user-event v14+ (APIs always return a Promise).
- Rule
ft-flow/boolean-style
now enforcesboolean
type (instead ofbool
) as recommended in: https://flow.org/en/docs/types/primitives/#toc-booleans - Enabled
jest/no-alias-methods
rule. This migration is trivial as this rule has autofix.
- New rules
react/iframe-missing-sandbox
and@next/next/no-script-component-in-head
enabled (warnings or errors in strict mode). - Rule
react/jsx-key
is now a bit more strict (possibly catching previously missed errors).
- New optional preset for FBT is available with one rule enabled:
fbt/no-empty-strings
. - New rules
jest/prefer-equality-matcher
andjest/prefer-comparison-matcher
enabled (warnings or errors in strict mode).
- New rules from
eslint-plugin-jest-dom
were enabled in the React preset (warnings or errors in strict mode). All of them are auto-fixable so the migration should be seamless. - New rule
@next/next/no-head-element
enabled in the Next.js preset (warnings or errors in strict mode).
Breaking changes ahead!
-
Eslint version 8 is now required (visit https://eslint.org/blog/2021/10/eslint-v8.0.0-released and other related blog posts for more info).
-
New rules enabled:
fb-flow/use-indexed-access-type
(more info),ft-flow/enforce-suppression-code
andno-unused-private-class-members
. -
Many rules that were showing warnings in normal mode but errors in strict mode were converted to normal errors (so there is no difference between normal and strict mode). The best way how to migrate is to temporarily switch to the strict mode and address all the errors before upgrading to this major version.
-
Switched from
eslint-plugin-flowtype
toeslint-plugin-ft-flow
which contains the same set of rules but should be more up to date and maintained. We are going to enable additional rules later. There is a possible minor breaking change (with very simple fix) when suppressing the rules manually, for example:- /* eslint-disable flowtype/require-valid-file-annotation */ + /* eslint-disable ft-flow/require-valid-file-annotation */
-
Switched from
eslint-plugin-node
toeslint-plugin-n
which contains the same set of rules but should be more up to date (and support Eslint 8). There is a possible minor breaking change (with very simple fix) when suppressing the rules manually, for example:- /* eslint-disable node/no-deprecated-api */ + /* eslint-disable n/no-deprecated-api */
- New rules enabled:
@next/next/no-server-import-in-page
,react/no-arrow-function-lifecycle
,react/no-invalid-html-attribute
andreact/no-unused-class-component-methods
(warnings or errors in strict mode).
- Delete dropped rules from
eslint-plugin-jest
:prefer-to-be-undefined
prefer-to-be-null
no-expect-resolves
no-truthy-falsy
no-try-expect
prefer-inline-snapshots
- Rename renamed rules from
eslint-plugin-jest
:valid-describe
tovalid-describe-callback
lowercase-name
toprefer-lowercase-title
- Additional rules from
eslint-plugin-testing-library
were enabled (warnings or errors in strict mode).
- New rules
jest/prefer-to-be
,jest/prefer-expect-resolves
andflowtype/no-duplicate-type-union-intersection-members
enabled as warnings (errors in strict mode). - Rule
no-unused-vars
has been adjusted to takefbt
oddities into account. This reverts the version pin ofeslint-plugin-react
introduced in 6.5.1. For more details please visit: jsx-eslint/eslint-plugin-react#3080 - New rules from
eslint-plugin-testing-library
were enabled in the React preset (warnings or errors in strict mode). They should catch the most serious problems with React Testing Library. Additional rules will be enabled in the future versions to ease the migration.
- Dependency
eslint-plugin-react
has been temporarily pined to version 7.25.1 because of a new issue with FBT tags: jsx-eslint/eslint-plugin-react#3080
-
New rule
fb-flow/use-flow-enums
enabled. Additionally, rulesno-fallthrough
andno-case-declarations
were upgraded to errors in strict mode to improve Flow Enums support. For more information please visit: https://flow.org/en/docs/enums/ -
New rules
@next/next/inline-script-id
,@next/next/no-script-in-document
and@next/next/no-script-in-head
enabled (as warnings). For more information visit: https://nextjs.org/docs/basic-features/eslint#eslint-plugin -
Disable
jsx-a11y/accessible-emoji
rule, since it is deprecated and creates a degraded experience. -
We clarified what to do when you are using
@adeira/eslint-config/next
preset inside monorepo (check our readme). Basically, you might encounter the following warning:Pages directory cannot be found at /X/Y/Z/pages or /X/Y/Z/src/pages. If using a custom path, please configure with the no-html-link-for-pages rule in your eslint config file
In this case it's necessary to configure the Next.js eslint preset explicitly, for example:
module.exports = { extends: ['@adeira/eslint-config', '@adeira/eslint-config/next'], settings: { next: { rootDir: __dirname }, }, };
For more info visit: https://nextjs.org/docs/messages/no-html-link-for-pages
- New rules
@next/next/no-duplicate-head
and@next/next/no-typos
enabled in the Next.js preset (as warnings). - Rule
no-redeclare
now throws errors in strict mode. It still throws the same warnings in case you are using standard lint mode. - New rules
fb-flow/flow-enums-default-if-possible
andfb-flow/no-flow-enums-object-mapping
enabled in the Flowtype preset (as warnings). Additionally, new rulefb-flow/use-exact-by-default-object-type
replacesflowtype/require-exact-type
rule (this is potentially breaking in case you are suppressing this rule somewhere in your codebase).
-
Added new optional config preset
@adeira/eslint-config/next
(for Next.js applications). This preset is not included in the default config and should be enabled explicitly for Next.js applications. For example:module.exports = { extends: [ '@adeira/eslint-config', // this preset includes almost everything but not Next.js rules '@adeira/eslint-config/next', // adds extra Next.js rules for your application ], };
- New rule
max-nested-describe
enabled (warnings or errors in strict mode). - New rule
sx/use-logical-properties
enabled (warnings or errors in strict mode). - You can now use config subsets for use cases where the main default config does not fit well.
@adeira/eslint-config/base
- only the basic and most important JavaScript rules@adeira/eslint-config/jest
- Jest related rules@adeira/eslint-config/react
- React related rules (React, RN, Hooks, accessibility)@adeira/eslint-config/flowtype
- Flow related rules@adeira/eslint-config/relay
- Relay related rules
- Rule
import/no-extraneous-dependencies
now ignores**/__flowtests__/**
,**/__tests__/**
and**/.storybook/**
by default. - New rule
import/no-relative-packages
enabled (warnings or errors in strict mode).
Note for all Flow users: all projects in adeira/universe
now use implicit exact Flow types ({}
for strict objects and { ... }
for open objects, syntax {||}
is deprecated). We do not expect any issues with Flow types as long as you are using exact_by_default=true
Flow option.
Because of this migration of adeira/universe
to implicit exact objects (step 4 in this article: https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf) we are changing the following rules:
flowtype/require-exact-type OFF -> ERROR with "never"
flowtype/require-inexact-type ERROR -> OFF
flowtype/require-readonly-react-props ERROR -> ERROR with "useImplicitExactTypes:true"
In case you want to prolong the support for explicit exact objects you can simply reverse these rules and you should be good to go.
Additional changes:
- Broken rule
react/forbid-dom-props
which was disabled in version 5.2.0 was fixed and re-enabled with the same configuration (related issue). - New rules
no-multi-assign
andno-implicit-coercion
enabled (with errors). - Rules which were throwing only warnings but errors in strict mode are now enabled as errors for everyone:
no-unsafe-optional-chaining
,no-nonoctal-decimal-escape
,prefer-object-spread
,flowtype/use-read-only-spread
,react/jsx-no-constructed-context-values
,react/jsx-no-target-blank
,react/no-unstable-nested-components
,react-native/no-single-element-style-arrays
,react-native/no-unused-styles
,jsx-a11y/anchor-has-content
,jsx-a11y/heading-has-content
,jsx-a11y/no-noninteractive-tabindex
,relay/function-required-argument
,promise/no-new-statics
,promise/no-return-wrap
,promise/param-names
,promise/valid-params
,sx/no-concatenated-classes
,sx/no-unused-stylesheet
andsx/valid-usage
- Rule
react/no-unstable-nested-components
enabled (warnings or errors in strict mode) - Our custom rule
adeira/flow-use-readonly-spread
has been migrated to officialflowtype/use-read-only-spread
while keeping the same behavior (gajus/eslint-plugin-flowtype#472). You might need to adjust your config in case you are overwriting the default config values.
- Our custom rule
adeira/no-internal-flow-type
has been migrated to officialflowtype/no-internal-flow-type
while keeping the same behavior (gajus/eslint-plugin-flowtype#469). You might need to adjust your config in case you are overwriting the default config values. - Rule
react/forbid-dom-props
has been temporarily disabled because it causes problems with FBT tags, see: adeira/universe#2005 - New accessibility rules enabled:
jsx-a11y/anchor-has-content
,jsx-a11y/heading-has-content
andjsx-a11y/no-noninteractive-tabindex
(warnings or errors in strict mode) - Rule
react/jsx-no-target-blank
enabled (warnings or errors in strict mode)
- New rule
relay/function-required-argument
enabled (warnings or errors in strict mode). See: relayjs/eslint-plugin-relay#108 - Legacy
prefer-object-spread/prefer-object-spread
rule replaced withprefer-object-spread
while keeping the backward compatibility (warnings as before and errors in strict lint mode). - New rules enforce best practices for JavaScript promises added:
promise/no-nesting
,promise/no-new-statics
,promise/no-return-wrap
,promise/param-names
andpromise/valid-params
(warnings or errors in a strict mode for backward compatibility)
Support for Node.js 12 has been removed. This package might continue working on older Node.js versions, however, it's highly recommended upgrading to Node.js version 14 or newer. For more details, see: https://nodejs.org/en/about/releases/, or discuss here: adeira/universe#1588
- Rule
react/jsx-no-constructed-context-values
enabled (warnings or errors in strict mode). - Upgrade dependencies
- New rules for React Native added. Specifically, we enabled these rules:
react-native/no-single-element-style-arrays
andreact-native/no-unused-styles
(as usual: warnings or errors in a strict mode). - Removed deprecated
eslint-plugin-babel
. There is a replacement@babel/eslint-plugin
available, however, it should not be necessary (it fixes some edge-cases which we do not support anyway and rest of the fixes was already ported back to Eslint). This change should be fully backward compatible while keeping the same functionality. Please, let us know in case of any difficulties. - Rule
react-hooks/exhaustive-deps
now takesuseRecoilCallback
hook into account as well (see: https://recoiljs.org/docs/introduction/installation#eslint anduseRecoilCallback
for more information).
-
Disabled rule
relay/graphql-naming
which is no longer accurate. We might enable it later again once this issue gets resolved: relayjs/eslint-plugin-relay#107 -
Rule
no-unused-vars
now ignores argument with special name_
. This is handy when you really want to have some unused argument there (for example because your typechecker expects it). -
Rule
no-unsafe-optional-chaining
enabled (warnings or errors in strict mode). Requires Eslint version >=7.15.0. You should have no issues if you useunnecessary-optional-chain
Flow lint (highly recommended). Flowconfig example:[lints] unnecessary-optional-chain=error
- Enable
node/process-exit-as-throw
rule. This is potentially breaking, however, the impact should be minimal and the migration simple. Let us know in case it caused troubles, please. - Set
react/react-in-jsx-scope
toOFF
since we are now using the new JSX transform internally. - Turn off
no-useless-computed-key
(in order to ease Flow support) - Added experimental
eslint-plugin-sx
rules for@adeira/sx
- Added new
no-nonoctal-decimal-escape
rule (warnings or errors in strict mode) - Peer dependency changed to
eslint
version >=7.14.0 (https://eslint.org/blog/2020/11/eslint-v7.14.0-released). This version is needed for the newno-nonoctal-decimal-escape
rule.
This is a major release mainly focused on separating Eslint Runner. Do wou need some help with the breaking changes? Let us know!
- Remove
__
global, legacy of Nitrolib from Kiwi.com, see: https://kiwicom.github.io/nitrolib/services.html#intl - Set
flowtype/require-readonly-react-props
to throw errors - Eslint Runner is no longer part of this package. Please use
@adeira/eslint-runner
package instead for better experience. - Rule
curly
changed back from warnings to errors (see 3.1.1) - Rules
no-promise-executor-return
,no-unreachable-loop
,no-loss-of-precision
,flowtype/no-weak-types
,jest/no-interpolation-in-snapshots
,jsx-a11y/autocomplete-valid
andrelay/must-colocate-fragment-spreads
promoted from warnings (errors in a strict mode) to always throw an error.
- Rule
adeira/no-invalid-flow-annotations
checks for typos like@flow srict
(should be@flow strict
). - Rule
flowtype/no-weak-types
now returns warnings forObject
andFunction
Flow types. - Rule
no-loss-of-precision
finally supports numeric separators so we enabled it (warnings or errors in a strict mode). - Prettier option
quoteProps
changed to "consistent". - Minimal required Eslint dependency version changed to
^7.8.1
(no-loss-of-precision
requires it).
- Fixed broken
curly
rule (warnings).
- New rule
relay/must-colocate-fragment-spreads
- Eslint upgraded to version 7.6.0
- New Rules enabled:
no-promise-executor-return
,no-unreachable-loop
andjsx-a11y/autocomplete-valid
(warnings in normal mode, errors in strict mode).
- Upgrade to Prettier 2.0.5
- Downgrade Prettier to 1.19.1 (should have been major upgrade)
- Upgrade eslint to 7.2.0
- Upgrade prettier to 2.0.5
- Upgrade eslint to 7.1.0
- Upgrade eslint to 7.0.0
- set
default-case-last
to error - set
no-useless-backreference
to error - set
jest/no-deprecated-functions
to error - set
jest/prefer-called-with
to error - set
react/jsx-no-script-url
to error - set
node/no-callback-literal
to error - set
eslint-comments/no-unlimited-disable
to error
-
Eslint runner no longer crashes if git is not initialised or if there is no git remote. It will fall back to lint all files instead.
-
Eslint runner has been moved the the
@adeira/eslint-runner
and will be eventually removed from this package. -
Added
react/jsx-no-script-url
as next_version_error -
eslint-comments/no-unlimited-disable
rule is turned on, ignoring all__generated__/*.graphql.js
files by default, so files autogenerated by Relay compiler are not reported. Follow Eslint Docs on how to disable additional group of files if needed.An example on how to adjust this rule in
.eslintrc.js
:module.exports = { overrides: [ { // turns of "eslint-comments/no-unlimited-disable" for all fixtures files: ['**/babel-preset-adeira/**/__fixtures__/**/*.js'], rules: { 'eslint-comments/no-unlimited-disable': 'off', }, }, ], };
- New Eslint Runner CLI option
--no-warnings
- Add new rule
adeira/no-duplicate-import-type-import
;
- Lint all files when
.eslintignore
changes
- New rule
adeira/valid-test-folder
.
- Remove
eslint-plugin-react-native
- New rule
jest/valid-title
added (warnings or errors in strict mode).
- Changes in package.json will trigger eslint runner to run with
--all
flag - Rule no-unused-vars now allows unused variable when it's used to omit properties from object using rest spread.
- New rule
jest/prefer-hooks-on-top
added (warnings or errors in strict mode).
- New rule
kiwicom-incubator/no-internal-flow-type
enabled (warnings or errors in strict mode). This rule forces you to use types likeReact.Node
instead ofReact$Node
.
- New rules
default-param-last
,no-import-assign
,prefer-regex-literals
andreact/jsx-no-useless-fragment
added (warnings in normal mode, errors in strict mode). - Rule
use-isnan
uses new optionenforceForSwitchCase
by default. - Eslint Config Runner now automatically runs check of all the files when you change any Eslint-related configuration file (see: https://eslint.org/docs/user-guide/configuring#configuration-file-formats). Please note: this doesn't take configuration via
package.json
into account.
- Added
@kiwicom/eslint-config/nitro
as a replacement for deprecated@kiwicom/eslint-config-nitro
. - Rules
symbol-description
,yoda
,react/no-unknown-property
,react/jsx-no-comment-textnodes
now throw errors in strict mode. - Rule
react/style-prop-object
now shows warnings (errors in strict mode). - New rule
relay/hook-required-argument
added (warnings or errors in strict mode). - Rule
flowtype/no-unused-expressions
now supports tagged templates. This is useful to combine with@inline
GraphQL fragments definition for example.
- Major upgrade of
eslint-plugin-node
to the latest version (see: https://github.com/mysticatea/eslint-plugin-node/releases/tag/v10.0.0). This is a breaking change so we are bumping major version. You should be shielded from most of the changes however, you may get some new errors onimport()
and on deprecatedmodule.createRequireFromPath
calls. - New rule
node/no-exports-assign
now throws errors in both normal and strict mode. - Rule
flowtype/no-dupe-keys
now throws errors in both normal and strict mode. - Plugin
eslint-plugin-jest
is now more strict, see: https://github.com/jest-community/eslint-plugin-jest/releases/tag/v22.17.0 (affects behavior of rulesjest/prefer-to-be-null
,jest/prefer-to-be-undefined
,jest/prefer-to-contain
andjest/prefer-to-have-length
).
- Exceptions on mishmashed Eslint plugin versions has been reverted back to warnings only.
- Tests runner now throws exceptions when you have mishmashed Eslint plugin versions. This is potentially breaking change but you should not have such mishmash in your codebase anyway (it creates problems when running Eslint).
- Added brand new rule
node/no-callback-literal
which shows warnings in both normal and strict mode.
- Update of internal dependencies. Notably, we updated
eslint-plugin-react-hooks
to version 2.0.1 which is a breaking change, see: facebook/react#16455 - Rules
jest/no-duplicate-hooks
,jest/no-export
andjest/no-standalone-expect
now report errors instead of warnings (no change in strict mode). - Rule
flowtype/no-dupe-keys
now shows warnings (errors in strict mode) - Rule
no-inner-declarations
was disabled
- New rule
jest/no-standalone-expect
enabled (warnings resp. errors in strict mode). See: https://github.com/jest-community/eslint-plugin-jest/blob/098219b4614192b365e51b0de68deac9caae1d68/docs/rules/no-standalone-expect.md
- New rule
jest/no-export
enabled (warnings resp. errors in strict mode). See: https://github.com/jest-community/eslint-plugin-jest/blob/3ee38742e0d235196619488a88fe679d1e8c0030/docs/rules/no-export.md
- Allow use of devDependencies in
**/*.stories.js
(Storybook story files),**/webpack.config.js
and**/metro.config.js
.
- Eslint runner now automatically checks your dependency tree and warns you when you are using multiple plugins with possibly incompatible versions (common source of
Definition for rule 'xyz' was not found
errors).
- New rule
jest/no-duplicate-hooks
enabled (warnings resp. errors in strict mode).
- Breaking: default line width is now 100 to be compatible with other JavaScript projects. Migration is super simple if you use our Eslint Runner: just run it with option
--all
and it will fix the lines automatically. You will probably have to fix some additional failing tests/lint rules but it should not take you more than a few minutes. As always: first upgrade to previous versions and fix the warnings.
This is a major release with breaking changes. The main changes are major Eslint upgrade and bump of some warnings to errors (strict mode reset). Please upgrade all previous versions first and fix all the warnings before upgrading to version 5.0.
- Breaking: Eslint upgraded to version 6.0+ which is now required by peer dependencies. See: https://eslint.org/docs/6.0.0/user-guide/migrating-to-6.0.0
- The following rules are now errors instead of warnings (no change in strict mode):
no-async-promise-executor
,no-cond-assign
,no-control-regex
,no-duplicate-case
,no-empty-character-class
,no-ex-assign
,no-extra-boolean-cast
,no-irregular-whitespace
,no-misleading-character-class
,no-prototype-builtins
,no-regex-spaces
,no-template-curly-in-string
,no-unsafe-finally
,array-callback-return
,dot-notation
,eqeqeq
,guard-for-in
,no-empty-pattern
,no-extra-label
,no-iterator
,no-lone-blocks
,no-loop-func
,no-octal
,no-octal-escape
,no-useless-catch
,no-useless-concat
,no-useless-escape
,no-with
,vars-on-top
,no-shadow-restricted-names
,no-undef-init
,no-bitwise
,no-nested-ternary
,no-useless-computed-key
,no-useless-constructor
,no-var
,prefer-template
,require-yield
flowtype/require-inexact-type
react/button-has-type
,react/forbid-dom-props
,react/jsx-pascal-case
,react/jsx-uses-vars
,react/no-danger-with-children
,react/no-deprecated
,react/no-direct-mutation-state
,react/no-find-dom-node
,react/no-is-mounted
,react/no-multi-comp
,react/no-redundant-should-component-update
,react/no-render-return-value
,react/no-this-in-sfc
,react/no-unescaped-entities
,react/prefer-es6-class
,react/require-render-return
,react/self-closing-comp
,react/sort-comp
,react/void-dom-elements-no-children
jsx-a11y/anchor-is-valid
,jsx-a11y/aria-proptypes
,jsx-a11y/aria-role
,jsx-a11y/html-has-lang
,jsx-a11y/iframe-has-title
,jsx-a11y/interactive-supports-focus
,jsx-a11y/lang
,jsx-a11y/no-access-key
,jsx-a11y/no-autofocus
,jsx-a11y/no-redundant-roles
,jsx-a11y/role-has-required-aria-props
,jsx-a11y/role-supports-aria-props
,jsx-a11y/scope
,jsx-a11y/tabindex-no-positive
import/export
,import/extensions
,import/first
,import/no-amd
,import/no-duplicates
,import/no-named-default
,import/no-webpack-loader-syntax
,import/no-self-import
node/file-extension-in-import
relay-imports/no-values
,relay-imports/type-must-exist
There are no other behavioral changes so if you fixed all the warnings from previous versions then you should be good to go.
- Unmaintained plugin
eslint-plugin-dependencies
was removed. We already cover most of the cases withimport
plugin. This change is done in backward compatible manner:dependencies/case-sensitive
doesn't have replacement and it's been removed,dependencies/no-cycles
is replaced withimport/no-cycle
anddependencies/require-json-ext
was replaced withimport/extensions
. Please, report any issues.
- React rule
react/jsx-no-bind
is now much more benevolent. Read more information about this change here: https://kiwi.wiki/incubator/universe/blog/2019/06/21/relaxing-react-jsx-no-bind-eslint-rule
- Internal dependency
eslint-config-prettier
upgraded to version 5.0 (potentially breaking) which effectively removes restrictions on React rulereact/self-closing-comp
. This release enables new warnings for this rule (errors in strict mode). This rule is automatically fixable so it's going to be autofixed when you use our Eslint runner. More details here: https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md#version-500-2019-06-15 - Following rules now show warnings (errors in strict mode):
guard-for-in
,no-undef-init
,require-yield
,react/jsx-pascal-case
- Preparation for future major Eslint version 6.0. The following rules show warnings (errors in strict mode):
no-async-promise-executor
,no-prototype-builtins
,no-shadow-restricted-names
,no-useless-catch
(some of them were already warnings, other rules from 6.0 are already implemented properly). - Disabled rule
react/no-unused-state
because of this issue: jsx-eslint/eslint-plugin-react#1910 (it caused many errors in real-world applications).
This release focuses on enabling more rules to match closer with Nitro config. It also shows new warnings for implicit inexact Flow types as a preparation for exact objects by default. As always, please do not hesitate to upgrade, fix all your warnings and report any issues and misbehavior.
- New rule for checking inexact Flow types (warnings or errors in strict mode):
flowtype/require-inexact-type
- Following rules now show warnings (errors in strict mode):
no-template-curly-in-string
,array-callback-return
,no-loop-func
,vars-on-top
,no-nested-ternary
,prefer-template
- Following React-related rules now show warnings (errors in strict mode):
react/button-has-type
,react/no-danger-with-children
,react/no-find-dom-node
,react/no-is-mounted
,react/no-multi-comp
,react/no-render-return-value
,react/jsx-uses-vars
,react/no-this-in-sfc
,react/void-dom-elements-no-children
,react/prefer-es6-class
,react/no-unused-state
,react/no-unescaped-entities
There are many non-breaking changes in this release but mostly covering edge cases. Please, report any issues so we can reconsider some of them. Also, do not hesitate to upgrade your codebase. We are currently trying to unify our config and Nitro config.
- Following rules now show warnings (errors in strict mode):
import/export
,import/first
,import/no-webpack-loader-syntax
,import/no-amd
,import/no-named-default
,import/no-self-import
- Following rules now show warnings (errors in strict mode):
jsx-a11y/aria-proptypes
,jsx-a11y/html-has-lang
,jsx-a11y/iframe-has-title
,jsx-a11y/interactive-supports-focus
,jsx-a11y/lang
,jsx-a11y/no-access-key
,jsx-a11y/aria-role
,jsx-a11y/no-autofocus
,jsx-a11y/no-redundant-roles
,jsx-a11y/role-has-required-aria-props
,jsx-a11y/role-supports-aria-props
,jsx-a11y/scope
,jsx-a11y/tabindex-no-positive
,jsx-a11y/anchor-is-valid
- Following rules were already warnings but are now errors in strict mode:
import/no-duplicates
,dot-notation
,eqeqeq
,no-empty-pattern
,no-extra-label
,no-iterator
,no-var
,no-lone-blocks
,no-octal
,no-octal-escape
,no-bitwise
,no-useless-constructor
,no-useless-computed-key
,no-useless-concat
,no-useless-escape
,no-with
- New warnings for our custom rule
relay-imports/no-values
andrelay-imports/type-must-exist
(errors in strict mode). These rules should help you to find mistakes while importing Flow types from generated Relay files.
- This release adds official support for exhaustive Flow type checking with empty type, more info: https://github.com/mrtnzlml/meta/blob/master/flow.md#exhaustive-checking-with-empty-type. Please report any issues and unexpected behavior.
- Added initial support for
globalThis
.
- Plugin
eslint-plugin-node
upgraded to the latest version 9.0.0 which drops support for old Node.js and Eslint. There are also some updated rules but it should not be a big problem in our company. Therefore, this is not released as a major change from our Eslint config point of view. New rulenode/file-extension-in-import
shows warnings (errors in strict mode).
- New warnings:
react/forbid-component-props
,react/no-redundant-should-component-update
,react/require-render-return
- Rule
react/sort-comp
now returns warnings (errors in the strict mode) to simplify the migration. Turned out this rule was not configured properly and it's not battle-tested yet. You can use sort-comp React codemod to easily migrate your codebase. Please report any issues with this rule even if you just simply don't like the enforced result.
- Previous versions (all from 0.2.16.0) contained bug which caused that some rules were exported as warnings instead of errors. The same bug affected strict mode which caused that some rules returned error incorrectly. These rules are corrected as well so they return warnings instead as intended. Affected rules in normal mode which now correctly throw errors are:
- babel/camelcase
- consistent-return
- flowtype/newline-after-flow-annotation
- flowtype/require-valid-file-annotation
- import/no-anonymous-default-export
- import/no-extraneous-dependencies
- import/no-unresolved
- import/order
- jsx-a11y/no-distracting-elements
- no-global-assign
- no-labels
- no-unused-vars
- prefer-const
- spaced-comment
- These warnings (errors if you use strict mode) are now errors:
- eslint-comments/no-duplicate-disable
- eslint-comments/no-unused-enable
- flowtype/no-existential-type
- flowtype/no-types-missing-file-annotation
- flowtype/no-unused-expressions
- jest/no-disabled-tests
- jest/no-empty-title
- jest/no-mocks-import
- jest/valid-expect
- jsx-a11y/alt-text
- no-invalid-regexp
- node/no-deprecated-api
- node/no-unpublished-bin
- node/prefer-global/buffer
- node/prefer-global/console
- node/prefer-global/process
- node/prefer-global/url
- node/shebang
- prefer-named-capture-group
- react-hooks/exhaustive-deps
- react/jsx-key
- require-await
- These rules from Possible Errors Eslint group now show errors in the strict mode (normal mode not affected):
- Show warnings for new
jest/no-mocks-import
rule (see: https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-mocks-import.md) - Add
__
into default globals - please remove it from your globals if possible
- Show warnings for these rules:
flowtype/no-existential-type
,flowtype/no-types-missing-file-annotation
,flowtype/no-unused-expressions
(see: https://github.com/gajus/eslint-plugin-flowtype)
- Show warnings for
prefer-named-capture-group
rule (see: https://eslint.org/docs/rules/prefer-named-capture-group)
- Show warnings for new
react-hooks/exhaustive-deps
rule (see: facebook/react#14920)
- New rule
jest/no-empty-title
shows warnings - Internal dependencies upgraded (no issues expected)
- Show new warnings for the following rules:
-
Following rules now throw errors instead of warnings:
- curly
- no-label-var
- no-unused-vars
- linebreak-style
- babel/no-unused-expressions
- jest/no-identical-title
- jest/no-jasmine-globals
- jest/no-jest-import
- jest/no-test-return-statement
- jest/prefer-to-be-null
- jest/prefer-to-be-undefined
- jest/prefer-to-contain
- jest/prefer-to-have-length
- jest/valid-describe
- jest/valid-expect-in-promise
- jest/prefer-todo
- react/no-did-update-set-state
- react/sort-comp
- react-hooks/rules-of-hooks
- jsx-a11y/accessible-emoji
- jsx-a11y/aria-props
- jsx-a11y/aria-unsupported-elements
- jsx-a11y/no-distracting-elements
- import/no-anonymous-default-export
- node/no-missing-require
- kiwicom-incubator/no-invalid-flow-annotations
- New
@kiwicom/eslint-config/strict
mode added - check docs for more info - Rule
require-await
now shows warnings
- Some basic
jsx-a11y
added: should not cause many warnings
- Disable
no-duplicate-imports
rule - Set
import/no-duplicates
to WARN. Which is more intelligent thanno-duplicate-imports
and can differentiate betweenimport
andimport type
- Eslint now warns for unused function parameters
- Rule
import/no-anonymous-default-export
now complains only on exported functions and classes - Show warnings for new Jest rule
jest/prefer-called-with
(see: https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/prefer-called-with.md)
- Eslint now warns when you use
@noflow
or@flow weak
file annotations
- Throws warnings for
curly
rule - Rule
import/no-anonymous-default-export
now throws warnings, see: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-anonymous-default-export.md
- Disable rule
react/no-did-mount-set-state
by default
- Add
FormData
to the globals - Rule
import/no-unresolved
now ignores Relay artifacts set byartifactDirectory
- Upgrade
eslint-plugin-react-hooks
to the latest stable version (^1.0.1)
- Enable warnings for
jest/prefer-todo
rule
- Enable warnings for
react/sort-comp
rule
- Detect React version automatically
- Disable rules from
eslint-plugin-babel
that are in conflict with Prettier - Eslint dependencies upgraded to the latest versions
- Disable rule
eslint-comments/no-unlimited-disable
to make it more Relay friendly
- Rule
new-cap
now throws warnings for lower-cased class usages - Add new
react-hooks/rules-of-hooks
- Added support for
__DEV__
expression
- Show warnings for
no-unused-vars
,jest/prefer-to-be-null
,jest/prefer-to-be-undefined
,jest/prefer-to-contain
,jest/prefer-to-have-length
andeslint-comments/no-unlimited-disable
- Prettier is now in charge of styling issues
- Set
react/no-did-mount-set-state
andreact/no-did-update-set-state
to WARN - Add support for RN and RNW file extensions (
*.ios.js
,*.android.js
, ...)
- Added new
eslint-plugin-eslint-comments
to check Eslint comments - Eslint now warns when using useless combination or
return await
(no-return-await
)
- Added new
no-useless-catch
warning - Replace Jasmine eslint rules with better Jest rules
- Fixed camelcase rule to work correctly with optional chaining (
a?.b
)
- Added new plugin for Node.js
- Eslint is now required as a peer dependency