1- ## eslint-js简介
1+ ## eslint-js
22
3- eslint-js, 用于校验js和html中的js代码
3+ ESLint is an open source JavaScript linting utility.
44
5- [ eslint-js插件安装地址 ] ( https://ext.dcloud.net.cn/plugin?id=2037 )
5+ [ eslint-js Download ] ( https://ext.dcloud.net.cn/plugin?id=2037 )
66
7- ## 错误提示
7+ ## Error message
88
9- 如下图所示,当检查到错误时,会出现红色波浪线
9+ As shown in the figure below, when an error is detected, a red wavy line will appear.
1010
1111<img src =" /static/snapshots/tutorial/eslint-error.png " />
1212
13- ## 插件配置
13+ ## ESLint Plugin configuration
1414
15- 点击菜单【工具】【设置 -> 插件配置】【 eslint-js】,即可看到eslint-js相关配置。
15+ Click the menu [ Tools ] [ Settings -> Plugin ] [ eslint-js] , you can see the eslint-js related configuration.
1616
1717<img src =" /static/snapshots/tutorial/eslint-js.png " />
1818
@@ -26,7 +26,7 @@ eslint-js, 用于校验js和html中的js代码
26264 . 实时校验功能,默认未开启,需要手动开启此功能
2727
2828
29- ## eslint-js插件配置文件
29+ ## eslint-js config file
3030
3131eslint-js的配置文件为.eslintrc.js。
3232点击菜单工具 -> 插件配置 -> eslint-js -> .eslintrc.js,即可打开.eslintrc.js文件。
@@ -48,9 +48,9 @@ module.exports = {
4848
4949更多配置说明可以参考[ options] ( https://cn.eslint.org/docs/user-guide/configuring )
5050
51- ## 如何增加规则 ?
51+ ## How to add rules ?
5252
53- [ 官方规则列表 https ://cn.eslint.org/docs/rules/] ( https://cn.eslint.org/docs/rules/ )
53+ [ rules list: https ://cn.eslint.org/docs/rules/] ( https://cn.eslint.org/docs/rules/ )
5454
5555规则设置:
5656- "off" 或 0 - 关闭规则
@@ -69,13 +69,12 @@ module.exports = {
6969```
7070
7171
72- ## 示例:普通web项目
72+ ## Exampl:Html Project
7373
7474使用eslint, 校验多余的空格,并自动修复
7575
7676<img src =" /static/snapshots/tutorial/eslint-html-example.gif " style =" zoom : 90% ; border : 1px solid #eee ;" />
7777
78- 配置文件
7978
8079``` js
8180module .exports = {
@@ -99,7 +98,7 @@ module.exports = {
9998}
10099```
101100
102- ## 示例 :uni-app项目
101+ ## Example :uni-app project
103102
104103特别说明:
105104- vue文件,校验vue语法,需要安装` eslint-vue ` 插件,[ 插件地址] ( https://ext.dcloud.net.cn/plugin?id=2005 )
@@ -111,7 +110,7 @@ module.exports = {
111110<img src =" /static/snapshots/tutorial/eslint-uniapp-example.gif " style =" zoom : 90% ; border : 1px solid #eee ;" />
112111
113112
114- ## 示例 :vue-cli项目
113+ ## Example :vue-cli project
115114
116115vue-cli项目,如果使用项目下的配置规则,需要安装相关库、并在项目根目录创建` .eslintrc.js ` 文件
117116
@@ -124,7 +123,7 @@ npm install --save eslint eslint-plugin-vue eslint-plugin-html eslint-config-sta
124123```
125124
126125
127- .eslintrc.js配置文件示例
126+ ** .eslintrc.js example **
128127
129128``` js
130129module .exports = {
0 commit comments