Skip to content

fix(eslint-plugin-formatjs): remove obsolete @types/eslint#5884

Merged
longlho merged 1 commit intoformatjs:mainfrom
andersk:types-eslint
Jan 14, 2026
Merged

fix(eslint-plugin-formatjs): remove obsolete @types/eslint#5884
longlho merged 1 commit intoformatjs:mainfrom
andersk:types-eslint

Conversation

@andersk
Copy link
Copy Markdown
Contributor

@andersk andersk commented Jan 12, 2026

eslint@9 comes with its own types. @types/eslint is unmaintained, no longer compatible with current eslint, and causes spurious type errors when installed.


Minimal reproduction:

eslint.config.mjs

// @ts-check
import { FlatCompat } from "@eslint/eslintrc";
import { defineConfig } from "eslint/config";
const compat = new FlatCompat({ baseDirectory: "." });
export default defineConfig(compat.config({}));
$ pnpm i @eslint/eslintrc eslint eslint-plugin-formatjs typescript
$ pnpm exec tsc --allowJs --module nodenext --noEmit eslint.config.mjs 
eslint.config.mjs:5:29 - error TS2345: Argument of type 'Config<RulesRecord>[]' is not assignable to parameter of type 'InfiniteArray<ConfigWithExtends>'.
  Type 'Config<RulesRecord>[]' is not assignable to type 'InfiniteArray<ConfigWithExtends>[]'.
    Type 'Config<RulesRecord>' is not assignable to type 'InfiniteArray<ConfigWithExtends>'.
      Type 'Config<RulesRecord>' is not assignable to type 'ConfigWithExtends'.
        Types of property 'languageOptions' are incompatible.
          Type 'import("/tmp/u/node_modules/.pnpm/@[email protected]/node_modules/@types/eslint/index").Linter.LanguageOptions' is not assignable to type 'import("/tmp/u/node_modules/.pnpm/@[email protected]/node_modules/@eslint/core/dist/cjs/types").LanguageOptions'.
            Index signature for type 'string' is missing in type 'LanguageOptions'.

5 export default defineConfig(compat.config({}));
                              ~~~~~~~~~~~~~~~~~


Found 1 error in eslint.config.mjs:5

eslint@9 comes with its own types.  @types/eslint is unmaintained, no
longer compatible with current eslint, and causes spurious type errors
when installed.

DefinitelyTyped/DefinitelyTyped#70735

Signed-off-by: Anders Kaseorg <[email protected]>
@longlho longlho merged commit 0e7b93b into formatjs:main Jan 14, 2026
6 checks passed
@longlho
Copy link
Copy Markdown
Member

longlho commented Jan 14, 2026

Thanks a lot for your contributions!

@andersk andersk deleted the types-eslint branch January 14, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants