@swanide/eslint-plugin-swan
v0.0.3
Published
swan eslint plugin
Downloads
4
Keywords
Readme
@swanide/eslint-plugin-swan
eslint plugin for swan program.
support codes:
swan
Baidu smart program tpl languagesjs
JavasSript code
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install @swanide/eslint-plugin-swan
:
$ npm install @swanide/eslint-plugin-swan --save-dev
Bin
Install @swanide/eslint-plugin-swan
global.
$ npm install eslint @swanide/eslint-plugin-swan -g
Use swan-lint
to lint mini program project.
$ swan-lint .
Use different lint level.
$ SWAN_LINT_CONFIG=[base|recommended|strict] swan-lint .
base
basic lint rules, must be fixedrecommended
recommended lint rulesstrict
strict lint rules
Usage
Add swan
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"@swanide/swan"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@swanide/swan/valid-bind": 2
}
}