import nuxt from '@nuxt/eslint-config'

export default await nuxt(
    {
        features: {
            stylistic: false,
            typescript: true,
            nuxt: {
                sortConfigKeys: false,
            },
        },
        dirs: {
            root: ['.', './app'],
        },
    },
    {
        name: 'starseed/custom-overrides',
        rules: {
            // Indentation 4 espaces (convention CLAUDE.md)
            'vue/html-indent': ['error', 4],
            indent: ['error', 4, { SwitchCase: 1 }],

            // Vue — relaxed
            'vue/multi-word-component-names': 'off',
            'vue/no-multiple-template-root': 'off',
            'vue/require-default-prop': 'off',
            'vue/html-self-closing': 'off',
            'vue/singleline-html-element-content-newline': 'off',
            'vue/multiline-html-element-content-newline': 'off',
            'vue/attributes-order': 'off',
            'vue/v-on-event-hyphenation': 'off',

            // Console — allow console.error only
            'no-console': ['warn', { allow: ['error'] }],

            // Unused vars — warn, ignore underscore-prefixed
            'no-unused-vars': 'off',
            '@typescript-eslint/no-unused-vars': ['warn', {
                argsIgnorePattern: '^_',
                varsIgnorePattern: '^_',
                caughtErrorsIgnorePattern: '^_',
            }],

            // TypeScript — progressive strictness
            '@typescript-eslint/no-explicit-any': 'warn',
            '@typescript-eslint/no-dynamic-delete': 'off',
            '@typescript-eslint/no-invalid-void-type': 'off',

            // Formatting — leave to stylistic tools
            'require-await': 'off',
            'comma-dangle': 'off',
            curly: 'off',
            semi: 'off',
            quotes: 'off',
            'no-trailing-spaces': 'off',
            'no-multiple-empty-lines': 'off',
            'no-irregular-whitespace': 'off',
        },
    },
)
