.eslintrc.js 1.21 KB
module.exports = {
    "env": {
        "browser": true,
        "es6": true
    },
    "extends": [
        'standard',
        "eslint:recommended",
        "plugin:vue/essential",
        "plugin:@typescript-eslint/eslint-recommended",
    ],
    "globals": {
        "Atomics": "readonly",
        "SharedArrayBuffer": "readonly",
        "uni": true,
        "wx": true,
        "module": true
    },
    "parserOptions": {
        "ecmaVersion": 11,
        "parser": "@typescript-eslint/parser",
        "sourceType": "module"
    },
    "plugins": [
        "vue",
        "@typescript-eslint"
    ],
    "rules": {
        quotes: ['error', 'single'],
        'space-before-function-paren': 0,
        // 数组和对象键值对最后一个逗号, never参数:不能带末尾的逗号, always参数:必须带末尾的逗号,
        // always-multiline:多行模式必须带逗号,单行模式不能带逗号
        "comma-dangle": [2, "always-multiline"],
        // 控制逗号前后的空格
        "comma-spacing": [2, { "before": false, "after": true }],
        // 控制逗号在行尾出现还是在行首出现
        // http://eslint.org/docs/rules/comma-style
        "comma-style": [2, "last"],
    }
};