|
| 1 | +import js from '@eslint/js' |
| 2 | +import globals from 'globals' |
| 3 | +import pluginVue from 'eslint-plugin-vue' |
| 4 | +import pluginQuasar from '@quasar/app-vite/eslint' |
| 5 | +import { defineConfigWithVueTs, vueTsConfigs, configureVueProject } from '@vue/eslint-config-typescript' |
| 6 | +import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting' |
| 7 | + |
| 8 | + |
| 9 | +configureVueProject({ |
| 10 | + allowComponentTypeUnsafety: false, |
| 11 | +}) |
| 12 | + |
| 13 | +export default defineConfigWithVueTs( |
| 14 | + { |
| 15 | + /** |
| 16 | + * Ignore the following files. |
| 17 | + * Please note that pluginQuasar.configs.recommended() already ignores |
| 18 | + * the "node_modules" folder for you (and all other Quasar project |
| 19 | + * relevant folders and files). |
| 20 | + * |
| 21 | + * ESLint requires "ignores" key to be the only one in this object |
| 22 | + */ |
| 23 | + // ignores: [] |
| 24 | + }, |
| 25 | + |
| 26 | + pluginQuasar.configs.recommended(), |
| 27 | + js.configs.recommended, |
| 28 | + |
| 29 | + /** |
| 30 | + * https://eslint.vuejs.org |
| 31 | + * |
| 32 | + * pluginVue.configs.base |
| 33 | + * -> Settings and rules to enable correct ESLint parsing. |
| 34 | + * pluginVue.configs[ 'flat/essential'] |
| 35 | + * -> base, plus rules to prevent errors or unintended behavior. |
| 36 | + * pluginVue.configs["flat/strongly-recommended"] |
| 37 | + * -> Above, plus rules to considerably improve code readability and/or dev experience. |
| 38 | + * pluginVue.configs["flat/recommended"] |
| 39 | + * -> Above, plus rules to enforce subjective community defaults to ensure consistency. |
| 40 | + */ |
| 41 | + pluginVue.configs[ 'flat/essential' ], |
| 42 | + |
| 43 | + { |
| 44 | + files: ['**/*.ts', '**/*.vue'], |
| 45 | + rules: { |
| 46 | + '@typescript-eslint/consistent-type-imports': [ |
| 47 | + 'error', |
| 48 | + { prefer: 'type-imports' } |
| 49 | + ], |
| 50 | + } |
| 51 | + }, |
| 52 | + // https://github.com/vuejs/eslint-config-typescript |
| 53 | + vueTsConfigs.strictTypeChecked, |
| 54 | + |
| 55 | + { |
| 56 | + languageOptions: { |
| 57 | + ecmaVersion: 'latest', |
| 58 | + sourceType: 'module', |
| 59 | + |
| 60 | + globals: { |
| 61 | + ...globals.browser, |
| 62 | + ...globals.node, // SSR, Electron, config files |
| 63 | + process: 'readonly', // process.env.* |
| 64 | + ga: 'readonly', // Google Analytics |
| 65 | + cordova: 'readonly', |
| 66 | + Capacitor: 'readonly', |
| 67 | + chrome: 'readonly', // BEX related |
| 68 | + browser: 'readonly' // BEX related |
| 69 | + } |
| 70 | + }, |
| 71 | + |
| 72 | + // add your custom rules here |
| 73 | + rules: { |
| 74 | + 'prefer-promise-reject-errors': 'off', |
| 75 | + |
| 76 | + // allow debugger during development only |
| 77 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' |
| 78 | + } |
| 79 | + }, |
| 80 | + |
| 81 | + { |
| 82 | + files: [ 'src-pwa/custom-service-worker.ts' ], |
| 83 | + languageOptions: { |
| 84 | + globals: { |
| 85 | + ...globals.serviceworker |
| 86 | + } |
| 87 | + } |
| 88 | + }, |
| 89 | + |
| 90 | + prettierSkipFormatting |
| 91 | +) |
0 commit comments