Shopify / tslint-config-shopify

Shopify’s TypeScript rules and configs.
https://www.npmjs.com/package/tslint-config-shopify
37 stars 3 forks source link

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

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