/ eslint.config.mjs
eslint.config.mjs
1 import { defineConfig, globalIgnores } from 'eslint/config' 2 import vue from 'eslint-plugin-vue' 3 import globals from 'globals' 4 import parser from 'vue-eslint-parser' 5 import path from 'node:path' 6 import { fileURLToPath } from 'node:url' 7 import js from '@eslint/js' 8 import { FlatCompat } from '@eslint/eslintrc' 9 10 const __filename = fileURLToPath(import.meta.url) 11 const __dirname = path.dirname(__filename) 12 const compat = new FlatCompat({ 13 baseDirectory: __dirname, 14 recommendedConfig: js.configs.recommended, 15 allConfig: js.configs.all 16 }) 17 18 export default defineConfig([ 19 globalIgnores([ 20 '**/node_modules/', 21 'buildAssets/icons/', 22 '**/dist/', 23 '**/release/', 24 '**/mcpb/', 25 '**/.idea/', 26 '**/.vscode/', 27 '**/.github/' 28 ]), 29 { 30 extends: compat.extends('plugin:vue/recommended', 'prettier'), 31 32 plugins: { 33 vue 34 }, 35 36 languageOptions: { 37 globals: { 38 ...globals.node, 39 __static: true 40 }, 41 42 parser: parser, 43 ecmaVersion: 2022, 44 sourceType: 'module', 45 46 parserOptions: { 47 parser: '@typescript-eslint/parser', 48 49 ecmaFeatures: { 50 jsx: true 51 } 52 } 53 }, 54 55 rules: { 56 'arrow-parens': 0, 57 'generator-star-spacing': 0, 58 'no-case-declarations': 0, 59 'array-callback-return': 0, 60 'no-trailing-spaces': 1, 61 'no-control-regex': 0, 62 'no-useless-constructor': 0, 63 'no-useless-assignment': 0, 64 'no-useless-escape': 1, 65 'no-unused-vars': [ 66 'error', 67 { 68 argsIgnorePattern: '^_', 69 varsIgnorePattern: '^_', 70 caughtErrorsIgnorePattern: '^_' 71 } 72 ], 73 'node/no-deprecated-api': 0 74 } 75 } 76 ])