|
|
@@ -1,9 +1,63 @@
|
|
|
-// eslint.config.mjs
|
|
|
+// 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 globals from 'globals'
|
|
|
import withNuxt from './.nuxt/eslint.config.mjs'
|
|
|
|
|
|
-// Configuration spécifique au projet qui sera fusionnée avec la configuration Nuxt
|
|
|
+const __filename = fileURLToPath(import.meta.url)
|
|
|
+const __dirname = path.dirname(__filename)
|
|
|
+
|
|
|
+// Configuration de base personnalisée
|
|
|
const customConfig = [
|
|
|
- // Configurations spécifiques par répertoire
|
|
|
+ {
|
|
|
+ ignores: [
|
|
|
+ '**/.nuxt',
|
|
|
+ 'coverage/*',
|
|
|
+ 'vendor/*',
|
|
|
+ 'dist/*',
|
|
|
+ 'models/models.ts',
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ languageOptions: {
|
|
|
+ globals: {
|
|
|
+ ...globals.browser,
|
|
|
+ ...globals.node,
|
|
|
+ useRuntimeConfig: 'readonly',
|
|
|
+ useAsyncData: 'readonly',
|
|
|
+ navigateTo: 'readonly',
|
|
|
+ computed: 'readonly',
|
|
|
+ ref: 'readonly',
|
|
|
+ definePageMeta: 'readonly',
|
|
|
+ useRouter: 'readonly',
|
|
|
+ useRoute: 'readonly',
|
|
|
+ useI18n: 'readonly',
|
|
|
+ onMounted: 'readonly',
|
|
|
+ onUnmounted: 'readonly',
|
|
|
+ watch: 'readonly',
|
|
|
+ useRepo: 'readonly',
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ rules: {
|
|
|
+ 'no-console': 0,
|
|
|
+ 'vue/valid-v-slot': [
|
|
|
+ 'error',
|
|
|
+ {
|
|
|
+ allowModifiers: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ 'vue/multi-word-component-names': 0,
|
|
|
+ '@typescript-eslint/no-inferrable-types': 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ // Directory-specific configurations
|
|
|
{
|
|
|
files: ['**/*.vue'],
|
|
|
rules: {
|
|
|
@@ -11,7 +65,13 @@ const customConfig = [
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- files: ['layouts/**/*.vue', 'pages/**/*.vue'],
|
|
|
+ files: ['layouts/**/*.vue'],
|
|
|
+ rules: {
|
|
|
+ 'vue/multi-word-component-names': 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ files: ['pages/**/*.vue'],
|
|
|
rules: {
|
|
|
'vue/multi-word-component-names': 0,
|
|
|
},
|
|
|
@@ -27,5 +87,5 @@ const customConfig = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-// Exporte la configuration en utilisant le helper de Nuxt
|
|
|
+// Utiliser withNuxt avec l'option standalone: false pour éviter les conflits
|
|
|
export default withNuxt(customConfig)
|