eslint-plugin-ir
v0.2.14
Published
lint for runcook-ir
Downloads
2
Maintainers
Readme
eslint-plugin-ir
An eslint plugin for Runcook-ir
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-ir
:
npm install eslint-plugin-ir --save-dev
Usage
- you can using
recommended
config to enable all rules, so you don't have to enable them all manually (recommend)
//.eslintrc.js
// in your config file, you shoule add these two config
{
plugins: ['ir'],
extends: ['plugin:ir/recommended'],
}
or if you using @iceworks/spec
, you can config like this
const { getESLintConfig } = require('@iceworks/spec');
module.exports = getESLintConfig('rax', {
plugins: ['ir'],
extends: ['plugin:ir/recommended'],
});
- config manually
Add ir
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"ir"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"ir/rule-name": 2
}
}
enable auto fix
- ensure you have installed eslint plugin
- open
setting.json
, put this config in your setting
command(ctrl) + shift + p
- typing
setting.json
then enter the first menu
// eslint
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
Supported Rules
you can check all rules here