Repository navigation
fix: Add a helper for naming-convention overrides - #79
Merged
Merged
Conversation
slifty
force-pushed
the
77-naming-convention-helper
branch
from
November 6, 2026 22:32
dc197c6 to
8b3c022
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the narrowly scoped helper and documentation changes preserve the existing default configuration.
No open issues 🎉
What changed in this PR
This pull request adds a public helper for selectively replacing @typescript-eslint/naming-convention entries while preserving the remaining shipped conventions. The default configuration remains unchanged.
Changes:
- Extracts naming-convention entries into a reusable internal collection.
- Adds and exports
namingConventionOptionsWithoutand its supporting types. - Documents selector overrides and grouped-entry behavior.
- Adds tests covering filtering, validation, errors, and consumer overrides.
| File | Description |
|---|---|
src/test/naming-convention-options.test.ts |
Tests helper behavior, validation, grouped entries, and consumer configuration overrides. |
src/index.ts |
Exports the helper and its public TypeScript types. |
src/configs/typescript.ts |
Defines the reusable naming-convention options and selector-filtering helper. |
README.md |
Documents how consumers can customize selected naming conventions. |
Review effort: Lite
slifty
force-pushed
the
77-naming-convention-helper
branch
3 times, most recently
from
November 10, 2026 18:28
d5b3f0c to
a196964
Compare
The rule takes its whole option list at once, and typescript-eslint ranks entries by specificity before order, so prepending an override can silently lose to one of ours. Omitting our entries for a selector leaves nothing to compete with the project's own. Issue #77 Make it easier to override parts of `@typescript-eslint/naming-convention` Claude-Session: 186d8b34-8577-4116-b28f-8ac21758843c
slifty
force-pushed
the
77-naming-convention-helper
branch
from
November 10, 2026 18:29
a196964 to
dfa6872
Compare
slifty
enabled auto-merge
November 10, 2026 18:30
|
🎉 This PR is included in version 10.33.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
This PR lets projects change our
@typescript-eslint/naming-conventionchoices for specific selectors without restating the rest.namingConventionOptionsWithout([...selectors])returns our entries minus every entry for those selectors, and the project adds its own. The shipped config is unchanged, so this is a patch release.Closes #77
Testing
npm run lintandnpm testpass.variablewith snake_case and confirm thatconstvariables follow the override while entries that weren't omitted stay enforced.module: nodenext) against the exported types.Notes for agentic reviewers
naming-convention-utils/validator.js), so prepending an override loses to any more specific entry of ours (e.g. ourvariable+const). Omitting whole selectors avoids that.destructured,unused). This is intentional and documented in the README.typePropertykeepsobjectLiteralProperty. The helper throws for a selector with no entry (e.g.class, which we cover only throughtypeLike).unknown[]in its public declarations, so there's no type to derive from, and a hand-written union would drift. Typos still fail at config load: the helper throws for any selector we have no entry for, and ESLint validates the project's own entries against the rule's schema.🤖 Generated with Claude Code (session 186d8b34-8577-4116-b28f-8ac21758843c)