eslint-disable-next-line Love The Way You Lie 2021-09-30 10:30 741阅读 0赞 ## 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\], 重启项目才会生效 ![在这里插入图片描述][watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTI5NzY4Nzk_size_16_color_FFFFFF_t_70] 重启项目后就在没有报错了。 [watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTI5NzY4Nzk_size_16_color_FFFFFF_t_70]: /images/20210923/63ea82ce21694364a64a25ae1201a080.png
还没有评论,来说两句吧...