Skip to content

Plugin type incompatible with ESLint defineConfig type #669

@FloEdelmann

Description

@FloEdelmann

Tell us about your environment

  • ESLint version: 9.39.1
  • eslint-plugin-vue version: 10.5.1
  • eslint-plugin-vue-i18n version: 4.1.0
  • Node version: 24.11.0

Please show your full configuration:

// @ts-check

import eslintPluginVueI18n from '@intlify/eslint-plugin-vue-i18n'
import { defineConfig } from 'eslint/config'
import jsoncEslintParser from 'jsonc-eslint-parser'

export default defineConfig([
    {
        name: 'i18n-json',
        files: ['locales/messages/*.json'],
        plugins: {
            '@intlify/vue-i18n': eslintPluginVueI18n,
        },
        languageOptions: {
            parser: jsoncEslintParser,
        },
        rules: {
            '@intlify/vue-i18n/key-format-style': 'error',
            '@intlify/vue-i18n/no-deprecated-modulo-syntax': 'error',
            '@intlify/vue-i18n/no-duplicate-keys-in-locale': 'error',
            '@intlify/vue-i18n/no-html-messages': 'error',
            '@intlify/vue-i18n/no-missing-keys-in-other-locales': 'error',
            '@intlify/vue-i18n/prefer-linked-key-with-paren': 'error',
            '@intlify/vue-i18n/valid-message-syntax': 'error',
        },
    },
])

What did you do?

Run npx tsc --noEmit

What did you expect to happen?

No type errors

What actually happened?

eslint.config.js:10:13 - error TS2322: Type '{ configs: { 'base-legacy': { parser: string; plugins: string[]; overrides: ({ files: string[]; parser: string; parserOptions: { parser: string; }; rules?: undefined; } | { files: string[]; parser: string; parserOptions: { ...; }; rules: { ...; }; })[]; }; ... 4 more ...; 'flat/recommended': any[]; }; rules: { ...; ...' is not assignable to type 'Plugin'.
  Types of property 'configs' are incompatible.
    Type '{ 'base-legacy': { parser: string; plugins: string[]; overrides: ({ files: string[]; parser: string; parserOptions: { parser: string; }; rules?: undefined; } | { files: string[]; parser: string; parserOptions: { ...; }; rules: { ...; }; })[]; }; ... 4 more ...; 'flat/recommended': any[]; }' is not assignable to type 'Record<string, ConfigObject<RulesConfig> | LegacyConfigObject<RulesConfig, RulesConfig> | ConfigObject<RulesConfig>[]>'.
      Property ''base-legacy'' is incompatible with index signature.
        Type '{ parser: string; plugins: string[]; overrides: ({ files: string[]; parser: string; parserOptions: { parser: string; }; rules?: undefined; } | { files: string[]; parser: string; parserOptions: { parser: string; }; rules: { ...; }; })[]; }' is not assignable to type 'ConfigObject<RulesConfig> | LegacyConfigObject<RulesConfig, RulesConfig> | ConfigObject<RulesConfig>[]'.
          Type '{ parser: string; plugins: string[]; overrides: ({ files: string[]; parser: string; parserOptions: { parser: string; }; rules?: undefined; } | { files: string[]; parser: string; parserOptions: { parser: string; }; rules: { ...; }; })[]; }' is not assignable to type 'LegacyConfigObject<RulesConfig, RulesConfig>'.
            Types of property 'overrides' are incompatible.
              Type '({ files: string[]; parser: string; parserOptions: { parser: string; }; rules?: undefined; } | { files: string[]; parser: string; parserOptions: { parser: string; }; rules: { 'no-irregular-whitespace': string; 'spaced-comment': string; }; })[]' is not assignable to type 'ConfigOverride<RulesConfig>[]'.
                Type '{ files: string[]; parser: string; parserOptions: { parser: string; }; rules?: undefined; } | { files: string[]; parser: string; parserOptions: { parser: string; }; rules: { 'no-irregular-whitespace': string; 'spaced-comment': string; }; }' is not assignable to type 'ConfigOverride<RulesConfig>'.
                  Type '{ files: string[]; parser: string; parserOptions: { parser: string; }; rules: { 'no-irregular-whitespace': string; 'spaced-comment': string; }; }' is not assignable to type 'ConfigOverride<RulesConfig>'.
                    Types of property 'rules' are incompatible.
                      Type '{ 'no-irregular-whitespace': string; 'spaced-comment': string; }' is not assignable to type 'Partial<RulesConfig>'.
                        Property ''no-irregular-whitespace'' is incompatible with index signature.
                          Type 'string' is not assignable to type 'RuleConfig<unknown[]> | undefined'.

10             '@intlify/vue-i18n': eslintPluginVueI18n,
               ~~~~~~~~~~~~~~~~~~~


Found 1 error in eslint.config.js:10

Repository to reproduce this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions