|
| 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 | + 'vue/setup-compiler-macros': true |
| 20 | + }, |
| 21 | + |
| 22 | + // Rules order is important, please avoid shuffling them |
| 23 | + extends: [ |
| 24 | + // Base ESLint recommended rules |
| 25 | + // 'eslint:recommended', |
| 26 | + |
| 27 | + // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage |
| 28 | + // ESLint typescript rules |
| 29 | + 'plugin:@typescript-eslint/recommended', |
| 30 | + |
| 31 | + // Uncomment any of the lines below to choose desired strictness, |
| 32 | + // but leave only one uncommented! |
| 33 | + // See https://eslint.vuejs.org/rules/#available-rules |
| 34 | + 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention) |
| 35 | + // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) |
| 36 | + // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) |
| 37 | + |
| 38 | + // https://github.com/prettier/eslint-config-prettier#installation |
| 39 | + // usage with Prettier, provided by 'eslint-config-prettier'. |
| 40 | + 'prettier' |
| 41 | + ], |
| 42 | + |
| 43 | + plugins: [ |
| 44 | + // required to apply rules which need type information |
| 45 | + '@typescript-eslint', |
| 46 | + |
| 47 | + // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files |
| 48 | + // required to lint *.vue files |
| 49 | + 'vue' |
| 50 | + |
| 51 | + // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674 |
| 52 | + // Prettier has not been included as plugin to avoid performance impact |
| 53 | + // add it as an extension for your IDE |
| 54 | + |
| 55 | + ], |
| 56 | + |
| 57 | + globals: { |
| 58 | + ga: 'readonly', // Google Analytics |
| 59 | + cordova: 'readonly', |
| 60 | + __statics: 'readonly', |
| 61 | + __QUASAR_SSR__: 'readonly', |
| 62 | + __QUASAR_SSR_SERVER__: 'readonly', |
| 63 | + __QUASAR_SSR_CLIENT__: 'readonly', |
| 64 | + __QUASAR_SSR_PWA__: 'readonly', |
| 65 | + process: 'readonly', |
| 66 | + Capacitor: 'readonly', |
| 67 | + chrome: 'readonly' |
| 68 | + }, |
| 69 | + |
| 70 | + // add your custom rules here |
| 71 | + rules: { |
| 72 | + |
| 73 | + 'prefer-promise-reject-errors': 'off', |
| 74 | + |
| 75 | + quotes: ['warn', 'single', { avoidEscape: true }], |
| 76 | + |
| 77 | + // this rule, if on, would require explicit return type on the `render` function |
| 78 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 79 | + |
| 80 | + // in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled |
| 81 | + '@typescript-eslint/no-var-requires': 'off', |
| 82 | + |
| 83 | + // The core 'no-unused-vars' rules (in the eslint:recommended ruleset) |
| 84 | + // does not work with type definitions |
| 85 | + 'no-unused-vars': 'off', |
| 86 | + |
| 87 | + // allow debugger during development only |
| 88 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' |
| 89 | + } |
| 90 | +} |
0 commit comments