You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ESLint comes with a large number of built-in rules and you can add more rules through plugins. You can modify which rules your project uses either using configuration comments or configuration files. To change a rule setting, you must set the rule ID equal to one of these values:
57
+
58
+
- "off" or 0 - turn the rule off
59
+
- "warn" or 1 - turn the rule on as a warning (doesn't affect exit code)
60
+
- "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
1. For the vue-cli project, if you use the configuration rules under the project, you need to install the relevant libraries and create the `.eslintrc.js` file in the project root directory
119
+
2. The `eslint rules` under the project will override the rules in the HBuilderX editor `eslint plugin`
120
+
3. vue file, verify vue syntax, need to install `eslint-vue` plugin, [plugin address](https://ext.dcloud.net.cn/plugin?id=2005)
1.To use this function, you must install [eslint-js](https://ext.dcloud.net.cn/plugin?id=2037) and [eslint-vue](https://ext.dcloud.net.cn/plugin?id=2005) plugin
24
+
2.The `vue-cli` project needs to install the eslint library and configure the eslint rules.
25
+
3.If the above conditions are met, when the code is written and saved, if there is an error in the code, it will be automatically repaired;
26
+
4.Real-time verification function, not enabled by default, you need to manually enable this function
27
27
28
-
## eslint-vue config file
28
+
## HBuilderX eslint-vue configuration files
29
29
30
30
The configuration file of eslint-vue is `.eslintrc.js`.
31
31
@@ -48,10 +48,12 @@ More configuration instructions can refer to [options](http://eslint.org/docs/us
- "warn" or 1 - open rules,使用警告级别的错误:warn (不会导致程序退出)
54
-
- "error" or 2 - open rules,使用错误级别的错误:error (当被触发的时候,程序会退出)
51
+
ESLint comes with a large number of built-in rules and you can add more rules through plugins. You can modify which rules your project uses either using configuration comments or configuration files. To change a rule setting, you must set the rule ID equal to one of these values:
52
+
53
+
- "off" or 0 - turn the rule off
54
+
- "warn" or 1 - turn the rule on as a warning (doesn't affect exit code)
55
+
- "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
56
+
55
57
56
58
Modify the .eslintrc.js file and add rules, such as:
57
59
@@ -122,33 +124,31 @@ Modify the .eslintrc.js file and add rules, such as:
1. For the vue-cli project, if you use the configuration rules under the project, you need to install the relevant libraries and create the `.eslintrc.js` file in the project root directory
143
+
2.The `eslint rules` under the project will override the rules in the HBuilderX editor `eslint plugin`
144
+
3. vue file, verify vue syntax, need to install `eslint-vue` plugin, [plugin address](https://ext.dcloud.net.cn/plugin?id=2005)
0 commit comments