@percolate/eslint-plugin
v1.1.25
Published
Percolate's ESlint rules and configs
Downloads
303
Keywords
Readme
@percolate/eslint-plugin
Percolate ESlint configs/rules optimized for TypeScript.
Installation
$ yarn add @percolate/eslint-plugin --dev
Usage
Node
// .eslintrc.js
module.exports = {
extends: ['plugin:@percolate/base', 'plugin:@percolate/node'],
rules: {
// configure rule
'@percolate/import-blacklist': [
'error',
[
{
import: 'underscore',
reason: 'Use lodash instead',
},
],
],
},
}
React
React, be sure to leverage the following config:
// .eslintrc.js
module.exports = {
extends: ['plugin:@percolate/base', 'plugin:@percolate/react'],
}
eslint-plugin-import
The rule import/no-unresolved
is on by default which means eslint-plugin-import has to be configured.
plugin:@percolate/node
configures eslint-import-resolver-node automatically.
Webpack
If you're using Webpack, you'll need to yarn add eslint-import-resolver-webpack --dev
and configure it:
// .eslintrc.js
module.exports = {
extends: ['plugin:@percolate/base', 'plugin:@percolate/react'],
settings: {
'import/resolver': {
'eslint-import-resolver-webpack': {
config: 'webpack.dev.config.js',
},
},
},
}