gatsby-plugin-tslint

0.0.2 • Public • Published

gatsby-plugin-tslint

Provides drop-in support for TSLint. Based off of gatsby-plugin-eslint.

NOTE: This plugin is currently only available for Gatsby v2.

Installation

  1. Install the gatsby-plugin-tslint plugin:

    npm install --save-dev gatsby-plugin-tslint

    or

    yarn add --dev gatsby-plugin-tslint

  2. Install TSLint and tslint-loader:

    npm install --save-dev tslint tslint-loader

    or

    yarn add --dev tslint tslint-loader

Usage

Add into gatsby-config.js.

// gatsby-config.js
 
module.exports = {
  plugins: [
    'gatsby-plugin-tslint'
  ]
}

If no options are specified, the plugin defaults to:

  1. Lint .ts and .tsx files.
  2. Exclude node_modules, .cache, and public folders from linting.

You can specify your own linting filetypes and exclusions:

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-plugin-tslint',
      options: {
        test: /\.ts$|\.tsx$/,
        exclude: /(node_modules|cache|public)/
      }
    }
  ]
}

Configuring TSLint

This plugin assumes that you use a tslint.json file to configure TSLint. Use those files to do all of your configuration.

Package Sidebar

Install

npm i gatsby-plugin-tslint

Weekly Downloads

257

Version

0.0.2

License

MIT

Unpacked Size

4.18 kB

Total Files

7

Last publish

Collaborators

  • tdharmon