import { env } from 'node:process' if (typeof Object.groupBy !== 'function') { Object.groupBy = function groupBy(items, callbackfn) { return Array.from(items).reduce((groups, item, index) => { const key = callbackfn(item, index) if (!Object.hasOwn(groups, key)) { groups[key] = [] } groups[key].push(item) return groups }, Object.create(null)) } } const { default: antfu } = await import('@antfu/eslint-config') const config = antfu( { vue: true, formatters: true, rules: { // These micro-optimisation rules create broad churn across the legacy UI codebase. // Keep lint focused on signal over noise for now. 'e18e/prefer-array-some': 'off', 'e18e/prefer-date-now': 'off', 'e18e/prefer-nullish-coalescing': 'off', 'e18e/prefer-object-has-own': 'off', 'e18e/prefer-static-regex': 'off', 'e18e/prefer-timer-args': 'off', 'no-console': env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': env.NODE_ENV === 'production' ? 'warn' : 'off', }, ignores: [ 'dist', 'scripts', 'public', 'supabase/functions/_script', '**/supabase.types*', '**/database.types*', 'supabase/functions/_backend/scripts/*', 'CHANGELOG.md', 'src/services/posthog.ts', ], }, { // Vue-specific overrides files: ['**/*.vue'], rules: { // Globally disallow v-html 'vue/no-v-html': 'error', }, }, ) // Everything else is linted by oxlint (`.oxlintrc.frontend.json`, including // oxlint-plugin-vize for templates). ESLint only runs on `.vue` files for the // rules oxlint cannot cover yet, keeping antfu's exact options and processors. const ESLINT_ONLY_RULES = new Set([ // Template parsing and inline `` directives 'vue/comment-directive', 'vue/no-parsing-error', 'vue/jsx-uses-vars', // Unused bindings: vue-eslint-parser sees template usage, oxlint JS plugins only see `