PPTist/.eslintrc.js

79 lines
2.1 KiB
JavaScript
Raw Normal View History

2020-12-10 19:14:45 +08:00
module.exports = {
root: true,
env: {
2020-12-11 10:47:53 +08:00
node: true,
2020-12-10 19:14:45 +08:00
},
2020-12-11 10:47:53 +08:00
extends: [
2020-12-10 19:14:45 +08:00
'plugin:vue/vue3-essential',
'eslint:recommended',
2020-12-11 10:47:53 +08:00
'@vue/typescript/recommended',
2020-12-10 19:14:45 +08:00
],
parserOptions: {
2020-12-11 10:47:53 +08:00
ecmaVersion: 2020,
2020-12-10 19:14:45 +08:00
},
rules: {
2020-12-19 16:10:48 +08:00
'curly': ['error', 'multi-line'],
'quotes': ['error', 'single', {
2020-12-10 22:40:15 +08:00
'avoidEscape': true,
'allowTemplateLiterals': true,
}],
2020-12-19 16:10:48 +08:00
'key-spacing': ['error', {
2020-12-10 22:40:15 +08:00
'beforeColon': false,
'afterColon': true,
'mode': 'strict',
}],
2020-12-19 16:10:48 +08:00
'no-empty': 'error',
'no-else-return': 'error',
'no-multi-spaces': 'error',
'require-await': 'error',
'brace-style': ['error', 'stroustrup'],
'spaced-comment': ['error', 'always'],
'arrow-spacing': 'error',
'no-duplicate-imports': 'error',
'semi': ['error', 'never'],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'indent': ['error', 2, {'SwitchCase': 1}],
'eqeqeq': ['error', 'always', {'null': 'ignore'}],
'default-case': 'error',
'no-eval': 'error',
'no-var': 'error',
'no-with': 'error',
'max-depth': ['error', 5],
'consistent-this': ['error', 'self'],
2020-12-21 17:25:43 +08:00
'max-lines': ['error', 1000],
2020-12-19 16:10:48 +08:00
'no-multi-str': 'error',
'space-infix-ops': 'error',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', {
2020-12-10 22:40:15 +08:00
'anonymous': 'never',
'named': 'never',
'asyncArrow': 'always',
}],
2020-12-19 16:10:48 +08:00
'keyword-spacing': ['error', { 'overrides': {
2020-12-10 22:40:15 +08:00
'if': { 'after': false },
'for': { 'after': false },
'while': { 'after': false },
'function': { 'after': false },
'switch': { 'after': false },
}}],
2020-12-19 16:10:48 +08:00
'prefer-const': 'error',
'no-useless-return': 'error',
'array-bracket-spacing': 'error',
'no-useless-escape': 'off',
'no-alert': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
2020-12-10 19:14:45 +08:00
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
2020-12-11 10:47:53 +08:00
jest: true,
},
},
],
2020-12-10 19:14:45 +08:00
}