Skip to content

feat(eslint-config): add canonicalPluginNames option for native bun lint rules - #57

Draft
amondnet wants to merge 1 commit into
mainfrom
amondnet/feat-eslint-config-restore-canonical-plugin-name
Draft

amondnet wants to merge 1 commit into
mainfrom
amondnet/feat-eslint-config-restore-canonical-plugin-name

Conversation

@amondnet

@amondnet amondnet commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in canonicalPluginNames option to pleaseai(). When it is on, @typescript-eslint and n are registered under their canonical names instead of antfu's ts/node, so Bun's bun lint can run those rules natively. The issue reports 106→133 native rules. This is item 1 of the proposal in #56.

Why not a plain .renamePlugins({ ts: '@typescript-eslint', node: 'n' })

antfu applies renames in a single pass, and its defaultPluginRenaming already maps @typescript-eslint→ts and n→node. Layering the reverse on top makes the map a swap, so a user config that writes canonical @typescript-eslint/* rules would flip back to ts/* and fail to resolve.

Instead, the option sets autoRenamePlugins: false and applies antfu's map minus those two entries, plus ts→@typescript-eslint and node→n. If the user also passes autoRenamePlugins: false, only the two canonical renames apply.

Behavior

  • The default is off, so nothing changes for existing users.
  • When it is on, ts/* and node/* keys in config rules (options and user configs) are renamed automatically.
  • Inline eslint-disable … ts/… comments are not renamed. A real ESLint run reports "Definition for rule 'ts/no-unused-vars' was not found" for them. The docs say so.

Changes

  • packages/eslint-config/src/index.ts: new PleaseaiOptions interface and the option.
  • packages/eslint-config/test/index.test.ts: new file with 3 bun tests.
  • packages/eslint-config/package.json: new test script.
  • Docs: a "Canonical plugin names" subsection in the README (en/ko) and in apps/docs eslint-config/advanced.mdx (en/ko).

Verification

  • bun test in packages/eslint-config: 3 pass.
  • bun run lint at the repo root: clean.
  • bun run build + bun run lint:docs in apps/docs: 22 files lint clean.
  • Resolved-config check: no ts/node plugins or rule prefixes remain when the option is on.

Not in scope / follow-ups

  • Issue items 2 (eslint-plugin-import vs import-lite) and 3 (@stylistic → bun fmt).
  • The speedup was not re-measured with bun lint; it is canary-only.
  • The option name was marked "TBD" in the issue; canonicalPluginNames is the issue's example name.

Related issue

Closes #56

Checklist

  • PR title follows Conventional Commits
  • Packages build (bun run build)
  • Lint/format pass (bun run lint)
  • Documentation updated if behavior changed
  • No breaking change, or a BREAKING CHANGE: note is included

Summary by cubic

Adds an opt-in canonicalPluginNames option so pleaseai() registers @typescript-eslint and n under their original names instead of antfu's ts/node aliases, letting bun lint run those rules natively. Implements item 1 of #56 (106 → 133 native rules).

Behavior:

  • Off by default; existing behavior is unchanged.
  • ts/* and node/* keys in config rules are renamed automatically; inline eslint-disable comments using them must be updated by hand.
  • Renames apply by disabling autoRenamePlugins and substituting canonical names, since reversing antfu's renames on top would swap them back.
  • Adds bun tests, a test script, and en/ko docs.

Written for commit 972cfea. Summary will update on new commits.

Turn on auto-fix

…int rules

Add an opt-in canonicalPluginNames option to pleaseai(). It registers
@typescript-eslint and n under their canonical names instead of antfu's
ts and node aliases, so rule names resolve natively under bun lint.

The option turns off antfu's autoRenamePlugins and applies antfu's
defaultPluginRenaming minus those two entries, plus ts to @typescript-eslint
and node to n. Also add bun tests with a test script, and document the
option in the READMEs and the docs site (en/ko).

Closes #56
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying code-style with  Cloudflare Pages  Cloudflare Pages

Latest commit: 972cfea
Status: ✅  Deploy successful!
Preview URL: https://1e9e7b1d.code-style.pages.dev
Branch Preview URL: https://amondnet-feat-eslint-config.code-style.pages.dev

View logs

@sonarqubecloud

Copy link
Copy Markdown

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 18 complexity · 0 duplication

Metric Results
Complexity 18
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

feat(eslint-config): restore canonical plugin names so Bun's lint runs typescript-eslint and n natively

1 participant