Skip to content

fix(eslint-plugin): type public exports with eslint core types - #27

Merged
binjospookie merged 2 commits into
mainfrom
fix/eslint-plugin-core-types
Aug 12, 2026
Merged

fix(eslint-plugin): type public exports with eslint core types#27
binjospookie merged 2 commits into
mainfrom
fix/eslint-plugin-core-types

Conversation

@binjospookie

Copy link
Copy Markdown
Contributor

What

  • Plugin public surface re-typed with ESLint's own types: the default export is ESLint.Plugin & { configs: { recommended: Linter.Config } }, ruleset satisfies Linter.RulesRecord. One internal as unknown as ESLint.Plugin cast bridges the TSESLint↔eslint rule-module signature gap.
  • Fixes the type error defineConfig consumers saw on configs.recommended; tseslint.config consumers keep working (their plugins: record accepts Omit<Plugin, "configs"> — pinned as FlatConfig.Plugins[string]).
  • New src/index.test-d.ts pins both consumer scenarios, including a literal defineConfig(plugin.configs.recommended) call; vitest typecheck enabled for the package.
  • configs uses an explicit annotation instead of satisfies: the inferred type hits TS2883 (non-portable reference into @eslint/core via pnpm path) during dts emit.
  • CHANGELOG: entry under Unreleased; version untouched (release pipeline owns it). Root CLAUDE.md now states that rule.

Verified

Build + attw + publint clean; 22 tests passed (20 rule + 2 type), type errors 0; knip + oxlint clean.

Emitted d.mts:

import { ESLint, Linter } from "eslint";
declare const configs: { recommended: Linter.Config };
declare const plugin: ESLint.Plugin & { configs: typeof configs };
export { plugin as default };

🤖 Generated with Claude Code

Viktor Pasynok and others added 2 commits August 12, 2026 17:55
TSESLint-flavored exports made eslint's defineConfig consumers see
a type error on configs.recommended. The plugin object is now
ESLint.Plugin and configs are Linter.Config; type-tests pin both
defineConfig and tseslint.config consumer scenarios.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Versions are set by the release pipeline; unreleased changelog
entries belong under Unreleased.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@binjospookie
binjospookie requested a review from a team August 12, 2026 10:55
@binjospookie
binjospookie merged commit a3ad0ca into main Aug 12, 2026
1 check passed
@binjospookie
binjospookie deleted the fix/eslint-plugin-core-types branch August 12, 2026 10:56
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.

1 participant