| 1 | const { env } = require('node:process') |
| 2 | const { defineConfig } = require('eslint-define-config') |
| 3 | |
| 4 | module.exports = defineConfig({ |
| 5 | root: true, |
| 6 | |
| 7 | env: { |
| 8 | node: true, |
| 9 | }, |
| 10 | |
| 11 | plugins: ['import'], |
| 12 | |
| 13 | extends: [ |
| 14 | 'eslint:recommended', |
| 15 | 'plugin:import/recommended', |
| 16 | 'plugin:vue/vue3-recommended', |
| 17 | '@vue/eslint-config-prettier', |
| 18 | '@vue/eslint-config-typescript/recommended', |
| 19 | ], |
| 20 | |
| 21 | settings: { |
| 22 | 'import/resolver': { |
| 23 | typescript: { |
| 24 | project: './tsconfig.json', |
| 25 | }, |
| 26 | }, |
| 27 | }, |
| 28 | |
| 29 | parserOptions: { |
| 30 | ecmaVersion: 'latest', |
| 31 | }, |
| 32 | |
| 33 | rules: { |
| 34 | 'no-console': env.NODE_ENV === 'production' ? 'warn' : 'off', |
| 35 | 'no-debugger': env.NODE_ENV === 'production' ? 'warn' : 'off', |
| 36 | 'vue/require-v-for-key': 'off', |
| 37 | 'vue/multi-word-component-names': 'off', |
| 38 | 'sort-imports': [ |
| 39 | 'error', |
| 40 | { |
| 41 | ignoreDeclarationSort: true, |
| 42 | }, |
| 43 | ], |
| 44 | 'import/order': 'error', |
| 45 | }, |
| 46 | }) |