webstrom启动项目报eslint-disable-next-line to ignore the next line错误
项目一直报这个错误,心里一直不爽,我知道这个是es6对语法过多检查的但是以前尝试去解决时候,就是不知道该怎么配置,今天启动又一次触发了我对这个提示不爽的神经,然后尝试去解决一下。
详细问题
在项目规则配置文件里面加 “indent”: [2, 4], 重启项目才会生效
Use /* eslint-disable */ to ignore all warnings in a file.
Module Warning (from ./node_modules/_eslint-loader@2.2.1@eslint-loader/index.js):
error: Expected indentation of 4 spaces but found 6 (indent) at src\router\index.js:16:1:
14 | component: () => import(/* webpackChunkName: "demo" */ '../views/Demo.vue')
15 | },
> 16 | {
| ^
17 | path: '/',
18 | name: 'demo',
19 | component: () => import(/* webpackChunkName: "demo" */ '../views/t.vue')
error: Expected indentation of 6 spaces but found 10 (indent) at src\router\index.js:17:1:
15 | },
16 | {
> 17 | path: '/',
| ^
18 | name: 'demo',
19 | component: () => import(/* webpackChunkName: "demo" */ '../views/src/tsent.vue')
20 | }
error: Expected indentation of 6 spaces but found 10 (indent) at src\router\index.js:19:1:
17 | path: '/',
18 | name: 'demo',
> 19 | component: () => import(/* webpackChunkName: "demo" */ '../views/src/tssda/manage/pageConfigurationManagement.vue')
| ^
20 | }
21 | ]
22 | })
error: Expected indentation of 4 spaces but found 6 (indent) at src\router\index.js:20:1:
18 | name: 'demo',
19 | component: () => import(/* webpackChunkName: "demo" */ '../views/src/tssda/manage/pageConfigurationManagement.vue')
> 20 | }
| ^
21 | ]
22 | })
23 |
5 errors found.
5 errors potentially fixable with the `--fix` option.
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
App running at:
- Local: http://localhost:8080
- Network: http://localhost:8080
Note that the development build is not optimized.
To create a production build, run npm run build.
解决方法
在项目规则配置文件里面加 “indent”: [2, 4], 重启项目才会生效
重启项目后就在没有报错了。