eslint-plugin-hsl v1.0.4
ESLint-plugin-Hsl
自定义的一套 ESlint 规则,包括 Vue, React,TypeScript,完善中...
🔨 Installation
Install ESLint either locally or globally. (Note that locally, per project, is strongly preferred)
$ npm install eslint --save-devIf you installed ESLint globally, you have to install React plugin globally too. Otherwise, install it locally.
$ npm install eslint-plugin-hsl --save-dev⚙️ Configuration
Configure in the Vue project:
"extends": [
"eslint:recommended",
"plugin:hsl/vue"
]Configure in the React project:
"extends": [
"eslint:recommended",
"plugin:hsl/react"
]Configure in the TypeScript project:
"extends": [
"eslint:recommended",
"plugin:hsl/typescript"
]If you do not use a preset you will need to specify individual rules and add extra configuration.
Add "hsl" to the plugins section.
{
"plugins": [
"hsl"
]
}❓ FAQ
What is the "Use the latest vue-eslint-parser" error?
The most rules of eslint-plugin-vue require vue-eslint-parser to check <template> ASTs.
Make sure you have one of the following settings in your .eslintrc:
"extends": ["plugin:vue/recommended"]"extends": ["plugin:vue/base"]
If you already use other parser (e.g. "parser": "babel-eslint"), please move it into parserOptions, so it doesn't collide with the vue-eslint-parser used by this plugin's configuration:
- "parser": "babel-eslint",
"parserOptions": {
+ "parser": "babel-eslint",
"ecmaVersion": 2017,
"sourceType": "module"
}🔑 License
ESLint-plugin-Hsl is licensed under the MIT License.