- 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 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