|
| 1 | +module.exports = { |
| 2 | + // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy |
| 3 | + // This option interrupts the configuration hierarchy at this file |
| 4 | + // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos) |
| 5 | + root: true, |
| 6 | + |
| 7 | + // https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser |
| 8 | + // Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working |
| 9 | + // `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted |
| 10 | + parserOptions: { |
| 11 | + parser: require.resolve('@typescript-eslint/parser'), |
| 12 | + extraFileExtensions: ['.vue'] |
| 13 | + }, |
| 14 | + |
| 15 | + env: { |
| 16 | + browser: true, |
| 17 | + es2021: true, |
| 18 | + node: true |
| 19 | + }, |
| 20 | + |
| 21 | + // Rules order is important, please avoid shuffling them |
| 22 | + extends: [ |
| 23 | + // Base ESLint recommended rules |
| 24 | + // 'eslint:recommended', |
| 25 | + |
| 26 | + // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage |
| 27 | + // ESLint typescript rules |
| 28 | + 'plugin:@typescript-eslint/recommended', |
| 29 | + |
| 30 | + // Uncomment any of the lines below to choose desired strictness, |
| 31 | + // but leave only one uncommented! |
| 32 | + // See https://eslint.vuejs.org/rules/#available-rules |
| 33 | + // 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention) |
| 34 | + 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) |
| 35 | + // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) |
| 36 | + |
| 37 | + 'standard' |
| 38 | + |
| 39 | + ], |
| 40 | + |
| 41 | + plugins: [ |
| 42 | + // required to apply rules which need type information |
| 43 | + '@typescript-eslint', |
| 44 | + |
| 45 | + // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files |
| 46 | + // required to lint *.vue files |
| 47 | + 'vue' |
| 48 | + |
| 49 | + ], |
| 50 | + |
| 51 | + globals: { |
| 52 | + ga: 'readonly', // Google Analytics |
| 53 | + cordova: 'readonly', |
| 54 | + __statics: 'readonly', |
| 55 | + __QUASAR_SSR__: 'readonly', |
| 56 | + __QUASAR_SSR_SERVER__: 'readonly', |
| 57 | + __QUASAR_SSR_CLIENT__: 'readonly', |
| 58 | + __QUASAR_SSR_PWA__: 'readonly', |
| 59 | + process: 'readonly', |
| 60 | + Capacitor: 'readonly', |
| 61 | + chrome: 'readonly' |
| 62 | + }, |
| 63 | + |
| 64 | + // add your custom rules here |
| 65 | + rules: { |
| 66 | + |
| 67 | + // allow async-await |
| 68 | + 'generator-star-spacing': 'off', |
| 69 | + // allow paren-less arrow functions |
| 70 | + 'arrow-parens': 'off', |
| 71 | + 'one-var': 'off', |
| 72 | + 'no-void': 'off', |
| 73 | + 'multiline-ternary': 'off', |
| 74 | + |
| 75 | + 'import/first': 'off', |
| 76 | + 'import/namespace': 'error', |
| 77 | + 'import/default': 'error', |
| 78 | + 'import/export': 'error', |
| 79 | + 'import/extensions': 'off', |
| 80 | + 'import/no-unresolved': 'off', |
| 81 | + 'import/no-extraneous-dependencies': 'off', |
| 82 | + |
| 83 | + // The core 'import/named' rules |
| 84 | + // does not work with type definitions |
| 85 | + 'import/named': 'off', |
| 86 | + |
| 87 | + 'prefer-promise-reject-errors': 'off', |
| 88 | + |
| 89 | + quotes: ['warn', 'single', { avoidEscape: true }], |
| 90 | + |
| 91 | + // this rule, if on, would require explicit return type on the `render` function |
| 92 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 93 | + |
| 94 | + // in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled |
| 95 | + '@typescript-eslint/no-var-requires': 'off', |
| 96 | + |
| 97 | + // The core 'no-unused-vars' rules (in the eslint:recommended ruleset) |
| 98 | + // does not work with type definitions |
| 99 | + 'no-unused-vars': 'off', |
| 100 | + |
| 101 | + 'space-before-function-paren': 'off', |
| 102 | + |
| 103 | + '@typescript-eslint/no-explicit-any': 'off', |
| 104 | + |
| 105 | + // allow debugger during development only |
| 106 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' |
| 107 | + } |
| 108 | +} |
0 commit comments