@swanide/eslint-plugin-swan
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

@swanide/eslint-plugin-swan

eslint plugin for swan program.

support codes:

  • swan Baidu smart program tpl language
  • sjs 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 fixed
  • recommended recommended lint rules
  • strict 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
    }
}

Supported Rules

Readme

Keywords

none

Package Sidebar

Install

npm i @swanide/eslint-plugin-swan

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

122 kB

Total Files

5

Last publish

Collaborators

  • liyang_npm
  • xhong
  • andrew703
  • maopy
  • kekee000