Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tslint-config-shopify

Shopify457MITdeprecated3.0.2

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Shopify's baseline TSLint config.

tslint, tslintconfig, tslintplugin, tslint-config, tslint-config-shopify, shopify

readme

tslint-config-shopify

Circle CI David-DM

⚠️ Deprecated: use eslint-plugin-shopfiy instead ⚠️

Shopify’s TSlint rules and configs.

Installation

Install TSlint and tslint-config-shopify:

With Yarn

yarn add --dev tslint tslint-config-shopify

With npm

npm install tslint tslint-config-shopify --save-dev

Usage

Shopify’s TSLint rules come bundled in tslint-config-shopify. To enable these rules, create a tslint.json file at the root level of your project, and extend tslint-config-shopify.

{
  "extends": "tslint-config-shopify"
}

Now you can run TSLint by adding the following linting script to your package.json. See here for more script configurations.

{
  "scripts": {
    "lint": "tslint './src/**/*.{ts,tsx}' --project tsconfig.json"
  }
}

Run it:

With Yarn

yarn run tslint

With npm

npm run tslint

Configuration

  • See here for more details on configuring your tslint.json.
  • See here for all the rules provided by TSlint

Some of the rules configured in tslint-config-shopify may not be sufficient for your project. You can override these rules in tslint.json:

{
  "extends": "tslint-config-shopify",
  "rules": {
    "no-console": false
  }
}

changelog

Changelog

3.0.2 - 2018-06-07

⚠️ Deprecated: use eslint-plugin-shopfiy instead ⚠️

Removed

  • Do not warn for class methods that do not use this (#78)

Fixed

  • Fixed a regression where allow-leading-underscore was removed, disallowing leading underscores in variable names (#80)

3.0.1 - 2017-09-14

Fixed

  • Fixed a regression where import { foo }... would be enforced instead of import {foo}... (#74)
  • Fixed a regression where a block could open without a space before it (e.g. function(){ return 'foo'; } would be valid while missing whitespace between ) and {) (#74)

[3.0.0] - 2017-06-28

Removed

  • Removed the untyped config. Typed rules are now enabled by default as appropriate, and all modern editors safely disregard them instead of throwing errors.

[2.1.0] - 2017-06-08

Added

  • Added new tslint rules introduced between v5.2.0-v5.4.3 releases
    • no-object-literal-type-assertion
    • no-unused-variable (disbaled)
    • prefer-conditional-expression (disabled)
    • prefer-object-spread
    • use-default-type-parameter (disabled)
    • deprecation
    • number-literal-format
    • binary-expression-operand-order
    • encoding
    • no-boolean-literal-compare
    • no-irregular-whitespace
    • prefer-switch (disabled)
    • switch-final-break
    • type-literal-delimiter (disabled)
    • no-unnecessary-type-assertion

Changed

  • Disable match-default-export-name rule (#69)
  • Set indentation size in indent rule (#69)

[2.0.0] - 2017-05-03

Added

  • Added new tslint rules from v5.0.0 and v5.1.0 releases
    • no-invalid-template-strings
    • no-sparse-arrays
    • no-unnecessary-callback-wrapper
    • no-reference-import
    • prefer-template
    • return-undefined (disabled)
  • Added new tslint-react rules from v2.6.0 release (#61)
    • jsx-no-bind

      Removed

  • no-unused-new has been removed from TSLint, logic moved to no-unused-expression. See TSLint v5.0.0 release

[1.5.0] - 2017-03-15

Added

  • Update tslint react to v2.5.0 #52
  • Created a custom rule for import-type-order #48

[1.4.0] - 2017-03-06

Added

  • Added new tslint rules from v4.4.0 and v4.5.0 releases (#33):
    • arrow-return-shorthand
    • await-promise
    • ban-types
    • match-default-export-name
    • newline-before-return
    • no-duplicate-super
    • no-floating-promises
    • no-import-side-effect
    • no-misused-new
    • no-non-null-assertion
    • no-unbound-method
    • no-unnecessary-initializer
    • no-unnecessary-qualifier
    • no-unsafe-any
    • prefer-function-over-method
    • prefer-method-signature
    • strict-type-predicates

[1.3.0] - 2017-03-01

Add

  • Add Custom rules: trailing-comma-interface, jsx-boolean-value (#34)

[1.2.0] - 2017-02-28

Add

  • Migrate code base to fully utilize Typescript (#31)

[1.1.5] - 2017-02-22

Changed

  • Add tslint-config-shopify/base, tslint-config-shopify/typed, and tslint-config-shopify/untyped configs (#29)

[1.1.4] - 2017-02-17

Changed

[1.1.3] - 2017-02-09

Changed

  • Update typedef rule (#23)

[1.1.2] - 2017-02-06

Changed

  • Update space-before-function-paren rule (#20)

[1.1.1] - 2017-02-01

Changed

[1.1.0] - 2017-01-31

Added

Changed

  • Updated triple-equals to include allow-null-check (#13)

[1.0.2] - 2017-01-23

Changed

  • Updated no-inferred-empty-object-type rule (#7)

[1.0.1] - 2017-01-23

Added

  • Initial release (#5)