vsCode保存的时候按照eslint 的编码规范==========亲测vue 好用
2020-01-14 21:18
405 查看
vs code 找setting文件====ctrl+shift+p 搜setting.json
setting.json 文件配置
{ "editor.tabSize": 2, "files.associations": { "*.vue": "vue" }, "eslint.autoFixOnSave": true, "eslint.options": { "extensions": [ ".js", ".vue" ] }, "eslint.validate": [ "javascript",{ "language": "vue", "autoFix": true },"html", "vue" ], "search.exclude": { "**/node_modules": true, "**/bower_components": true, "**/dist": true }, "emmet.syntaxProfiles": { "javascript": "jsx", "vue": "html", "vue-html": "html" }, "git.confirmSync": false, "window.zoomLevel": 0, "editor.renderWhitespace": "boundary", "editor.cursorBlinking": "smooth", "editor.minimap.enabled": true, "editor.minimap.renderCharacters": false, "editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'", "window.title": "${dirty}${activeEditorMedium}${separator}${rootName}", "editor.codeLens": true, "editor.snippetSuggestions": "top", }
.eslintrc.js===============
// https://eslint.org/docs/user-guide/configuring
module.exports = { root: true, parser: 'babel-eslint', parserOptions: { sourceType: 'module' }, env: { browser: true, }, // https://github.com/standard/standard/blob/master/docs/RULES-en.md extends: 'standard', // required to lint *.vue files plugins: [ 'html' ], // add your custom rules here rules: { "space-before-function-paren": 0, // allow async-await 'generator-star-spacing': 'off', // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' } }
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- vscode保存代码,自动按照eslint规范格式化代码设置
- Vue Vue-cli Eslint 实现在vscode里保存后代码自动格式化
- vue项目eslint环境配置与vscode配置eslint
- VSCode使用之Vue工程配置eslint
- vscode eslint配置vue遇到的问题
- vscode自动修复eslint规范的插件及配置
- Vue-cli Eslint在vscode里代码自动格式化的方法
- vue+eslint+vscode配置教程
- vscode中配置eslint
- 挖坑指南:ESLint + VS Code自动格式化代码
- VScode关于Eslint的配置
- vs code-quasar 编写代码的时候,格式规范报错
- vscode js自动检测eslint
- 使用vscode开发vue项目时候一直报错 '}' expected.Vetur(1005),遇到这种问题怎么解决,网上查了好多资料都没用
- VScode代码格式化后不符合ESLint风格问题处理
- eslint 在VSCode中不能使用
- vsCode 设置vue 保存自动格式化代码
- VsCode(Visual Studio Code)格式化代码符合EsLint
- vscode eslint 配置
- vscode安装和配置ESLint