Updated from eslint-plugin-typescript
to @typescript-eslint/eslint-plugin
. If you have any rules defined under the typescript namespace, you will need to change those to use the new @typescript-eslint
namespace.
For example:
"rules": {
"typescript/restrict-plus-operands": "error"
}
Will become:
"rules": {
"@typescript-eslint/restrict-plus-operands": "error"
}
jest/no-standalone-expect
Preventsexpect
statements outside of atest
orit
block (368)jest/no-expect-resolves
Avoid usingexpect().resolves
(370)
- bump eslint peer depndency to 6
- Enabled
jest/no-export
rule (344) - [Major] depreciated
shopify/jest/no-try-expect
in favour ofjest/no-try-expect
(331) - [Major] depreciated
shopify/jest/no-if
in favour ofjest/no-if
(347) - [Major] Updated to eslint v6, enabled
no-console
and enabledno-async-promise-executor
(330) - Enabled
typescript/interface-name-prefix
to preventI
prefixes in TypeScript interface names - Enabled
jest/no-duplicate-hooks
rule (344)
- [Patch] Fix
jest/no-if
from falsely reporting if statements inside of functions (331)
- Removed
react/prop-types
in typescript config (309)
- Removed
import/no-namespace
(308)
- added "necessary" to
shopify/jest/no-vague-titles
(265) shopify/jest/no-if
now recognizes conditional statements (298)
- New Rules:
jest/no-commented-out-tests
disallows commented out tests.(275)jest/no-try-expect
disallowsexpect
calls incatch
blocks (300)node/prefer-promises/dns
andnode/prefer-promises/fs
These rules disallow the callback API in favor of promise API for the dns and fs modules. (257)jest/no-mocks-import
This rule disallows manually importing from__mocks__
(246)react/state-in-constructor
Enforce state initialization to be in a class property. (256)import/no-namespace
Prevents namespace imports. (305)
shopify/jest/no-if
ignores if statements nested within block statements (299)react-prefer-private-members
from incorrectly reporting the members of a parent class if a React class is defined within its constructor. (258)
-
Reverted a previous update from
eslint-plugin-typescript
to@typescript-eslint/eslint-plugin
. If you have any rules defined under the@typescript-eslint
namespace, you will need to change those to use the oldertypescript
namespace.For example:
"rules": { "@typescript-eslint/restrict-plus-operands": "error" }
Will become:
"rules": { "typescript/restrict-plus-operands": "error" }
Note: This is a temporary work-around to resolve a bug in prettier-eslint and will attempt the typescript updates again when resolved.
shopify/restrict-full-import
"empty" array pattern (eg:const [, bar] = foo
errors (#243)- Optimized
shopify/images/no-direct-imports
to be much faster in the common case (#247) shopify/react-hooks-strict-return
from crashing when a hook returns undefined (#251)
- updated
eslint-plugin-import
to version22.4.1
which introduces theno-unused-modules
rule. - updated
eslint-plugin-jest
to version22.4.1
which introduces theno-empty-title
rule. shopify/react-hooks-strict-return
Restrict the number of returned items from React hooks. (#237)
- turned off
node/no-extraneous-require
because it duplicates reported violations fromimport/no-extraneous-dependencies
(#240
shopify/jest/no-if
no longer considers if statements in describe blocks as invalid. (#235)
- turned off
consistent-return
(#236 - turned off
react/jsx-no-bind
(#239) - turned off
babel/camelcase
in typescript config because it overlaps with@typescript-eslint/camelcase
. (#238) shopify/jest/no-if
no longer considers if statements in describe blocks as invalid. (#235)
Plugin updates and additions (#233)
-
shopify/jquery-dollar-sign-reference
has been removed. -
The
eslint-comments
ruleset has been removed and is now enabled by default as part of core - if you're usinges5
,esnext
,react
ortypescript
then you can remove the reference toeslint-comments
. -
The
ava
,mocha
,jquery
andlodash
rulesets have been removed as these tools are are not commonly used at Shopify. -
The
typescript-react
andtypescript-prettier
rulesets have been removed. Replace["plugin:shopify/typescript-react"]
with["plugin:shopify/typescript", "plugin:shopify/react"]
and replace["plugin:shopify/typescript-prettier"]
with["plugin:shopify/prettier"]
-
Updated from
eslint-plugin-typescript
to@typescript-eslint/eslint-plugin
. If you have any rules defined under thetypescript
namespace, you will need to change those to use the new@typescript-eslint
namespace.For example:
"rules": { "typescript/restrict-plus-operands": "error" }
Will become:
"rules": { "@typescript-eslint/restrict-plus-operands": "error" }
More information on this change can be found in this eslint blog post.
shopify/jest/no-if
(#232)
Refer to the Rules of Hooks documentation to learn more about the following rules.
'react-hooks/rules-of-hooks': 'error'
// Only use Hooks at the top level of a React functional component or from within another custom hook.'react-hooks/exhaustive-deps': 'error'
// Checks for missing useEffect dependencies
Package | Old version | New version |
---|---|---|
eslint-plugin-sort-class-members |
1.3.1 |
1.4.0 |
eslint-plugin-promise |
4.0.0 |
4.0.1 |
eslint-plugin-node |
7.0.1 |
8.0.1 |
eslint-plugin-jsx-a11y |
6.1.1" |
6.2.1 |
eslint-plugin-jest |
21.22.0 |
21.23.0 |
eslint-plugin-import |
2.14.0 |
2.16.0 |
eslint-plugin-graphql |
2.1.0-0 |
3.0.3 |
eslint-plugin-eslint-comments |
3.0.1 |
3.1.1 |
eslint-plugin-babel |
5.1.0 |
5.3.0 |
eslint-plugin-utils |
2.1.0 |
2.3.0 |
Package | Version |
---|---|
eslint-plugin-react-hooks | 1.5.0 |
@typescript-eslint/eslint-plugin | 1.5.0 |
"@typescript-eslint/parser | 1.5.0 |
babel-eslint | 10.0.1 |
Package |
---|
eslint-plugin-mocha |
eslint-plugin-ava |
eslint-plugin-flowtype |
eslint-plugin-chai-expect |
eslint-plugin-lodash |
eslint-plugin-jquery |
jest/no-vague-titles
addedevery
anddescriptive
as vague words. (#221)
26.3.0 - 2019-02-21
- Updated
eslint-plugin-react
and enabledreact/jsx-fragments
rule to prefer using<>
over<React.Fragment>
when defining fragments (#223)
26.2.0 - 2019-02-14
images-no-direct-imports
(#219)
26.1.2 - 2019-01-02
jest/no-vague-titles
no longer flags when the wordcall
is used. (#203)- Update
eslint-plugin-prettier
to 3.0.1 so it does not crash when given an unparsable file (#212)
jest/no-vague-titles
addedshould
andproperly
to vague rules and new configuration toallow
words. (#208)
26.1.1 - 2018-10-31
typescript-eslint-parser
pinned at20.0.0
to avoid a known issue (#201)
26.1.0 - 2018-10-30
shopify/no-ancestor-directory-import
(#149)
- Set TypeScript parser only on TS files. This makes sure you can extend from the typescript and react configs in either order. Previously you had to make sure typescript came first to avoid using the babel-eslint parser on typescript files. Now we suggest to extend from typescript, and then react to ensure some rules some JSX rules don't get inadventently disabled. (#200)
26.0.0 - 2018-10-26
-
shopify/eslint-comments
plugin with eslint-plugin-eslint-comments rules:eslint-comments/disable-enable-pair
,eslint-comments/no-aggregating-enable
eslint-comments/no-duplicate-disable
eslint-comments/no-unlimited-disable
eslint-comments/no-unused-disable
eslint-comments/no-unused-enable
eslint-comments/no-restricted-disable
(disabled)eslint-comments/no-use
(disabled)
-
shopify/jest/no-snapshots
(#182)
- Updated
plugin:shopify/prettier
,plugin:shopify/react
, andplugin:shopify/typescript
to useoverrides
(#173) - Updated
import/order
rule to enforce ordering of internal, parent and sibling imports (#189) - Updated
func-style
rule to allow arrow functions (#188)
- Rolling back
eslint-plugin-graphql
to2.1.0-0
for multiple schema support (#195)
25.1.0 - 2018-10-01
- Updated
typescript-eslint-parser
dependency to version 19.0.2 to supporttypescript-estree
. (#176)
25.0.1 - 2018-09-25
- Restored
typescript-prettier
config to overrideprettier
plugin parser. (#171)
25.0.0 - 2018-09-25
- Updated
plugin:shopify/prettier
to enable prettier linting. (#170) strict-component-boundaries
now consistently uses the resolved path from the app root to perform its checks. This fixes a number of false-positives. (#160)
24.2.0 - 2018-09-21
- Added
plugin:shopify/graphql
to module index. (#168)
- Updated
no-vague-titles
rule to fix parsing issues ingetMethodName
. (#167)
24.1.1 - 2018-09-19
- Same as
24.1.0
24.1.0 - 2018-09-19
- Added
shopify/graphql
config using neweslint-plugin-graphql
(2.1.1.
) dependency. (#165)
24.0.0 - 2018-08-30
plugin:shopify/flow
now disables rules checked by Flow's static analyzer. (#135)plugin:shopify/prettier
andplugin:shopify/typescript-prettier
defer missing semicolon rules to a project´s.prettierrc
. (#135)- Updated
strict-component-boundaries
to exclude fixture imports. (#117) - Updated
strict-component-boundaries
to exclude imports from node_modules. (#140) - Updated
jest/no-vague-titles
to support.each
syntax. (#148)
- Namespaced
prefer-pascal-case-enums
andprefer-singular-enums
undertypescript
. (#141) - Breaking: Updated to eslint
v5.4.0
. Consuming projects must be using supported node versions, we recommend^8.10.0
. See details on the v4 to v5 migration guide. (#151)
-
shopify/prefer-singular-enums
(#132) -
shopify/react-no-multiple-render-methods
(#134) -
New eslint rules and plugins rules: (#151)
max-classes-per-file
(disabled)no-self-assign
require-unicode-regexp
(disabled)no-async-promise-executor
no-misleading-character-class
require-atomic-updates
lines-between-class-members
max-lines-per-function
(disabled)multiline-comment-style
(disabled)prefer-object-spread
import/no-self-import
import/no-cycle
import/no-relative-parent-imports
jest/expect-expect
jest/no-jasmine-globals
jest/prefer-inline-snapshots
(disabled)jest/no-test-return-statement
node/prefer-global/buffer
node/prefer-global/console
node/prefer-global/process
node/prefer-global/url-search-params
node/prefer-global/url
node/no-unsupported-features/es-builtins
(disabled)node/no-unsupported-features/es-syntax
(disabled)node/no-unsupported-features/node-builtins
react/no-unsafe
react/jsx-props-no-multi-spaces
typescript/no-inferrable-types
typescript/no-var-requires
23.1.0 - 2018-08-02
- Updated
typescript-eslint-parser
dependency to version 17.0.1 in order to support TypeScript 3. (#121) - Removed default prettier configurations.
plugin:shopify/prettier
andplugin:shopify/typescript-prettier
now defer Prettier's config to a project's.prettierrc
. (#121)
- Included
all
as a vague term forno-vague-titles
(#114)
23.0.0 - 2018-07-16
- Breaking
eslint-plugin-shopify
will no longer installprettier
as a dependency. Please ensure you have addedprettier
to yourpackage.json
if you wish to use it.
shopify/jsx-prefer-fragment-wrappers
(#94)shopify/jest/no-vague-titles
(#93)shopify/strict-component-boundaries
(#98)
- Breaking Moved prettier to be a peerDependency, this avoids the potential for having multiple versions of prettier in the dependency graph. If you use prettier you will need to ensure you have it installed in your project as eslint-plugin-shopify will no longer install it for you (#107)
- Breaking Updated
typescript-eslint-parser
to support[email protected]
(#102)
22.1.0 - 2018-06-08
- Updated
eslint-plugin-sort-class-members
dependency to version 1.3.1 in order to support node 10.
- Updated dependencies
- Added support for TypeScript 2.8
21.0.1 - 2018-04-25
- Fixed the publish config for the package.
21.0.0 - 2018-04-25
shopify/jsx-no-hardcoded-content
now accepts adom
option that allows specifying attributes on DOM elements and Web Components to be checked for hardcoded content.
- Breaking: turned off four rules that previously triggered errors in all cases:
shopify/react-type-state
(TypeScript now addresses the issue this rule was meant to catch)promise/always-return
react/no-did-mount-set-state
no-undefined
- Breaking: turned off two rules in specific plugins:
babel/no-invalid-this
(turned off for thetypescript
configs as TypeScript has better mechanisms for unsuring a validthis
is used)no-process-env
(turned off for thewebpack
andnode
configs as both targets can benefit from use ofprocess.env
)
- Fixed an issue where various rules were not correctly resolving paths in
node_modules
.
20.0.0 - 2018-03-15
- Breaking: the version of TypeScript supported by this plugin is 2.7.x (in line with typescript-eslint-parser’s TypeScript support)
- Updated dependencies that support the new ESLint documentation URL metadata. Errors from these plugins are accompanied by a link to the documentation for the broken rule.
- Dependencies are now strictly versioned for tighter control over the exact rules the plugin enforces.
Package | old | new |
---|---|---|
eslint-plugin-ava |
^4.4.0 |
4.5.1 |
eslint-plugin-import |
^2.8.0 |
2.9.0 |
eslint-plugin-jest |
^21.5.0 |
21.14.1 |
eslint-plugin-lodash |
^2.5.0 |
2.6.1 |
eslint-plugin-node |
^5.2.1 |
6.0.1 |
eslint-plugin-prettier |
^2.4.0 |
2.6.0 |
eslint-plugin-promise |
^3.6.0 |
3.7.0 |
eslint-plugin-react |
^7.5.1 |
7.7.0 |
eslint-plugin-typescript |
^0.8.1 |
0.10.0 |
- Added rules:
react/forbid-dom-props
(disabled)react/jsx-child-element-spacing
errorreact/jsx-max-depth
(disabled)react/jsx-sort-default-props
(disabled)react/no-this-in-sfc
errorimport/group-exports
(disabled)import/no-self-import
errorimport/no-default-export
(disabled)import/no-useless-path-segments
errorjest/prefer-expect-assertions
(disabled)jest/valid-expect-in-promise
errorjest/valid-describe
errorjest/consistent-test-it
errorjest/no-test-prefixes
errorjest/lowercase-name
(disabled)jest/no-jest-import
errorpromise/valid-params
errorpromise/no-new-statics
(disabled)typescript/explicit-function-return-type
(disabled)typescript/no-non-null-assertion
error
- Updated
import/extensions
due to changes in its implementation: some extensions are explicitly allowed inimport
s:.svg
,.png
,.jpg
,.ico
,.css
,.sass
,.scss
,.less
,.styl
..json
is still required as well. - Chore: updated CircleCI from v1 to v2.
19.0.1 - 2018-03-12
shopify/jsx-no-hardcoded-content
rule now does not warn on all-whitespace strings as children. This was causing issues with indented JSX content, and is typically not an issue for different locales.
19.0.0 - 2018-01-17
shopify/jest
config with eslint-plugin-jest rules:jest/no-disabled-tests
(disabled)jest/no-focused-tests
jest/no-identical-title
jest/no-large-snapshots
(limited to 12 lines)jest/prefer-to-have-length
jest/prefer-to-be-null
jest/prefer-to-be-undefined
jest/valid-expect
- Added
shopify/webpack
config - Added
shopify/polaris
config - Added
shopify/webpack/no-unnamed-dynamic-imports
rule - Added
shopify/prefer-module-scope-constants
rule - Added
shopify/jsx-no-complex-expressions
rule - Added
shopify/jsx-no-hardcoded-content
rule - Added
shopify/polaris-no-bare-stack-item
rule - Added
shopify/polaris-prefer-sectioned-prop
rule - Added
shopify/react-initialize-state
rule - Added
shopify/react-type-state
rule - Added
implicit-arrow-linebreak
rule - Added
lines-around-comment
rule (as a special rule). - Added
no-unexpected-multiline
rule (as a special rule). - Added
flowtype/no-flow-fix-me-comments
- Added
react/jsx-one-expression-per-line
- Added
react/destructuring-assignment
- Added
react/no-access-state-in-setstate
- Added
react/button-has-type
- Added
react/jsx-curly-brace-presence
- Added
typescript/member-naming
- Added
typescript/no-array-constructor
- Added
yarn prettier
script (prettifies source files)
-
Updated dependencies to their latest versions (full details in #63)
-
Breaking:
node.js
minimum supported node version update to8.9.4
(LTS). -
Breaking: Changed
eslint-config-shopify
codebase totrailingComma: 'all'
and drop support for Node.js 6 -
Breaking: Updated prettier to 1.9.2, introducing a change in function parens style (set to
arrowParens: 'always'
):// Before const foo = myArray.map(foo => {}); // After const foo = myArray.map((foo) => {});
Your project config files (
package.json
,.prettierrc
,.eslintrc
…) may need to be updated like so:"singleQuote": true, "bracketSpacing": false, "trailingComma": "all", + "arrowParens": "always"
-
Prettified source files using the new config
18.3.1 - 2017-12-21
- Changed
eslint-config-shopify
codebase to follow es5 trailingComma [#61]
18.3.0 - 2017-12-18
- Added
shopify/no-debugger
, which behaves the same as ESLint'sno-debugger
but without a fixer.
18.2.0 - 2017-12-04
- Added a
typescript-prettier
config to run prettier against typescript projects.
18.1.0 - 2017-12-01
- Added a
typescript
andtypescript-react
config [#54]
-
plugin:shopify/prettier
will now enforce trailing commas in function parameter calls [#55] -
comma-dangle
will now enforce multi-line function parameters [#55] -
Removed
plugin:shopify/esnext
as an included extension of theplugin:shopify/prettier
config.plugin:shopify/esnext
must now be extended by the consumer to use theplugin:shopify/prettier
. [#53]Example (
package.json
):"eslintConfig": { "extends": [ "plugin:shopify/esnext", "plugin:shopify/prettier" ] }
18.0.0 - 2017-10-31
- Turned off
class-methods-use-this
17.2.1 - 2017-10-30
- Turned off
babel/semi
rule in prettier config
- Added a prettier config [#46]
Example:
"eslintConfig": {
"extends": [
"plugin:shopify/prettier"
]
}
- Replace all
warn
witherror
[#48] space-before-function-paren
now usesasyncArrow
option (eg.async () => {}
) [#43]- Enable
padding-line-between-statements
for directives. [#44]
lines-around-directive
was deprecated in ESLintv4.0.0
. [#44]
- New rules (#41):
import/no-anonymous-default-export
jsx-a11y/anchor-is-valid
no-buffer-constructor
node/no-extraneous-import
(disabled)node/no-extraneous-require
for-direction
getter-return
react/boolean-prop-naming
(disabled)react/default-props-match-prop-types
react/no-redundant-should-component-update
react/no-typos
react/no-unused-state
react/jsx-closing-tag-location
array-bracket-newline
(disabled)array-element-newline
(disabled)function-paren-newline
padding-line-between-statements
(disabled)semi-style
switch-colon-spacing
- Updated dependencies (#41):
eslint
babel-eslint
eslint-plugin-import
eslint-plugin-jsx-a11y
eslint-plugin-node
eslint-plugin-react
jquery-dollar-sign-reference
no longer flags assignments fromawait
expressions
jsx-a11y/href-no-hash
replaced withjsx-a11y/anchor-is-valid
eslint
upgrade to4.3.0
node.js
minimum supported node version update to6.11.1
(LTS).- Update dependencies:
eslint-plugin-ava
:^4.2.0
→^4.2.1
.eslint-plugin-babel
:^4.1.1
→^4.1.2
.eslint-plugin-lodash
:^2.4.2
→^2.4.4
.eslint-plugin-mocha
:^4.9.0
→^4.11.0
.eslint-plugin-node
:^4.2.2
→^4.2.3
.eslint-plugin-react
:^7.0.0
→^7.0.1
.
- Turned off
prefer-destructuring
(#30)
- New rule:
babel/semi
- New rule:
flowtype/no-types-missing-file-annotation
- New rule:
jsx-a11y/accessible-emoji
- New rule:
jsx-a11y/alt-text
- New rule:
jsx-a11y/aria-activedescendant-has-tabindex
- New rule:
jsx-a11y/iframe-has-title
- New rule:
jsx-a11y/interactive-supports-focus
- New rule:
jsx-a11y/media-has-caption
(disabled) - New rule:
jsx-a11y/no-autofocus
- New rule:
jsx-a11y/no-distracting-elements
- New rule:
jsx-a11y/no-interactive-element-to-noninteractive-role
(disabled) - New rule:
jsx-a11y/no-noninteractive-element-interactions
- New rule:
jsx-a11y/no-noninteractive-element-to-interactive-role
- New rule:
jsx-a11y/no-noninteractive-tabindex
- New rule:
jsx-a11y/no-redundant-roles
- New rule:
lodash/prefer-some
- New rule:
react/forbid-elements
(disabled) - New rule:
react/forbid-foreign-prop-types
- New rule:
react/no-will-update-set-state
- New rule:
react/void-dom-elements-no-children
- New rule:
no-await-in-loop
- New rule:
prefer-promise-reject-errors
- New rule:
require-await
- New rule:
prefer-destructuring
- New rule:
no-compare-neg-zero
- New rule:
capitalized-comments
(disabled) - New rule:
no-multi-assign
- New rule:
nonblock-statement-body-position
(disabled) - New rule:
template-tag-spacing
- Deprecated:
babel/no-await-in-loop
- Deprecated:
jsx-a11y/img-has-alt
- Deprecated:
jsx-a11y/onclick-has-focus
- Deprecated:
jsx-a11y/onclick-has-role
- Deprecated:
jsx-a11y/jsx-space-before-closing
eslint
upgrade to3.17.x
jquery-dollar-sign-reference
now checks assignments fromLogicalExpression
/BinaryExpression
- Added
eslint-index
package (#4) - Added
rules-status
andrules-omitted
scripts (#4) - Added new
eslint-plugin-react
rules:no-array-index-key
,require-default-props
(#4) - Added new
eslint-plugin-lodash
rules:import-scope
(#4) - Added new
eslint-plugin-promise
rules:no-return-wrap
,no-nesting
,no-promise-in-callback
,no-callback-in-promise
,avoid-new
,prefer-await-to-then
,prefer-await-to-callbacks
(#4)
- Updated
eslint-plugin-flowtype
,eslint-plugin-lodash
,eslint-plugin-mocha
,eslint-plugin-promise
,eslint-plugin-react
to their latest versions (#4) - Updated
react/prefer-stateless-function
rule to includeignorePureComponents
flag (#4)
- Removed
eslint-find-rules
package (#4)
Changes were originally tracked in Shopify's JavaScript monorepo.