vue cli3 项目中.eslintrc.js 、prettier.config.js、以及本地eslint-settings.json配置 跟后续vscode 统一配置

  • .eslintrc.js
module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ['plugin:vue/essential', 'eslint:recommended', 'plugin:prettier/recommended'],
  parserOptions: {
    parser: '@babel/eslint-parser'
  },
  rules: {
    'generator-star-spacing': 'off',
    'space-before-function-paren': 0,
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'prettier/prettier': [
      'error',
      {
        endOfLine: 'auto'
      }
    ],
    'vue/multi-word-component-names': 'off'
  }
}

prettier.config.js

module.exports = {
  printWidth: 120,
  tabWidth: 2,
  // useTabs: false,
  semi: false,
  singleQuote: true,
  // quoteProps: 'as-needed',
  // jsxSingleQuote: false,
  trailingComma: 'none',
  // bracketSpacing: true,
  arrowParens: 'always' //始终将箭头函数用()包裹
  // endOfLine: 'lf'
}

本地settings.json

// {
//     "files.associations": {
//         "*.cjson": "jsonc",
//         "*.wxss": "css",
//         "*.wxs": "javascript"
//     },
//     "emmet.includeLanguages": {
//         "wxml": "html"
//     },
//     "minapp-vscode.disableAutoConfig": true,
//     "workbench.colorTheme": "Monokai Pro (Filter Octagon)",
//     "workbench.iconTheme": "Monokai Pro (Filter Octagon) Icons",
//     "window.zoomLevel": 0,
//     "editor.fontSize": 18,
//     "files.autoSave": "afterDelay"
// }
{
    "editor.quickSuggestions": {
        "strings": true
    },
    "eslint.validate": [
        "javascript",
        {
            "language": "vue",
            "autoFix": true
        },
        "html",
        "vue"
    ],
    "explorer.confirmDelete": false,
    //"html.format.wrapAttributes": "preserve",
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_line_length": 200,
            "wrap_attributes": "auto",
            "end_with_newline": false,
        }
    },
    "editor.codeActionsOnSave": {

        "source.fixAll.eslint": true
    },
    "editor.fontSize": 18,
    "editor.accessibilityPageSize": 19,
    "files.associations": {
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "emmet.includeLanguages": {
        "wxml": "html"
    },
    "minapp-vscode.disableAutoConfig": true,
    "rest-client.excludeHostsForProxy": [],
    "css.fileExtensions": [
        "css",
        "scss"
    ],
    "eslint.nodePath": "",
    "search.followSymlinks": false,
    "git.confirmSync": false,
    "eslint.codeAction.showDocumentation": {
    
    
    
    
    
        "enable": true
    },
    "editor.tabSize": 2,
    "eslint.alwaysShowStatus": true,
    "leek-fund.fundSort": -2,
    "cssrem.rootFontSize": 50,
    "leek-fund.statusBarStock": [
        "sh000001"
    ],
    "css.styleSheets": [
    
    ],
    "eslint.nodeEnv": "Code Cache/",
    "diffEditor.ignoreTrimWhitespace": false,
    "vetur.ignoreProjectWarning": true,
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "leek-fund.funds": [
        []
    ],
    "eslint.rules.customizations": [
    
    ],
    "leek-fund.stocks": [
        "sh000001",
        "sh000300",
        "sh000016",
        "sh000688",
        "hk03690",
        "hk00700",
        "usr_ixic",
        "usr_dji",
        "usr_inx",
        "nf_ZC0",
        "nf_IC0",
        "hf_OIL",
        "hf_CHA50CFD",
        "sz000333"
    ],
    "files.autoSave": "afterDelay",
    "explorer.confirmDragAndDrop": false,
    "eslint.codeActionsOnSave.rules": null
}

vscode 共享配置
在这里插入图片描述

  • 项目推荐安装插件
    在这里插入图片描述

  • settings.json 把上面本地的 settings.json 配置到项目中即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值