Repository navigation
Conversation
…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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Deploying code-style with
|
| 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 |
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 18 |
| Duplication | 0 |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds an opt-in
canonicalPluginNamesoption topleaseai(). When it is on,@typescript-eslintandnare registered under their canonical names instead of antfu'sts/node, so Bun'sbun lintcan 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
defaultPluginRenamingalready maps@typescript-eslint→tsandn→node. Layering the reverse on top makes the map a swap, so a user config that writes canonical@typescript-eslint/*rules would flip back tots/*and fail to resolve.Instead, the option sets
autoRenamePlugins: falseand applies antfu's map minus those two entries, plusts→@typescript-eslintandnode→n. If the user also passesautoRenamePlugins: false, only the two canonical renames apply.Behavior
ts/*andnode/*keys in configrules(options and user configs) are renamed automatically.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: newPleaseaiOptionsinterface and the option.packages/eslint-config/test/index.test.ts: new file with 3 bun tests.packages/eslint-config/package.json: newtestscript.apps/docseslint-config/advanced.mdx(en/ko).Verification
bun testinpackages/eslint-config: 3 pass.bun run lintat the repo root: clean.bun run build+bun run lint:docsinapps/docs: 22 files lint clean.ts/nodeplugins or rule prefixes remain when the option is on.Not in scope / follow-ups
@stylistic→bun fmt).bun lint; it is canary-only.canonicalPluginNamesis the issue's example name.Related issue
Closes #56
Checklist
bun run build)bun run lint)BREAKING CHANGE:note is includedSummary by cubic
Adds an opt-in
canonicalPluginNamesoption sopleaseai()registers@typescript-eslintandnunder their original names instead of antfu'sts/nodealiases, lettingbun lintrun those rules natively. Implements item 1 of #56 (106 → 133 native rules).Behavior:
ts/*andnode/*keys in configrulesare renamed automatically; inlineeslint-disablecomments using them must be updated by hand.autoRenamePluginsand substituting canonical names, since reversing antfu's renames on top would swap them back.testscript, and en/ko docs.Written for commit 972cfea. Summary will update on new commits.