- #433
f09362b
Thanks @ryanwilsonperkin! - Switching to Eslint flat config format for v9
-
#420
32e249f
Thanks @BPScott! - Update required eslint version to^8.56.0
as required by the newest version of@typescript-eslint/eslint-plugin
.Update required node version to
18.20.0
as required by the newest version of@typescript-eslint/eslint-plugin
.The
jest/no-if
rule has been removed and replaced withjest/no-conditional-in-test
.The
unicode-bom
rule is no longer turned off if you enable the prettier ruleset pereslint-config-prettier
, prettier preserves the bom value if it is present and does not add one if missing.Update eslint plugins to new versions:
@typescript-eslint/eslint-plugin
:^6.2.1
->^7.9.0
MAJOReslint-config-prettier
:^8.10.0
->^9.1.0
MAJOReslint-plugin-jest
:^27.2.3
=>^28.5.0
MAJOReslint-plugin-jsx-ally
:^6.7.1
=>^6.8.0
eslint-plugin-prettier
:^5.0.0
=>^5.1.3
eslint-plugin-react
:^7.33.1
=>^7.34.1
eslint-plugin-react-hooks
:^4.6.0
=>^4.6.2
eslint-plugin-sort-class-members
:^1.18.0
=>^1.20.0
See package changelogs for breaking change information:
- #409
4fd9e99
Thanks @jas7457! - Change the @typescript-eslint/consistent-indexed-object-style rule to use default error settings, aka Record over index signature
-
#397
3895e25
Thanks @m4thieulavoie! - Upgrade eslint plugins to support prettier3.x
. Drop support for prettier2.x
. -
#399
b602765
Thanks @m4thieulavoie! - upgrade @typescript-eslint and eslint plugins and drop support for node 14
- #371
3e31042
Thanks @laurkim! - Updated component URLs for polaris.shopify.com and updatedpolaris-no-bare-stack-item
to supportLegacyStack
andpolaris-prefer-sectioned-prop
to supportLegacyCard
'
- #356
0b52b9e
Thanks @marvinhagemeister! - Speedup polaris linting rules by about 12% via caching already resolved files.
- #350
06e1245
Thanks @marvinhagemeister! - Update theeslint-plugin-import
to the latest version which contains significant performance improvements for module resolution.
- #341
8cbfc69
Thanks @BPScott! - Updateeslint-plugin-prettier
tov4.1.0
, to automatically skip trying to run prettier over graphql files. Remove the explicit override for disabling prettier in graphql files, as it will cause eslint's "work out what extensions need linting" logic to try to parse graphql files. Add{overrides: {files: ['*.graphql', '*.gql'], rules: {'prettier/prettier': 'off'}}}
to your eslint config if want to disable running the prettier rule over graphql files entirely.
- #340
af6fccc
Thanks @BPScott! - Remove the@shopify/eslint-plugin/graphql
config and the dependency oneslint-plugin-graphql
as it is outdated and unsupported. If you used the graphql config then you should migrate to@graphql-eslint/eslint-plugin
. We no longer provide recommended graphql config as it has a large install footprint and we do not want to push that onto consumers that do not use graphql.
- #338
d8c61cc
Thanks @BPScott! - Remove a layer of indirection by specifying rules inlib/config/*.js
files instead of having them import content fromlib/config/rules/*.js
- Update
eslint-plugin-react
dependency to^7.30.0
. Fix breakages by no longer reaching intoeslint-plugin-react
's internals. [#332]
- Allow usage of
q
variable inid-length
rule [#329]
- Fixed conflicting dependency on
eslint
by upgradingeslint-plugin-promise
to6.0.0
. [#325]
- Removed
lines-around-comment
rule, let prettier handle formatting of comments. [#319]
- Set
requireConfigFile: false
so that js files can be parsed using@babel/eslint-parser
in projects that lack a babel config file. [#310]
- Updated peer dependency on
eslint
to require at least v8.3.0. [#305] - Replaced usage of the long-deprecated
babel-eslint
andeslint-plugin-babel
with@babel/eslint-parser
and@babel/eslint-plugin
. [#305] - Updated the minimum version of several eslint plugins. [#305]
Package | Old version | New version |
---|---|---|
typescript-eslint/eslint-plugin |
^4.28.2 |
^5.4.0 |
typescript-eslint/parser |
^4.28.2 |
^5.4.0 |
eslint-plugin-import |
^2.23.4 |
^2.25.3 |
eslint-plugin-jest |
^24.3.6 |
^25.3.0 |
eslint-plugin-jest-formatting |
^3.0.0 |
^3.1.0 |
eslint-plugin-jsx-a11y |
^6.4.1 |
^6.5.0 |
eslint-plugin-prettier |
^3.4.0 |
^4.0.0 |
eslint-plugin-promise |
^5.1.0 |
^5.1.1 |
eslint-plugin-react |
^7.24.0 |
^7.27.1 |
eslint-plugin-react-hooks |
^4.2.0 |
^4.3.0 |
eslint-plugin-sort-class-members |
^1.11.0 |
^1.14.0 |
- Update env and ecmaVersion to '2021' in
esnext
andtypescript
presets to support modern language features. [#296, #304] - Remove configuring
parserOptions
from thejest
preset as this handled by the the es5/esnext/typescript presets. [#304] - Removed dependency on
merge
by replacing usage with object spread. [#308]
- Loosen semver restrictions on
eslint
plugins. [#297]
- Update
eslint
and plugin dependencies. [#272]
- Removed
jsx-a11y/autocomplete-valid
rule foreslint-plugin
. [#264] - Add
react-require-autocomplete
lint rule to@shopify/eslint-plugin
. [#251]
- Fix conflicting
@typescript-eslint/naming-convention
rules. [#247]
- Update
merge
to2.1.1
. [#244]
- Fixed a conflict between Prettier and rules
*/object-curly-spacing
. [#227]
- Added
jsx-a11y/autocomplete-valid
rule foreslint-plugin
. [#217] - Updated
@typescript-eslint/parser
and@typescript-eslint/eslint-plugin
to version4.20.0
. [#223]
- Include jest formatting in
@shopify/eslint-plugin
ruleset. [#213]
- Fix incompatibility between
@typescript-eslint/array-type
and@typescript-eslint/ban-types
. [#212]
- Updated
eslint-plugin
test to prepare foreslint@7
upgrade. [#211]
- Updated
eslint-plugin
plugins and removed support foreslint@6
. [#194]
Package | Old version | New version |
---|---|---|
eslint-config-prettier |
6.14.0 |
7.2.0 |
eslint-plugin-jest-formatting |
2.0.0 |
2.0.1 |
eslint-plugin-promise |
4.2.1 |
4.3.1 |
eslint-plugin-jest |
24.1.0 |
24.1.3 |
eslint-plugin-react |
7.21.5 |
7.22.0 |
eslint-plugin-sort-class-members |
1.8.0 |
1.9.0 |
@typescript-eslint/eslint-plugin |
4.1.0 |
4.15.0 |
@typescript-eslint/parser |
4.1.0 |
4.15.0 |
change-case |
4.1.0 |
4.1.2 |
- Updated TypeScript naming rules to ensure type name start with a "T" and interface names don't start with an "I". [#198]
- Updated
eslint-config-prettier
dependency to v3.3.0. [#202]
- Fixed a syntax error in
peerDependencies
to allow eslint@^7.0.0. [#196]
- Add support for CommonJS in
prefer-module-scope-constants
. [#195]
- Updated
eslint-plugin
plugins. [#194]
Package | Old version | New version |
---|---|---|
eslint-config-prettier |
6.11.0 |
6.14.0 |
eslint-plugin-jsx-a11y |
6.3.1 |
6.4.1 |
eslint-plugin-import |
2.22.0 |
2.22.1 |
eslint-plugin-jest |
24.0.0 |
24.1.0 |
eslint-plugin-react |
7.20.6 |
7.21.5 |
eslint-plugin-react-hooks |
4.1.1 |
4.1.2 |
- Added
id
field tographql/required-fields
rule. [#166]
Package | Old version | New version |
---|---|---|
@typescript-eslint/eslint-plugin |
3.9.1 |
4.1.0 |
@typescript-eslint/parser |
3.9.1 |
4.1.0 |
eslint-plugin-babel |
5.3.0 |
5.3.1 |
eslint-plugin-eslint-comments |
3.1.2 |
3.2.0 |
eslint-plugin-graphql |
3.1.1 |
4.0.0 |
eslint-plugin-jest |
23.13.0 |
24.0.0 |
eslint-plugin-jsx-a11y |
6.2.3 |
6.3.1 |
eslint-plugin-node |
3.1.3 |
3.1.4 |
eslint-plugin-react |
7.20.0 |
7.20.6 |
eslint-plugin-react-hooks |
4.0.2 |
4.1.1 |
eslint-plugin-sort-class-members |
1.7.0 |
1.8.0 |
- Created a new rule,
@shopify/typescript/prefer-build-client-schema
. [#176]
-
Dropping
eslint-plugin-typescript
and upgrading@typescript-eslint/eslint-plugin
from2.33.0
to3.9.1
. The update brings breaking changes from the version 3 release of@typescript-eslint/eslint-plugin
. -
Removal of
@typescript-eslint/class-name-casing
and@typescript-eslint/camelcase
for@typescript-eslint/naming-convention
. Please update your ignore statements. -
Removal of
@typescript-eslint/ban-ts-ignore
for@typescript-eslint/ban-ts-comment
. Please update your ignore statements.
The following new rules were introduced. More information can be found. [#157]
Facebook improved the eslint-plugin-react-hooks
plugin. We may have to update the dependencies of some hooks.
Package | Old version | New version |
---|---|---|
@typescript-eslint/eslint-plugin |
2.25.0 |
2.33.0 |
@typescript-eslint/parser |
2.25.0 |
2.33.0 |
babel-eslint |
10.0.3 |
10.1.0 |
change-case |
4.0.1 |
4.1.1 |
eslint-config-prettier |
6.7.0 |
6.11.0 |
eslint-module-utils |
2.5.0 |
2.6.0 |
eslint-plugin-graphql |
3.1.0 |
3.1.1 |
eslint-plugin-import |
2.19.1 |
2.20.2 |
eslint-plugin-jest |
23.7.0 |
23.13.0 |
eslint-plugin-node |
10.0.0 |
11.1.0 |
eslint-plugin-prettier |
3.1.2 |
3.1.3 |
eslint-plugin-react |
7.17.0 |
7.20.0 |
eslint-plugin-react-hooks |
2.3.0 |
4.0.2 |
eslint-plugin-sort-class-members |
1.6.0 |
1.7.0 |
merge |
1.2.1 |
1.2.1 |
pkg-dir |
4.2.0 |
4.2.0 |
- adding
allow
andmaxDepth
options tostrict-component-boundaries
rule. [#150]
- Fix an bug with '@shopify/react-no-multiple-render-methods'.
🚨Package rename
This package has been renamed from eslint-plugin-shopify
to @shopify/eslint-plugin
. You must update you eslint config to account for the new name, when referencing the plugin and individual rules.
Before:
plugins: ['shopify'],
extends: ['plugin:shopify/'],
rules: {
'shopify/...': 'off',
}
After:
plugins: ['@shopify'],
extends: ['plugin:@shopify/...'],
rules: {
'@shopify/...': 'off',
}
- Update
@typescript-eslint/eslint-plugin
and@typescript-eslint/parser
to 2.25.0, to support new syntax introduced in Typescript 3.8. [#523]
- remove
no-vague-titles
because the rule was adopted intoeslint-plugin-jest
'svalid-title
rule. See thevalid-title
documentation - Fixed an issue with
typescript/prefer-pascal-case-enum
when you had enum with key as string. [#517]
- fix enabled graphql rules by specifying
env: 'literal'
. [#514]
- changed
no-vague-titles
rule to catch blacklisted words (instead of sequences) in the title. [#514] - removed
jest/no-empty-title
and renamedjest/require-tothrow-message
tojest/require-to-throw-message
. [#499]
The followiing new rules were introduced in [email protected]
. More information can be found on the eslint blog.
grouped-accessor-pairs
no-constructor-return
no-dupe-else-if
no-setter-return
prefer-exponentiation-operator
- The
graphql
configs have been pushed to anoverride
for files matching a.graphql
extension. This will allow this config to chain together with other parser-setting configs without changing the parser value. Consider the following config:
// .eslintrc
{
extends: [
"plugin:shopify/typescript",
"plugin:shopify/graphql"
]
}
Before this change the final parser becomes babel-eslint
for all files. This will cause errors when parsing TypeScript files even though we are extending the typescript config :( You could workaround this by moving the plugin:shopify/graphql
first in the extends array or lint GraphQL files in a seperate script.
After this change Final parser is babel-eslint
for only .graphql
files while @typescript-eslint/parser
is set for all .ts
and .tsx
files. This should not cause any parser-related errors :)
shopify/no-all-mocks-methods
. [#204]shopify/no-namespace-imports
Prevent namespace import declarations. [#262]
jest/valid-title
jest/prefer-hooks-on-top
jest/require-top-level-describe
- Enforce new-lines between groups import groups. [#409]
- Breaking Change 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"
}
- Breaking Change The
plugin:shopify/react
is no longer a core config and must augment one of theplugin:shopify/typescript
orplugin:shopify/esnext
configs. See examples below
Example config for react without typescript projects:
{
"extends": [
"plugin:shopify/esnext",
"plugin:shopify/react"
// ...other configs
]
}
Example config for react with typescript projects:
{
"extends": [
"plugin:shopify/typescript",
"plugin:shopify/react"
// ...other configs
]
}
- Note If using the
plugin:shopify/typescript-type-checking
augmented config, you must specify a path to your tsconfig.json file in the "project" property of "parserOptions"
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]
- Updated
eslint-plugin-react
and enabledreact/jsx-fragments
rule to prefer using<>
over<React.Fragment>
when defining fragments. [#223]
images-no-direct-imports
. [#219]
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]
typescript-eslint-parser
pinned at20.0.0
to avoid a known issue. [#201]
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]
-
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]
- Updated
typescript-eslint-parser
dependency to version 19.0.2 to supporttypescript-estree
. [#176]
- Restored
typescript-prettier
config to overrideprettier
plugin parser. [#171]
- 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]
- Added
plugin:shopify/graphql
to module index. [#168]
- Updated
no-vague-titles
rule to fix parsing issues ingetMethodName
. [#167]
- Same as
24.1.0
- Added
shopify/graphql
config using neweslint-plugin-graphql
(2.1.1.
) dependency. [#165]
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
- 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]
- 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]
- 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
- Fixed the publish config for the package.
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
.
- 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.
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.
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) => {});
⚠️ Upgrade path: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
- Changed
eslint-config-shopify
codebase to follow es5 trailingComma. [#61]
- Added
shopify/no-debugger
, which behaves the same as ESLint'sno-debugger
but without a fixer.
- Added a
typescript-prettier
config to run prettier against typescript projects.
- 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" ] }
- Turned off
class-methods-use-this
- 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.