2020-01-11 16:32:21 +00:00
|
|
|
// https://eslint.org/docs/user-guide/configuring
|
|
|
|
|
|
|
|
module.exports = {
|
2020-01-11 18:11:23 +00:00
|
|
|
root: true,
|
|
|
|
parserOptions: {
|
2020-01-11 16:32:21 +00:00
|
|
|
parser: 'babel-eslint',
|
|
|
|
},
|
2020-01-11 18:11:23 +00:00
|
|
|
env: {
|
2020-01-11 16:32:21 +00:00
|
|
|
browser: true,
|
|
|
|
},
|
2020-01-11 18:11:23 +00:00
|
|
|
extends: [
|
2020-01-11 16:32:21 +00:00
|
|
|
/*
|
|
|
|
* https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
|
|
|
|
* consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
|
|
|
|
*/
|
|
|
|
'plugin:vue/strongly-recommended',
|
|
|
|
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
|
|
|
|
'eslint:recommended',
|
|
|
|
],
|
|
|
|
// required to lint *.vue files
|
2020-01-11 18:11:23 +00:00
|
|
|
plugins: ['vue'],
|
|
|
|
globals: {
|
|
|
|
Go: true,
|
2020-01-11 19:22:55 +00:00
|
|
|
opensslDecrypt: true,
|
|
|
|
opensslEncrypt: true,
|
2020-01-11 16:32:21 +00:00
|
|
|
process: true,
|
2020-01-11 19:22:55 +00:00
|
|
|
sha256sum: true,
|
2020-01-11 16:32:21 +00:00
|
|
|
},
|
|
|
|
// add your custom rules here
|
2020-01-11 18:11:23 +00:00
|
|
|
rules: {
|
2020-01-11 16:32:21 +00:00
|
|
|
'array-bracket-newline': ['error', { multiline: true }],
|
|
|
|
'array-bracket-spacing': ['error'],
|
|
|
|
'arrow-body-style': ['error', 'as-needed'],
|
|
|
|
'arrow-parens': ['error', 'as-needed'],
|
|
|
|
'arrow-spacing': ['error', { before: true, after: true }],
|
|
|
|
'block-spacing': ['error'],
|
|
|
|
'brace-style': ['error', '1tbs'],
|
|
|
|
'comma-dangle': ['error', 'always-multiline'],
|
|
|
|
'comma-spacing': ['error'],
|
|
|
|
'comma-style': ['error', 'last'],
|
|
|
|
'curly': ['error'],
|
|
|
|
'dot-location': ['error', 'property'],
|
|
|
|
'dot-notation': ['error'],
|
|
|
|
'eol-last': ['error', 'always'],
|
2020-01-11 18:11:23 +00:00
|
|
|
'eqeqeq': ['error', 'always', { null: 'ignore' }],
|
2020-01-11 16:32:21 +00:00
|
|
|
'func-call-spacing': ['error', 'never'],
|
|
|
|
'function-paren-newline': ['error', 'multiline'],
|
|
|
|
'generator-star-spacing': ['off'], // allow async-await
|
|
|
|
'implicit-arrow-linebreak': ['error'],
|
|
|
|
'indent': ['error', 2],
|
|
|
|
'key-spacing': ['error', { beforeColon: false, afterColon: true, mode: 'strict' }],
|
|
|
|
'keyword-spacing': ['error'],
|
|
|
|
'linebreak-style': ['error', 'unix'],
|
|
|
|
'lines-between-class-members': ['error'],
|
|
|
|
'multiline-comment-style': ['warn'],
|
|
|
|
'newline-per-chained-call': ['error'],
|
|
|
|
'no-console': ['off'],
|
|
|
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // allow debugger during development
|
|
|
|
'no-else-return': ['error'],
|
|
|
|
'no-extra-parens': ['error'],
|
|
|
|
'no-implicit-coercion': ['error'],
|
|
|
|
'no-lonely-if': ['error'],
|
|
|
|
'no-multiple-empty-lines': ['warn', { max: 2, maxEOF: 0, maxBOF: 0 }],
|
|
|
|
'no-multi-spaces': ['error'],
|
|
|
|
'no-trailing-spaces': ['error'],
|
|
|
|
'no-unneeded-ternary': ['error'],
|
|
|
|
'no-useless-return': ['error'],
|
|
|
|
'no-whitespace-before-property': ['error'],
|
|
|
|
'object-curly-newline': ['error', { consistent: true }],
|
|
|
|
'object-curly-spacing': ['error', 'always'],
|
|
|
|
'object-shorthand': ['error'],
|
|
|
|
'padded-blocks': ['error', 'never'],
|
|
|
|
'prefer-arrow-callback': ['error'],
|
|
|
|
'prefer-const': ['error'],
|
|
|
|
'prefer-object-spread': ['error'],
|
|
|
|
'prefer-template': ['error'],
|
|
|
|
'quote-props': ['error', 'consistent-as-needed', { keywords: false }],
|
|
|
|
'quotes': ['error', 'single', { allowTemplateLiterals: true }],
|
|
|
|
'semi': ['error', 'never'],
|
|
|
|
'sort-keys': ['error', 'asc', { caseSensitive: true, natural: false }],
|
|
|
|
'space-before-blocks': ['error', 'always'],
|
|
|
|
'spaced-comment': ['warn', 'always'],
|
|
|
|
'space-infix-ops': ['error'],
|
|
|
|
'space-in-parens': ['error', 'never'],
|
|
|
|
'space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
|
|
'switch-colon-spacing': ['error'],
|
|
|
|
'unicode-bom': ['error', 'never'],
|
|
|
|
'wrap-iife': ['error'],
|
|
|
|
'yoda': ['error'],
|
|
|
|
},
|
|
|
|
}
|