• 我的vscode配置和eslint配置


    还是记一下记一下
    vscode 配置:

    {
        "editor.fontSize": 15,
        "editor.formatOnType": true,
        "workbench.colorCustomizations": {
            "colors": "#a33d02",
            "activityBar.background": "#a33d02",
            "list.list.activeSelectionBackground": "#ff3e03"
        },
        "workbench.iconTheme": "material-icon-theme",
        "editor.quickSuggestions": {
            "other": true,
            "comments": false,
            "strings": false
        },
        "terminal.integrated.fontSize": 15,
        "todo-tree.highlights.defaultHighlight": {
            "icon": "checklist",
            "type": "text",
            "foreground": "white",
            "background": "#ffab00",
            "borderRadius": "2px",
            "gutterIcon": true,
            "iconColour": "#ffab00"
        },
        "todo-tree.highlights.customHighlight": {
            "FIXME": {
                "background": "#FF69B4",
                "icon": "alert",
                "iconColour": "#FF69B4"
            }
        },
        "todo-tree.general.tags": [
            "BUG",
            "HACK",
            "FIXME",
            "TODO",
            "XXX",
            "[ ]",
            "[x]"
        ],
        "todo-tree.regex.regex": "(//|#|<!--|;|/\*|^|^\s*(-|\d+.))\s*($TAGS)",
        "javascript.updateImportsOnFileMove.enabled": "always",
        "files.eol": "
    ",
        "editor.formatOnSave": true,
        "javascript.format.enable": false,
        "eslint.alwaysShowStatus": true,
        "eslint.options": {
            "extensions": [
                ".html",
                ".js",
                ".jsx",
                ".vue"
            ]
        },
        "eslint.validate": [
            "javascript",
            "html",
            "vue"
        ],
        "editor.codeActionsOnSave": {
            "source.fixAll.eslint": true
        },
        "vetur.format.defaultFormatter.html": "js-beautify-html",
        "vetur.format.options.tabSize": 4,
        "vetur.format.options.useTabs": true,
        "vetur.validation.template": true,
        "vetur.format.defaultFormatterOptions": {
            "js-beautify-html": {
                "wrap_attributes": "force-aligned" //属性强制折行对齐
            },
            "prettier": {
                "singleQuote": true,
                "trailingComma": 1,
            }
        }
    }
    

    eslint配置:

    module.exports = {
        parser: 'vue-eslint-parser',
        env: {
            browser: true,
            es6: true,
            node: true
        },
        extends: 'semistandard',
        parserOptions: {
            parser: 'babel-eslint',
            sourceType: 'module',
            ecmaVersion: 8
        },
        rules: {
            'no-return-await': 'off',
            'camelcase': 2,
            'no-console': 'off',
            "no-tabs": 0,
            indent: [
                'error',
                4,
                {
                    SwitchCase: 1
                }
            ],
            'linebreak-style': [
                'error',
                'unix'
            ],
            quotes: [
                1,
                'single'
            ],
            semi: [
                1,
                'always'
            ],
            'no-console': 1,
            'space-before-function-paren': 0,
            'no-multiple-empty-lines': [
                'off'
            ]
        },
        globals: {
            $: true,
            __BROWSER__: true,
            __DEV__: true,
            __SIT__: true,
            __UAT__: true,
            __PROD__: true,
            __DEBUG_UAT__: true,
            __DEBUG_PROD__: true,
            __VPC__: true,
            describe: true,
            it: true,
            BMap: true,
            document: true,
            window: true
        }
    };
    

    eslint package.js

        "eslint": "^5.16.0",
        "babel-eslint": "^10.1.0",
        "eslint-plugin-vue": "^6.2.2",
        "eslint-config-semistandard": "^16.0.0",
        "eslint-config-standard": "^12.0.0",
        "eslint-plugin-import": "^2.16.0",
        "eslint-plugin-node": "^8.0.1",
        "eslint-plugin-promise": "^4.1.1",
        "eslint-plugin-standard": "^4.0.0"
    
  • 相关阅读:
    《Java数据结构与算法》笔记-CH4-5不带计数字段的循环队列
    《Java数据结构与算法》笔记-CH4-4循环队列
    效率方案:快速切换联调、测试、正式环境
    redis 安装、配置与测试
    计算机科学中的圣经
    自建主机
    正则表达式学习入门
    数据库查询语句缺失部分索引,引起的问题(20170209)
    redis 经验、问题以及其解决方案
    资讯周刊---20170210
  • 原文地址:https://www.cnblogs.com/JohannaFeng/p/15273234.html
Copyright © 2020-2023  润新知