【构建】配置ESLint
1.安装
ESLint 是一个语法规则和代码风格的检查工具,可以用来保证写出语法正确、风格统一的代码。
npm install eslint --save-dev
参考资料:eslint官网
2.配置
//package.json "eslintConfig": { //..... }
3.vue项目配置
- 1.安装
npm install eslint-plugin-vue -D//-D相当于--save-dev npm install eslint-plugin-node -D npm install eslint-config-mysticatea -D
- 2.配置
//package.json "eslintConfig": { "root": true, "parserOptions": { "ecmaVersion": 2017 }, "extends": [ "mysticatea", "mysticatea/modules", "plugin:vue/recommended" ], "plugins": [ "node" ], "env": { "browser": false }, "globals": { "applicationCache": false, "atob": false, "btoa": false, "console": false, "document": false, "location": false, "window": false }, "rules": { "node/no-extraneous-import": "error", "node/no-missing-import": "error", "node/no-unpublished-import": "error", "vue/html-indent": [ "error", 4 ], "vue/max-attributes-per-line": "off", "require-noopener": "error" } },
参考资料:eslint-plugin-vue
相关推荐
hualala 2020-06-13
tozeroblog 2020-06-09
tozeroblog 2020-06-08
hualala 2020-06-05
hualala 2020-05-29
www你所不知道的 2020-03-06
out有点man 2020-05-07
学知不足业精于勤 2020-04-30
hualala 2020-04-30
out有点man 2020-04-23
coderMozart 2020-04-20
coderMozart 2020-04-17
空谷足音 2020-03-06
tozeroblog 2020-03-06
tozeroblog 2020-02-21
tozeroblog 2020-02-17
hualala 2020-01-23