2022-02-11 19:09:58 +00:00
|
|
|
const LEGACY_FILES = ["example/**"];
|
2018-08-07 21:47:50 +00:00
|
|
|
module.exports = {
|
|
|
|
"env": {
|
|
|
|
"browser": true,
|
|
|
|
"es6": true,
|
|
|
|
"jasmine": true,
|
|
|
|
"amd": true
|
|
|
|
},
|
2019-12-04 20:39:09 +00:00
|
|
|
"globals": {
|
|
|
|
"_": "readonly"
|
|
|
|
},
|
|
|
|
"extends": [
|
|
|
|
"eslint:recommended",
|
2020-05-27 17:59:02 +00:00
|
|
|
"plugin:vue/recommended",
|
|
|
|
"plugin:you-dont-need-lodash-underscore/compatible"
|
2019-12-04 20:39:09 +00:00
|
|
|
],
|
|
|
|
"parser": "vue-eslint-parser",
|
2018-08-07 21:47:50 +00:00
|
|
|
"parserOptions": {
|
2019-12-04 20:39:09 +00:00
|
|
|
"parser": "babel-eslint",
|
2018-08-07 21:47:50 +00:00
|
|
|
"allowImportExportEverywhere": true,
|
|
|
|
"ecmaVersion": 2015,
|
|
|
|
"ecmaFeatures": {
|
|
|
|
"impliedStrict": true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"rules": {
|
2020-05-27 17:59:02 +00:00
|
|
|
"you-dont-need-lodash-underscore/omit": "off",
|
|
|
|
"you-dont-need-lodash-underscore/throttle": "off",
|
|
|
|
"you-dont-need-lodash-underscore/flatten": "off",
|
2018-08-07 21:47:50 +00:00
|
|
|
"no-bitwise": "error",
|
|
|
|
"curly": "error",
|
|
|
|
"eqeqeq": "error",
|
|
|
|
"guard-for-in": "error",
|
|
|
|
"no-extend-native": "error",
|
|
|
|
"no-inner-declarations": "off",
|
|
|
|
"no-use-before-define": ["error", "nofunc"],
|
|
|
|
"no-caller": "error",
|
|
|
|
"no-sequences": "error",
|
|
|
|
"no-irregular-whitespace": "error",
|
|
|
|
"no-new": "error",
|
|
|
|
"no-shadow": "error",
|
|
|
|
"no-undef": "error",
|
|
|
|
"no-unused-vars": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"vars": "all",
|
|
|
|
"args": "none"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"no-console": "off",
|
|
|
|
"no-trailing-spaces": "error",
|
|
|
|
"space-before-function-paren": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"anonymous": "always",
|
|
|
|
"asyncArrow": "always",
|
2021-02-12 21:46:53 +00:00
|
|
|
"named": "never"
|
2018-08-07 21:47:50 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"array-bracket-spacing": "error",
|
|
|
|
"space-in-parens": "error",
|
|
|
|
"space-before-blocks": "error",
|
|
|
|
"comma-dangle": "error",
|
|
|
|
"eol-last": "error",
|
|
|
|
"new-cap": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"capIsNew": false,
|
|
|
|
"properties": false
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"dot-notation": "error",
|
2019-12-04 20:39:09 +00:00
|
|
|
"indent": ["error", 4],
|
2020-05-16 23:19:36 +00:00
|
|
|
|
|
|
|
// https://eslint.org/docs/rules/no-case-declarations
|
|
|
|
"no-case-declarations": "error",
|
|
|
|
// https://eslint.org/docs/rules/max-classes-per-file
|
|
|
|
"max-classes-per-file": ["error", 1],
|
|
|
|
// https://eslint.org/docs/rules/no-eq-null
|
|
|
|
"no-eq-null": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-eval
|
|
|
|
"no-eval": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-floating-decimal
|
|
|
|
"no-floating-decimal": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-implicit-globals
|
|
|
|
"no-implicit-globals": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-implied-eval
|
|
|
|
"no-implied-eval": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-lone-blocks
|
|
|
|
"no-lone-blocks": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-loop-func
|
|
|
|
"no-loop-func": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-new-func
|
|
|
|
"no-new-func": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-new-wrappers
|
|
|
|
"no-new-wrappers": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-octal-escape
|
|
|
|
"no-octal-escape": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-proto
|
|
|
|
"no-proto": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-return-await
|
|
|
|
"no-return-await": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-script-url
|
|
|
|
"no-script-url": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-self-compare
|
|
|
|
"no-self-compare": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-sequences
|
|
|
|
"no-sequences": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-unmodified-loop-condition
|
|
|
|
"no-unmodified-loop-condition": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-useless-call
|
|
|
|
"no-useless-call": "error",
|
|
|
|
// https://eslint.org/docs/rules/wrap-iife
|
|
|
|
"wrap-iife": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-nested-ternary
|
|
|
|
"no-nested-ternary": "error",
|
|
|
|
// https://eslint.org/docs/rules/switch-colon-spacing
|
|
|
|
"switch-colon-spacing": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-useless-computed-key
|
|
|
|
"no-useless-computed-key": "error",
|
|
|
|
// https://eslint.org/docs/rules/rest-spread-spacing
|
|
|
|
"rest-spread-spacing": ["error"],
|
2020-08-10 19:13:23 +00:00
|
|
|
// https://eslint.org/docs/rules/no-var
|
|
|
|
"no-var": "error",
|
|
|
|
// https://eslint.org/docs/rules/one-var
|
|
|
|
"one-var": ["error", "never"],
|
2020-08-10 18:23:35 +00:00
|
|
|
// https://eslint.org/docs/rules/default-case-last
|
|
|
|
"default-case-last": "error",
|
|
|
|
// https://eslint.org/docs/rules/default-param-last
|
|
|
|
"default-param-last": "error",
|
|
|
|
// https://eslint.org/docs/rules/grouped-accessor-pairs
|
|
|
|
"grouped-accessor-pairs": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-constructor-return
|
|
|
|
"no-constructor-return": "error",
|
2020-08-10 17:59:18 +00:00
|
|
|
// https://eslint.org/docs/rules/array-callback-return
|
|
|
|
"array-callback-return": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-invalid-this
|
|
|
|
"no-invalid-this": "error", // Believe this one actually surfaces some bugs
|
|
|
|
// https://eslint.org/docs/rules/func-style
|
|
|
|
"func-style": ["error", "declaration"],
|
2020-08-10 17:35:40 +00:00
|
|
|
// https://eslint.org/docs/rules/no-unused-expressions
|
|
|
|
"no-unused-expressions": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-useless-concat
|
|
|
|
"no-useless-concat": "error",
|
|
|
|
// https://eslint.org/docs/rules/radix
|
|
|
|
"radix": "error",
|
|
|
|
// https://eslint.org/docs/rules/require-await
|
|
|
|
"require-await": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-alert
|
|
|
|
"no-alert": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-useless-constructor
|
|
|
|
"no-useless-constructor": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-duplicate-imports
|
|
|
|
"no-duplicate-imports": "error",
|
2020-05-16 23:19:36 +00:00
|
|
|
|
2020-07-31 19:11:03 +00:00
|
|
|
// https://eslint.org/docs/rules/no-implicit-coercion
|
|
|
|
"no-implicit-coercion": "error",
|
|
|
|
//https://eslint.org/docs/rules/no-unneeded-ternary
|
|
|
|
"no-unneeded-ternary": "error",
|
|
|
|
// https://eslint.org/docs/rules/semi
|
|
|
|
"semi": ["error", "always"],
|
|
|
|
// https://eslint.org/docs/rules/no-multi-spaces
|
|
|
|
"no-multi-spaces": "error",
|
|
|
|
// https://eslint.org/docs/rules/key-spacing
|
|
|
|
"key-spacing": ["error", {
|
|
|
|
"afterColon": true
|
|
|
|
}],
|
|
|
|
// https://eslint.org/docs/rules/keyword-spacing
|
|
|
|
"keyword-spacing": ["error", {
|
|
|
|
"before": true,
|
|
|
|
"after": true
|
|
|
|
}],
|
|
|
|
// https://eslint.org/docs/rules/comma-spacing
|
|
|
|
// Also requires one line code fix
|
|
|
|
"comma-spacing": ["error", {
|
|
|
|
"after": true
|
|
|
|
}],
|
|
|
|
//https://eslint.org/docs/rules/no-whitespace-before-property
|
|
|
|
"no-whitespace-before-property": "error",
|
|
|
|
// https://eslint.org/docs/rules/object-curly-newline
|
2021-02-12 21:46:53 +00:00
|
|
|
"object-curly-newline": ["error", {
|
|
|
|
"consistent": true,
|
|
|
|
"multiline": true
|
|
|
|
}],
|
2020-07-31 19:11:03 +00:00
|
|
|
// https://eslint.org/docs/rules/object-property-newline
|
|
|
|
"object-property-newline": "error",
|
|
|
|
// https://eslint.org/docs/rules/brace-style
|
|
|
|
"brace-style": "error",
|
|
|
|
// https://eslint.org/docs/rules/no-multiple-empty-lines
|
|
|
|
"no-multiple-empty-lines": ["error", {"max": 1}],
|
|
|
|
// https://eslint.org/docs/rules/operator-linebreak
|
|
|
|
"operator-linebreak": ["error", "before", {"overrides": {"=": "after"}}],
|
|
|
|
// https://eslint.org/docs/rules/padding-line-between-statements
|
2021-02-12 21:46:53 +00:00
|
|
|
"padding-line-between-statements": ["error", {
|
2020-07-31 19:11:03 +00:00
|
|
|
"blankLine": "always",
|
|
|
|
"prev": "multiline-block-like",
|
|
|
|
"next": "*"
|
|
|
|
}, {
|
|
|
|
"blankLine": "always",
|
|
|
|
"prev": "*",
|
|
|
|
"next": "return"
|
|
|
|
}],
|
|
|
|
// https://eslint.org/docs/rules/space-infix-ops
|
|
|
|
"space-infix-ops": "error",
|
|
|
|
// https://eslint.org/docs/rules/space-unary-ops
|
2021-02-12 21:46:53 +00:00
|
|
|
"space-unary-ops": ["error", {
|
|
|
|
"words": true,
|
|
|
|
"nonwords": false
|
|
|
|
}],
|
2020-07-31 19:11:03 +00:00
|
|
|
// https://eslint.org/docs/rules/arrow-spacing
|
|
|
|
"arrow-spacing": "error",
|
|
|
|
// https://eslint.org/docs/rules/semi-spacing
|
2021-02-12 21:46:53 +00:00
|
|
|
"semi-spacing": ["error", {
|
|
|
|
"before": false,
|
|
|
|
"after": true
|
|
|
|
}],
|
2020-07-31 19:11:03 +00:00
|
|
|
|
2019-12-04 20:39:09 +00:00
|
|
|
"vue/html-indent": [
|
|
|
|
"error",
|
|
|
|
4,
|
|
|
|
{
|
|
|
|
"attribute": 1,
|
|
|
|
"baseIndent": 0,
|
|
|
|
"closeBracket": 0,
|
|
|
|
"alignAttributesVertically": true,
|
|
|
|
"ignores": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"vue/html-self-closing": ["error",
|
|
|
|
{
|
|
|
|
"html": {
|
|
|
|
"void": "never",
|
|
|
|
"normal": "never",
|
|
|
|
"component": "always"
|
|
|
|
},
|
|
|
|
"svg": "always",
|
|
|
|
"math": "always"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"vue/max-attributes-per-line": ["error", {
|
|
|
|
"singleline": 1,
|
|
|
|
"multiline": {
|
|
|
|
"max": 1,
|
|
|
|
"allowFirstLine": true
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
"vue/multiline-html-element-content-newline": "off",
|
2020-08-10 18:23:35 +00:00
|
|
|
"vue/singleline-html-element-content-newline": "off",
|
2021-02-12 21:46:53 +00:00
|
|
|
"vue/no-mutating-props": "off"
|
2020-08-10 18:23:35 +00:00
|
|
|
|
2018-08-07 21:47:50 +00:00
|
|
|
},
|
|
|
|
"overrides": [
|
|
|
|
{
|
2020-08-10 18:23:35 +00:00
|
|
|
"files": LEGACY_FILES,
|
2018-08-07 21:47:50 +00:00
|
|
|
"rules": {
|
|
|
|
"no-unused-vars": [
|
|
|
|
"warn",
|
|
|
|
{
|
|
|
|
"vars": "all",
|
|
|
|
"args": "none",
|
2020-08-10 18:23:35 +00:00
|
|
|
"varsIgnorePattern": "controller"
|
2018-08-07 21:47:50 +00:00
|
|
|
}
|
2020-08-10 18:23:35 +00:00
|
|
|
],
|
2020-05-16 23:19:36 +00:00
|
|
|
"no-nested-ternary": "off",
|
2020-08-10 19:13:23 +00:00
|
|
|
"no-var": "off",
|
|
|
|
"one-var": "off"
|
2020-05-16 23:19:36 +00:00
|
|
|
}
|
2018-08-07 21:47:50 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|