0.0.2 • Published 7 years ago
gatsby-plugin-tslint v0.0.2
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-tslintplugin:npm install --save-dev gatsby-plugin-tslintor
yarn add --dev gatsby-plugin-tslint
Install TSLint and
tslint-loader:npm install --save-dev tslint tslint-loaderor
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:
- Lint
.tsand.tsxfiles. - Exclude
node_modules,.cache, andpublicfolders 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.