TypeScript error: PluginFlatConfig is not assignable to ConfigWithExtends when using ESLint flat config
02:48 09 Dec 2025

I'm getting several TS2322 errors when running tsc -b on my project that uses the new ESLint flat config. The compiler says that some of the objects I'm passing to defineConfig() are not assignable to ConfigWithExtends or InfiniteArray.

The errors point to incompatibilities between:

  • PluginFlatConfig coming from various ESLint plugins
  • the core ESLint types from @eslint/core
  • the FlatConfig.LanguageOptions type coming from @typescript-eslint/utils

It looks like different packages are exporting different definitions of LanguageOptions and RulesConfig, and TypeScript refuses to merge them. For example, ESLint’s core LanguageOptions expects an index signature, while the version provided by @typescript-eslint does not. The error also complains that some rule values (like "import-x/order": "error") don't match ESLint’s required RuleConfig type.

In short, TypeScript thinks the configs coming from plugins (import-x, unused-imports, @typescript-eslint) don’t structurally match the types expected by defineConfig() because the involved packages are not using the same version of the flat-config type definitions.

This only happens during TypeScript compilation — ESLint itself runs fine — so it seems to be a type-level mismatch rather than a runtime configuration issue.

Here's the tsc -b output:

eslint.config.ts(32,3): error TS2322: Type 'PluginFlatConfig' is not assignable to type 'InfiniteArray'.
  Type 'PluginFlatConfig' is not assignable to type 'ConfigWithExtends'.
    Types of property 'languageOptions' are incompatible.
      Type 'import("/home/zypheris/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions | undefined' is not assignable to type 'import("/home/zypheris/node_modules/@eslint/core/dist/cjs/types").LanguageOptions | undefined'.
        Type 'import("/home/zypheris/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions' is not assignable to type 'import("/home/zypheris/node_modules/@eslint/core/dist/cjs/types").LanguageOptions'.
          Index signature for type 'string' is missing in type 'LanguageOptions'.
eslint.config.ts(33,3): error TS2322: Type 'PluginFlatConfig' is not assignable to type 'InfiniteArray'.
  Type 'PluginFlatConfig' is not assignable to type 'ConfigWithExtends'.
    Types of property 'languageOptions' are incompatible.
      Type 'import("/home/zypheris/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions | undefined' is not assignable to type 'import("/home/zypheris/node_modules/@eslint/core/dist/cjs/types").LanguageOptions | undefined'.
        Type 'import("/home/zypheris/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions' is not assignable to type 'import("/home/zypheris/node_modules/@eslint/core/dist/cjs/types").LanguageOptions'.
          Index signature for type 'string' is missing in type 'LanguageOptions'.
eslint.config.ts(34,3): error TS2322: Type '{ languageOptions: { parserOptions: { projectService: boolean; }; }; plugins: { 'unused-imports': Plugin; }; rules: { "import-x/order": string; '@typescript-eslint/no-unused-vars': string; 'unused-imports/no-unused-imports': string; 'unused-imports/no-unused-vars': string; 'no-console': string; }; }' is not assignable to type 'InfiniteArray'.
  Type '{ languageOptions: { parserOptions: { projectService: boolean; }; }; plugins: { 'unused-imports': Plugin; }; rules: { "import-x/order": string; '@typescript-eslint/no-unused-vars': string; 'unused-imports/no-unused-imports': string; 'unused-imports/no-unused-vars': string; 'no-console': string; }; }' is not assignable to type 'ConfigWithExtends'.
    Types of property 'rules' are incompatible.
      Type '{ "import-x/order": string; '@typescript-eslint/no-unused-vars': string; 'unused-imports/no-unused-imports': string; 'unused-imports/no-unused-vars': string; 'no-console': string; }' is not assignable to type 'Partial'.
        Property '"import-x/order"' is incompatible with index signature.
          Type 'string' is not assignable to type 'RuleConfig | undefined'.

And here's the eslint.config.ts content:

/** @format */

import { defineConfig, globalIgnores } from 'eslint/config'
import * as tseslint from 'typescript-eslint'
import { importX } from 'eslint-plugin-import-x'
import eslintConfigPrettier from "eslint-config-prettier/flat"
import unusedImports from "eslint-plugin-unused-imports"

const baseConfig = {
  languageOptions: { parserOptions: { projectService: true } },
  plugins: {
    'unused-imports': unusedImports
  },
  rules: {
    "import-x/order": 'error',
    '@typescript-eslint/no-unused-vars': 'off',
    'unused-imports/no-unused-imports': 'error',
    'unused-imports/no-unused-vars': 'error',
    'no-console': 'error'
  }
}

const nodeConfig = { files: ['**/*.ts'], ignores: ['public', 'src'] }

const appConfig = { files: ['src/**/*.{ts,tsx}'] }

export default defineConfig([
  globalIgnores(['.github', '.husky', 'dist', '**/*.{js,cjs,mjs}']),
  tseslint.configs.strictTypeChecked,
  importX.flatConfigs.recommended,
  importX.flatConfigs.typescript,
  baseConfig,
  nodeConfig,
  appConfig,
  eslintConfigPrettier
])
typescript eslint