Update eslint to use eslint-plugin-vue for vue files instead of eslint-plugin-html

This commit is contained in:
Kevin MacMartin 2018-11-12 15:03:34 -05:00
parent 8e5e06cc8c
commit 891eaba8c3
2 changed files with 128 additions and 107 deletions

View file

@ -11,6 +11,6 @@ Configurations for linters used at WNY
## Javascript ## Javascript
* Linter: [eslint](https://github.com/eslint/eslint) * Linter: [eslint](https://github.com/eslint/eslint)
* Modules: [babel-eslint](https://github.com/babel/babel-eslint), [eslint-plugin-html](https://github.com/BenoitZugmeyer/eslint-plugin-html) * Modules: [babel-eslint](https://github.com/babel/babel-eslint), [eslint-plugin-vue@next](https://github.com/vuejs/eslint-plugin-vue)
* Config: `eslintrc` * Config: `eslintrc`
* Install: `~/.eslintrc` * Install: `~/.eslintrc`

233
eslintrc
View file

@ -1,108 +1,129 @@
{ {
"parser": "babel-eslint", "parserOptions": {
"parserOptions": { "parser": "babel-eslint",
"ecmaVersion": 6, "ecmaVersion": 6,
"sourceType": "module" "sourceType": "module"
}, },
"plugins": [ "html" ],
"rules": { "extends": [
"strict": 0, "plugin:vue/essential"
"comma-dangle": [ "warn" ], ],
"no-cond-assign": [ "warn" ],
"no-dupe-args": [ "error" ], "rules": {
"no-dupe-keys": [ "error" ], "strict": 0,
"no-duplicate-case": [ "error" ], "comma-dangle": [ "warn" ],
"no-empty": [ "warn" ], "no-cond-assign": [ "warn" ],
"no-empty-character-class": [ "warn" ], "no-dupe-args": [ "error" ],
"no-ex-assign": [ "error" ], "no-dupe-keys": [ "error" ],
"no-extra-boolean-cast": [ "warn" ], "no-duplicate-case": [ "error" ],
"no-extra-parens": [ "warn" ], "no-empty": [ "warn" ],
"no-extra-semi": [ "warn" ], "no-empty-character-class": [ "warn" ],
"no-func-assign": [ "error" ], "no-ex-assign": [ "error" ],
"no-invalid-regexp": [ "error" ], "no-extra-boolean-cast": [ "warn" ],
"no-irregular-whitespace": [ "error" ], "no-extra-parens": [ "warn" ],
"no-negated-in-lhs": [ "warn" ], "no-extra-semi": [ "warn" ],
"no-obj-calls": [ "error" ], "no-func-assign": [ "error" ],
"no-regex-spaces": [ "warn" ], "no-invalid-regexp": [ "error" ],
"no-sparse-arrays": [ "warn" ], "no-irregular-whitespace": [ "error" ],
"no-unexpected-multiline": [ "warn" ], "no-negated-in-lhs": [ "warn" ],
"no-unreachable": [ "warn" ], "no-obj-calls": [ "error" ],
"no-unsafe-finally": [ "warn" ], "no-regex-spaces": [ "warn" ],
"use-isnan": [ "warn" ], "no-sparse-arrays": [ "warn" ],
"valid-typeof": [ "error" ], "no-unexpected-multiline": [ "warn" ],
"curly": [ "warn" ], "no-unreachable": [ "warn" ],
"dot-location": [ "warn", "property" ], "no-unsafe-finally": [ "warn" ],
"eqeqeq": [ "warn", "smart" ], "use-isnan": [ "warn" ],
"guard-for-in": [ "warn" ], "valid-typeof": [ "error" ],
"no-alert": [ "warn" ], "curly": [ "warn" ],
"no-case-declarations": [ "warn" ], "dot-location": [ "warn", "property" ],
"no-div-regex": [ "warn" ], "eqeqeq": [ "warn", "smart" ],
"no-empty-function": [ "warn" ], "guard-for-in": [ "warn" ],
"no-empty-pattern": [ "warn" ], "no-alert": [ "warn" ],
"no-eq-null": [ "warn" ], "no-case-declarations": [ "warn" ],
"no-eval": [ "warn" ], "no-div-regex": [ "warn" ],
"no-extend-native": [ "warn" ], "no-empty-function": [ "warn" ],
"no-extra-bind": [ "warn" ], "no-empty-pattern": [ "warn" ],
"no-extra-label": [ "warn" ], "no-eq-null": [ "warn" ],
"no-floating-decimal": [ "warn" ], "no-eval": [ "warn" ],
"no-implicit-coercion": [ "warn" ], "no-extend-native": [ "warn" ],
"no-implied-eval": [ "warn" ], "no-extra-bind": [ "warn" ],
"no-iterator": [ "error" ], "no-extra-label": [ "warn" ],
"no-lone-blocks": [ "warn" ], "no-floating-decimal": [ "warn" ],
"no-loop-func": [ "warn" ], "no-implicit-coercion": [ "warn" ],
"no-multi-spaces": [ "warn" ], "no-implied-eval": [ "warn" ],
"no-multi-str": [ "warn" ], "no-iterator": [ "error" ],
"no-native-reassign": [ "warn" ], "no-lone-blocks": [ "warn" ],
"no-new-func": [ "warn" ], "no-loop-func": [ "warn" ],
"no-new-wrappers": [ "warn" ], "no-multi-spaces": [ "warn" ],
"no-octal": [ "warn" ], "no-multi-str": [ "warn" ],
"no-octal-escape": [ "warn" ], "no-native-reassign": [ "warn" ],
"no-param-reassign": [ "warn" ], "no-new-func": [ "warn" ],
"no-proto": [ "error" ], "no-new-wrappers": [ "warn" ],
"no-redeclare": [ "warn", { "builtinGlobals": true } ], "no-octal": [ "warn" ],
"no-return-assign": [ "warn" ], "no-octal-escape": [ "warn" ],
"no-script-url": [ "warn" ], "no-param-reassign": [ "warn" ],
"no-self-assign": [ "warn" ], "no-proto": [ "error" ],
"no-self-compare": [ "warn" ], "no-redeclare": [ "warn", { "builtinGlobals": true } ],
"no-sequences": [ "warn" ], "no-return-assign": [ "warn" ],
"no-throw-literal": [ "warn" ], "no-script-url": [ "warn" ],
"no-unused-expressions": [ "warn" ], "no-self-assign": [ "warn" ],
"no-unused-labels": [ "warn" ], "no-self-compare": [ "warn" ],
"no-useless-call": [ "warn" ], "no-sequences": [ "warn" ],
"no-useless-concat": [ "warn" ], "no-throw-literal": [ "warn" ],
"no-void": [ "warn" ], "no-unused-expressions": [ "warn" ],
"no-with": [ "warn" ], "no-unused-labels": [ "warn" ],
"radix": [ "warn" ], "no-useless-call": [ "warn" ],
"vars-on-top": [ "warn" ], "no-useless-concat": [ "warn" ],
"wrap-iife": [ "warn" ], "no-void": [ "warn" ],
"yoda": [ "warn" ], "no-with": [ "warn" ],
"array-bracket-spacing": [ "warn", "always" ], "radix": [ "warn" ],
"block-spacing": [ "warn" ], "vars-on-top": [ "warn" ],
"brace-style": [ "warn", "1tbs", { "allowSingleLine": true } ], "wrap-iife": [ "warn" ],
"comma-spacing": [ "warn" ], "yoda": [ "warn" ],
"comma-style": [ "warn" ], "array-bracket-spacing": [ "warn", "always" ],
"computed-property-spacing": [ "warn" ], "block-spacing": [ "warn" ],
"indent": [ "warn", 4, { "SwitchCase": 1 } ], "brace-style": [ "warn", "1tbs", { "allowSingleLine": true } ],
"key-spacing": [ "warn" ], "comma-spacing": [ "warn" ],
"keyword-spacing": [ "warn" ], "comma-style": [ "warn" ],
"linebreak-style": [ "warn" ], "computed-property-spacing": [ "warn" ],
"newline-after-var": [ "warn" ], "indent": [ "warn", 4, { "SwitchCase": 1 } ],
"no-lonely-if": [ "warn" ], "key-spacing": [ "warn" ],
"no-multiple-empty-lines": [ "warn", { "max": 1 } ], "keyword-spacing": [ "warn" ],
"no-spaced-func": [ "warn" ], "linebreak-style": [ "warn" ],
"no-unneeded-ternary": [ "warn" ], "newline-after-var": [ "warn" ],
"no-whitespace-before-property": [ "warn" ], "no-lonely-if": [ "warn" ],
"object-curly-spacing": [ "warn", "always" ], "no-multiple-empty-lines": [ "warn", { "max": 1 } ],
"padded-blocks": [ "warn", "never" ], "no-spaced-func": [ "warn" ],
"quotes": [ "warn" ], "no-unneeded-ternary": [ "warn" ],
"semi": [ "warn" ], "no-whitespace-before-property": [ "warn" ],
"semi-spacing": [ "warn" ], "object-curly-spacing": [ "warn", "always" ],
"space-before-blocks": [ "warn" ], "padded-blocks": [ "warn", "never" ],
"space-before-function-paren": [ "warn", "never" ], "quotes": [ "warn" ],
"space-in-parens": [ "warn" ], "semi": [ "warn" ],
"space-infix-ops": [ "warn" ], "semi-spacing": [ "warn" ],
"space-unary-ops": [ "warn" ], "space-before-blocks": [ "warn" ],
"spaced-comment": [ "warn" ], "space-before-function-paren": [ "warn", "never" ],
"wrap-regex": [ "warn" ] "space-in-parens": [ "warn" ],
} "space-infix-ops": [ "warn" ],
"space-unary-ops": [ "warn" ],
"spaced-comment": [ "warn" ],
"wrap-regex": [ "warn" ],
},
"overrides": [
{
"files": [ "*.vue" ],
"rules": {
"indent": "off",
"vue/script-indent": [ "warn", 4, { "baseIndent": 1, "switchCase": 1, "ignores": [ "VariableDeclaration" ] } ],
"vue/no-spaces-around-equal-signs-in-attribute": [ "warn" ],
"vue/component-name-in-template-casing": [ "warn", "kebab-case" ],
"vue/no-unused-components": [ "warn" ],
"vue/no-unused-vars": [ "warn" ],
"vue/no-use-v-if-with-v-for": [ "warn" ],
"vue/require-v-for-key": "off"
}
}
]
} }