换电脑重新整理了一版vscode配置

settings.json

{
    // 換行
    "editor.wordWrap": "on",
    // 是否允许自定义的snippet片段提示
    "editor.snippetSuggestions": "top",
    // vscode默认启用了根据文件类型自动设置tabsize的选项 不检查缩进,保存后统一按设置项來设置 false
    "editor.detectIndentation": false,
    // 重新设定tabsize 代码缩进修改成 2 个空格
    "editor.tabSize": 2,
    // #每次保存的时候将代码按照 eslint 格式进行修复 true
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    // #每次保存的时候自动格式化(true / false)
    "editor.formatOnSave": true,
    "editor.formatOnType": false, //(true / false)
    "editor.formatOnPaste": false,
    // #每次保存的时候将代码按eslint格式进行修复 使用eslint 風格使用standard 進行代碼規則限制
    "editor.fontWeight": "200",
    "workbench.activityBar.visible": true,
    "workbench.statusBar.visible": true,
    "workbench.colorTheme": "Default Dark+",
    "workbench.editorAssociations": {
        "*.vsd": "default"
    },
    // "workbench.colorTheme": "SynthWave '84",
    // "workbench.iconTheme": "vscode-icons-mac",
    "team.showWelcomeMessage": false,
    "editor.renderWhitespace": "boundary",
    "editor.cursorBlinking": "smooth",
    "editor.minimap.enabled": true,
    "editor.minimap.renderCharacters": false,
    "window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
    "editor.codeLens": true,
    // eslint 代码自动检查相关配置
    "eslint.enable": true,
    "eslint.run": "onType",
    "eslint.options": {
        "configFile": "D:/.eslintrc.js",
        "plugins": ["html"],
        "extensions": [".js", ".vue"]
    },
    // 添加 vue 支持
    "eslint.validate": ["javascript", "javascriptreact", "html", "vue"],
    // #让prettier使用eslint的代码格式进行校验 true
    "prettier.eslintIntegration": true,
    // #去掉代码结尾的分号(true / false)
    "prettier.semi": true,
    // #使用单引号替代双引号
    "prettier.singleQuote": true,
    "prettier.tabWidth": 4,
    // #让函数(名)和后面的括号之间加个空格 true
    "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
    // #这个按用户自身习惯选择 html格式化
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    // #让vue中的js按"prettier"格式进行格式化
    "vetur.format.defaultFormatter.js": "prettier",
    // #让vue中的js按编辑器自带的ts格式进行格式化
    // "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            // #vue组件中html代码格式化样式
            "wrap_attributes": "force-aligned", // 也可以设置为"auto", 效果会不一样
            "wrap_line_length": 200,
            "end_with_newline": false,
            "semi": false,
            "singleQuote": true
        },
        "prettier": {
            "semi": false,
            "singleQuote": true
        }
    },
    "[jsonc]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    // 格式化stylus, 需安装Manta's Stylus Supremacy插件
    "stylusSupremacy.insertColons": false, // 是否插入冒号
    "stylusSupremacy.insertSemicolons": false, // 是否插入分号
    "stylusSupremacy.insertBraces": false, // 是否插入大括号
    "stylusSupremacy.insertNewLineAroundImports": false, // import之后是否换行
    "stylusSupremacy.insertNewLineAroundBlocks": false, // 两个选择器中是否换行
    "prettier.useTabs": true,
    "explorer.confirmDelete": false,
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[json]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "diffEditor.ignoreTrimWhitespace": false,
    "[javascriptreact]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "leek-fund.fundSort": 2, // 两个选择器中是否换行
    // "terminal.integrated.shell.osx": "zsh",

    "files.associations": {
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "emmet.includeLanguages": {
        "wxml": "html"
    },
    "minapp-vscode.disableAutoConfig": true,
    "window.menuBarVisibility": "visible",
    "git.autofetch": true,
    "git.confirmSync": false,
    "git.enableSmartCommit": true,
    "git.ignoreLegacyWarning": true,
    // "git.path": "D:/git/Git/mingw64/bin/git.exe",
    "liveServer.settings.donotShowInfoMsg": true,
    "[html]": {
        "editor.defaultFormatter": "vscode.html-language-features"
        // "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "javascript.updateImportsOnFileMove.enabled": "always",
    // 字體大小
    "editor.fontSize": 15,
    "files.exclude": {
        "node_modules/": true
    },
    // 設置行高
    "editor.lineHeight": 20,
    "search.followSymlinks": false,
    "seetingsSync.ignoredExtensions": [],
    "workbench.sideBar.location": "left",
    "vscode_custom_css.policy": true,
    "vscode_custom_css.imports": [
        "file:///C:/vscode-transparent/synthwave84.css",
        "file:///C:/vscode-transparent/toolbar.css",
        "file:///C:/vscode-transparent/vscode-vibrancy-style.css",
        "file:///C:/vscode-transparent/enable-electron-vibrancy.js"
    ],
    // 高亮的颜色,emm暂时只支持这样写
    "wxmlConfig.activeColor": {
        "color": "#e5c07b"
    },
    // 是否禁用高亮组件
    "wxmlConfig.activeDisable": false,
    // 是否开启保存自动格式化
    "wxmlConfig.onSaveFormat": false,
    "wxmlConfig.format": {
        "brace_style": "collapse",
        "end_with_newline": false,
        "indent_char": "",
        "indent_handlebars": false,
        "indent_inner_html": false,
        "indent_scripts": "keep",
        "indent_size": 2,
        "indent_with_tabs": false,
        "max_preserve_newlines": 1,
        "preserve_newlines": false,
        "wrap_attributes": "force-expand-multiline"
    },
    // 高亮所忽略的组件数组
    "wxmlConfig.tagNoActiveArr": [
        "view",
        "button",
        "text",
        "icon",
        "image",
        "navigator",
        "block",
        "input",
        "template",
        "form",
        "camera",
        "textarea"
    ],
    "zenMode.restore": true,
    "breadcrumbs.enabled": true,
    // "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    // "[wxml]": {
    //     "editor.defaultFormatter": "qiu8310.minapp-vscode"
    // },
    "gitlens.advanced.messages": {
        "suppressLineUncommittedWarning": true
    },
    "javascript.format.placeOpenBraceOnNewLineForControlBlocks": true,
    "vsicons.presets.hideFolders": true,
    "editor.cursorStyle": "line-thin",
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "terminal.integrated.rendererType": "dom",
    "terminal.integrated.tabs.enabled": true,
    "vscode_vibrancy.opacity": 1,
    "npm.fetchOnlinePackageInfo": false,
    "tabnine.experimentalAutoImports": true,
    "[vue]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "files.autoSave": "onFocusChange", // "afterDelay"
    "projectManager.hg.maxDepthRecursion": 1,
    "projectManager.vscode.baseFolders": ["/Users/jimmy/Desktop"],
    "projectManager.any.baseFolders": ["/Users/jimmy/Desktop/PROJECT"],
    "projectManager.any.maxDepthRecursion": 1,
    "[scss]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    // "sonarlint.rules": {},
    // "sonarlint.output.showVerboseLogs": true,
    "workbench.colorTheme": "One Dark Pro",
    "window.zoomLevel": 1,
    "liveServer.settings.port": 0,
    "diffEditor.ignoreTrimWhitespace": false,
    "editor.language.brackets": [],
    "settingsSync.ignoredExtensions": [],
    "git.autofetch": true,
    // 注释配置
    "fileheader.configObj": {
        "createFileTime": true,
        "language": {
            "c/cpp/h/hpp/java": {
                "head": "/**\r\n****************************************************************************************",
                "middle": " * @",
                "end": "****************************************************************************************\r\n*/"
            },
            "languagetest": {
                "head": "/$$",
                "middle": " $ @",
                "end": " $/",
                "functionSymbol": {
                    "head": "/** ",
                    "middle": " * @",
                    "end": " */"
                },
                "functionParams": "js"
            }
        },
        "autoAdd": false,
        "autoAddLine": 100,
        "autoAlready": true,
        // 默认注释  没有匹配到注释符号的时候使用。
        "annotationStr": {
            "head": "/*",
            "middle": " * @",
            "end": " */",
            "use": false
        },
        "headInsertLine": {
            "php": 2,
            "sh": 2
        },
        "beforeAnnotation": {
            "文件后缀": "该文件后缀的头部注释之前添加某些内容"
        },
        "afterAnnotation": {
            "文件后缀": "该文件后缀的头部注释之后添加某些内容"
        },
        "specialOptions": {
            "param": "param[in]"
        },
        "switch": {
            "newlineAddAnnotation": true
        },
        "supportAutoLanguage": [],
        "prohibitAutoAdd": ["json"],
        "folderBlacklist": ["node_modules", "文件夹禁止自动添加头部注释"],
        "prohibitItemAutoAdd": [
            "项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
        ],
        "moveCursor": true,
        "dateFormat": "YYYY-MM-DD HH:mm:ss",
        "atSymbol": ["@", "@"],
        "atSymbolObj": {
            "文件后缀": ["头部注释@符号", "函数注释@符号"]
        },
        "colon": [": ", ": "],
        "colonObj": {
            "文件后缀": ["头部注释冒号", "函数注释冒号"]
        },
        "filePathColon": "路径分隔符替换",
        "showErrorMessage": false,
        "writeLog": false,
        "wideSame": false,
        "wideNum": 13,
        "functionWideNum": 0,
        "CheckFileChange": false,
        "createHeader": true,
        "useWorker": false,
        "designAddHead": false,
        "headDesignName": "random",
        "headDesign": false,
        "cursorModeInternalAll": {},
        "openFunctionParamsCheck": true,
        "functionParamsShape": "no type",
        "typeParamOrder": "param",
        "customHasHeadEnd": {},
        "throttleTime": 60000
    },
    "fileheader.customMade": {
        "FilePath": "only file name",
        "Author": "Vivian L_qirui@163.com",
        "Date": "Do not edit",
        "LastEditors": "",
        "LastEditTime": "Do not Edit",
        "custom_string_obkoro1_copyright": "Copyright: ${now_year} xxxTech CO.,LTD. All Rights Reserved.", // 版权声明 保留所有权利 自动替换年份
        "Descripttion": ""
    },
    "fileheader.cursorMode": {
        "brief": "",
        "param": " ",
        "return": ""
    },
    // 背景图
    "background.enabled": true,
    "background.useDefault": false,
    "background.customImages": [
        "file:///E:/myphoto/q.jpg",
        "file:///E:/MyPhoto/yjlq.jpg",
        "file:///E:/MyPhoto/背56.png",
        "file:///E:/MyPhoto/背55.png"
        // "file:///E:/MyPhoto/dance.jpg",
    ],
    "background.style": {
        "content": "''",
        "pointer-events": "none",
        "position": "absolute",
        "z-index": "99999",
        "width": "100%",
        "height": "100%",
        "background-position": "center",
        "background-repeat": "no-repeat",
        "background-size": "100%,100%",
        "opacity": 0.1
    },
    "powermode.maxExplosions": 5,
    "powermode.shake.intensity": 0,
    "powermode.explosions.size": 9,
    "powermode.explosions.gifMode": "restart",
    "powermode.enabled": true,
    "powermode.presets": "fireworks",
    "powermode.combo.counterEnabled": "hide",
    "powermode.combo.location": "statusbar",
    "indentRainbow.colors": [
        "rgba(16,16,16,0.1)",
        "rgba(16,16,16,0.2)",
        "rgba(16,16,16,0.3)",
        "rgba(16,16,16,0.4)",
        "rgba(16,16,16,0.5)",
        "rgba(16,16,16,0.6)",
        "rgba(16,16,16,0.7)",
        "rgba(16,16,16,0.8)",
        "rgba(16,16,16,0.9)",
        "rgba(16,16,16,1.0)"
    ],
    "workbench.colorTheme": "One Dark Pro",
    "window.zoomLevel": 1,
    "liveServer.settings.port": 0,
    "diffEditor.ignoreTrimWhitespace": false
}

.eslintrc.js

module.exports = {
    root: true, // 停止在父级目录中寻找
    env: {
        es6: true, // 启用 ES6 语法支持以及新的 ES6 全局变量或类型
        node: true, // Node.js 全局变量和 Node.js 作用域
    },
    extends: ['plugin:vue/essential', '@vue/standard'],
    rules: {
        'no-alert': 0, // 禁止使用alert confirm prompt
        'no-console': 0, // 禁止使用console
        'no-debugger': 0, // 禁止使用debugger
        'prefer-const': 0, // 建议使用 const 关闭
        'no-dupe-keys': 2, // 在创建对象字面量时不允许键重复 {a:1,a:1}
        'no-dupe-args': 2, // 函数参数不能重复
        'no-duplicate-imports': [
            1,
            {
                includeExports: true,
            },
        ], // 不允许重复导入

        'no-duplicate-case': 2, // switch中的case标签不能重复
        'padded-blocks': 0, // 块语句内行首行尾是否要空行
        'space-after-keywords': [0, 'always'], // 关键字后面是否要空一格
        'space-before-blocks': [0, 'always'], // 不以新行开始的块{前面要不要有空格
        'space-before-function-paren': [0, 'always'], // 函数定义时括号前面要不要有空格
        'space-in-parens': [0, 'never'], // 小括号里面要不要有空格
        'space-infix-ops': 0, // 中缀操作符周围要不要有空格
        eqeqeq: 0, // 必须使用全等
        'no-var': 0, // 禁用var,用let和const代替
        'no-inline-comments': 0, // 禁止行内备注
        indent: 0,
        'vue/script-indent': 0,
        'vue/require-prop-type-constructor': 0,
        'vue/no-use-v-if-with-v-for': 0,
        'no-trailing-spaces': 0, // 一行结束后面不要有空格
        'no-multiple-empty-lines': 0, // [1, {"max": 2}],空行最多不能超过2行
        'no-extra-boolean-cast': 0, // 禁止不必要的bool转换
        'valid-jsdoc': 0,
        'one-var': 0, // 连续声明
        semi: 0, // 语句强制分号结尾
        'semi-spacing': [0, { before: false, after: true }], // 分号前后空格
        'no-new': 0, // 禁止在使用new构造一个实例后不赋值
        'no-extra-semi': 0, // 禁止多余的冒号
        'keyword-spacing': 0,
        'arrow-parens': 0, // 箭头函数用小括号括起来 - 关闭
        'generator-star-spacing': 0, // 生成器函数*的前后空格
        'no-mixed-operators': 0,
        'eol-last': 0, // 文件以单一的换行符结束 - 关闭
        'object-curly-spacing': 0, // 大括号内是否允许不必要的空格
        'no-callback-literal': 0,
        'multiline-ternary': 0,
    },
    parserOptions: {
        parser: 'babel-eslint',
    },
    overrides: [
        {
            files: [
                '**/__tests__/*.{j,t}s?(x)',
                '**/tests/unit/**/*.spec.{j,t}s?(x)',
            ],
            env: {
                jest: true,
            },
        },
    ],
};

 

posted @ 2023-03-03 21:00  fiamme  阅读(76)  评论(0编辑  收藏  举报