Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Releases: Shopify/eslint-plugin-shopify

v33.0.0

20 Nov 14:51
Compare
Choose a tag to compare

Breaking Change

  • The graphql configs have been pushed to an override 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 :)

New Rules

  • shopify/no-all-mocks-methods (#204)
  • shopify/no-namespace-imports Prevent namespace import declarations. (262)

v31.0.0

23 Oct 05:20
Compare
Choose a tag to compare

Typescript Parser Changes

  • 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"
}
  • 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"

React Config Changes

  • Breaking Change The plugin:shopify/react is no longer a core config and must augment one of the plugin:shopify/typescript or plugin:shopify/esnext configs. See examples below

Example config for react without typescript projects:

{
  "extends": [
    "plugin:shopify/esnext",
    "plugin:shopify/react",
    "// ...other plugins"
  ]
}

Example config for react with typescript projects:

{
  "extends": [
    "plugin:shopify/typescript",
    "plugin:shopify/react",
    "// ...other plugins"
  ]
}

New Rules

  • jest/no-standalone-expect Prevents expect statements outside of a test or it block (368)
  • jest/no-expect-resolves Avoid using expect().resolves (370)

Dependencies

  • As of this version, you will need to be upgrade to eslint@^6.0.0 within your project.

v30.0.0

24 Jul 22:32
Compare
Choose a tag to compare

Changes

  • Changed typescript/interface-name-prefix to prevent I prefixes in TypeScript interface names
  • Enabled jest/no-duplicate-hooks
  • Enabled jest/no-export
  • Enabled no-async-promise-executor
  • Removed shopify/jest/no-try-expect we now use jest/no-try-expect instead
  • Removed shopify/jest/no-if we now use jest/no-if instead

v29.0.2

18 Jun 05:05
Compare
Choose a tag to compare

Changed

  • Removed react/prop-types in typescript config (309)

v29.0.1

18 Jun 05:04
Compare
Choose a tag to compare

Changed

  • Removed import/no-namespace (308)

v29.0.0

17 Jun 19:35
Compare
Choose a tag to compare

Added Rules

  • jest/no-commented-out-tests disallows commented out tests.(275)
  • jest/no-try-expect disallows expect calls in catch blocks (300)
  • node/prefer-promises/dns and node/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)

Changed Rules

  • shopify/jest/no-vague-titles considers "necessary" to be invalid/ vague (265)
  • shopify/jest/no-if now recognizes conditional statements (298) and ignores if statements nested within block statements (299)
  • react-prefer-private-members no longer incorrectly reporting the members of a parent class if a React class is defined within its constructor. (258)

v27.0.0

08 Apr 19:50
Compare
Choose a tag to compare

Breaking Changes

  • 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 using es5, esnext, react or typescript then you can remove the reference to eslint-comments.

  • The ava, mocha, jquery and lodash rulesets have been removed as these tools are are not commonly used at Shopify.

  • The typescript-react and typescript-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 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"
    }

    More information on this change can be found in this eslint blog post.

New rules

  • 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'
  • 'react-hooks/exhaustive-deps': 'error'

Changed rules

  • jest/no-vague-titles added every and descriptive as vague words. (#221)

v23.0.0

16 Jul 08:03
Compare
Choose a tag to compare

Added

  • shopify/jsx-prefer-fragment-wrappers (#94)
  • shopify/jest/no-vague-titles (#93)
  • shopify/strict-component-boundaries (#98)
  • shopify/prefer-pascal-case-enums (#96)
  • shopify/react-prefer-private-members (#95)

Changed

  • 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 typescript@2.9.1 (#102)
  • Updated eslint-plugin-sort-class-members dependency to version 1.3.1 in order to support node 10.
  • Support for TypeScript 2.8
  • Fixed the publish config for the package.

v20.0.0 - TypeScript 2.7 support

16 Mar 00:00
Compare
Choose a tag to compare
  • 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

v19.0.1

14 Mar 01:08
Compare
Choose a tag to compare

Fixed

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