not import and require some modules
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-zxlint
:
先安装esLint
$ npm install eslint-plugin-zxlint --save-dev
Add zxlint
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"zxlint"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"zxlint/rule-name": 2
}
}
{
"rules": {
"zxlint/no-import": ['error',{'files':['a.js','b.js'],'modules':['fs','http','events','os']}]
}
}
files receive a Array, modules too
a.js,b.js can import fs http events os modules, others can not
- Fill in provided rules here