|
|
@@ -1,3 +1,10 @@
|
|
|
+// Polyfill for structuredClone if it doesn't exist
|
|
|
+if (typeof structuredClone !== 'function') {
|
|
|
+ globalThis.structuredClone = function(obj) {
|
|
|
+ return JSON.parse(JSON.stringify(obj));
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
import path from 'node:path'
|
|
|
import { fileURLToPath } from 'node:url'
|
|
|
import vue from 'eslint-plugin-vue'
|
|
|
@@ -6,6 +13,7 @@ import globals from 'globals'
|
|
|
import parser from 'vue-eslint-parser'
|
|
|
import js from '@eslint/js'
|
|
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
|
+import { defineConfig } from "eslint/config"
|
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
|
const __dirname = path.dirname(__filename)
|
|
|
@@ -15,7 +23,7 @@ const compat = new FlatCompat({
|
|
|
allConfig: js.configs.all,
|
|
|
})
|
|
|
|
|
|
-export default [
|
|
|
+const baseConfig = [
|
|
|
{
|
|
|
ignores: [
|
|
|
'**/.nuxt',
|
|
|
@@ -65,7 +73,7 @@ export default [
|
|
|
|
|
|
parserOptions: {
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
- tsconfigRootDir: '/home/workspace',
|
|
|
+ tsconfigRootDir: __dirname,
|
|
|
},
|
|
|
},
|
|
|
|
|
|
@@ -84,3 +92,30 @@ export default [
|
|
|
},
|
|
|
},
|
|
|
]
|
|
|
+
|
|
|
+// Directory-specific configurations
|
|
|
+baseConfig.push(
|
|
|
+ {
|
|
|
+ files: ['layouts/**/*.vue'],
|
|
|
+ rules: {
|
|
|
+ 'vue/multi-word-component-names': 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ files: ['pages/**/*.vue'],
|
|
|
+ rules: {
|
|
|
+ 'vue/multi-word-component-names': 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ files: ['tests/**/*'],
|
|
|
+ rules: {
|
|
|
+ '@typescript-eslint/ban-ts-comment': 0,
|
|
|
+ '@typescript-eslint/no-unused-vars': 0,
|
|
|
+ '@typescript-eslint/no-explicit-any': 0,
|
|
|
+ 'require-await': 0,
|
|
|
+ },
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
+export default defineConfig(baseConfig)
|