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
- Install the
gatsby-plugin-tslint
plugin:
`npm install --save-dev gatsby-plugin-tslint`
or
`yarn add --dev gatsby-plugin-tslint`
- Install TSLint and
tslint-loader
:
`npm install --save-dev tslint tslint-loader`
or
`yarn add --dev tslint tslint-loader`
Usage
Add intogatsby-config.js
.// gatsby-config.js
module.exports = {
plugins: [
'gatsby-plugin-tslint'
]
}
If no options are specified, the plugin defaults to:
- Lint
.ts
and.tsx
files. - Exclude
node_modules
,.cache
, andpublic
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 atslint.json
file to configure TSLint. Use those files to do all of your configuration.