Skip to content

feat(naming): add opt-in allowedWords for Roblox names - #662

Merged
christopher-buss merged 1 commit into
mainfrom
claude/naming-convention-allowed-words-9f5fc7
Aug 12, 2026
Merged

feat(naming): add opt-in allowedWords for Roblox names#662
christopher-buss merged 1 commit into
mainfrom
claude/naming-convention-allowed-words-9f5fc7

Conversation

@christopher-buss

Copy link
Copy Markdown
Owner

Why

strictCamelCase and StrictPascalCase reject two capitals in a row, which puts them at odds with Roblox's own casing. A CFrame had to be stored in targetCframe, so the identifier stopped matching the type it held. The existing escapes are too blunt: filter skips a whole config, custom only adds constraints.

eslint-plugin-flawless@1.7.0 adds allowedWords, which lets listed words keep their own casing while the rest of the name is still checked. This wires that up for Roblox, off by default.

What changed

Plugin bumpeslint-plugin-flawless 1.5.1 → 1.7.0. pnpm gen picks allowedWords out of the rule schema, so NamingSelector gains it with no manual type work. 1.6.0/1.6.1 ride along; no snapshot drift.

New optionnaming: { allowedWords }, default false.

export default isentinel({
	naming: { allowedWords: true },
});
const targetCFrame = new CFrame(); // ok
const listLayoutUIPadding = 0; // ok
const target_CFrame = 0; // still an error

true uses the generated Roblox list; an array uses exactly those words. ROBLOX_ALLOWED_WORDS is exported so a consumer can spread it to extend rather than replace.

It is set once as settings.flawless.namingConvention.allowedWords on the isentinel/naming/setup item, rather than copied onto ~10 selectors across the TS and TSX blocks. That also means it reaches selectors passed through naming.selectors; a selector opts out with its own allowedWords: []. The settings key is spread in conditionally, so the default emits no new config surface and existing snapshots are untouched.

Generated word listscripts/roblox-allowed-words-gen.ts scrapes @rbxts/types and writes src/generated/roblox-allowed-words.ts.

Why the list is 67 words, not thousands

Only names holding two capitals in a row can trip the strict formats. That is 82 of the 1534 names @rbxts/types declares (datatypes, Instance classes, Enum.* namespaces). Pruning names a shorter word already resolves — CFrame absorbs CFrameValue, CFrameConstructor and UserCFrame; UDim absorbs UDim2 — leaves 67.

For comparison, the raw Roblox API-Dump.json yields 400. The extra ~320 are member and enum-item names, which are property accesses (Enum.TextXAlignment.Center) rather than declared identifiers, so naming-convention never sees them. @rbxts/types is the surface that actually produces identifier names in roblox-ts.

The existing @isentinel/dict-roblox could not be reused — it is case-flattened (cframe, not CFrame).

roblox-allowed-words-shared.ts mirrors flawless's own applyAllowedWords, so the pruning asks exactly the question the rule asks at lint time. Sorting is by code unit rather than localeCompare, so the output does not depend on the host locale.

Reviewer notes

  • @rbxts/types is a devDependency and the scrape runs at build time. A consumer may pin a different version, or none, and parsing ~4MB of .d.ts on every config load to answer a question that only changes on a bump is not worth it. Same rationale as stylistic-gen.ts and type-aware-gen.ts.
  • nr check:roblox-words runs in CI before the build, since pnpm gen would otherwise repair a stale snapshot in place and the drift would never be reported. test/roblox-allowed-words.spec.ts re-derives from the installed package and fails on drift.
  • No oxlint work — flawless/naming-convention is pinned to ESLint in src/oxlint/routing.ts.
  • Open question: the list is fully mechanical, so it includes a few Studio-internal names nobody writes (QDir, QFont, RBXObject, ILegacyStudioBridge, DebuggerUIService). Filtering them would mean hand-maintaining a denylist — the only non-generated part of the pipeline. They are harmless, so they stayed. Happy to add the denylist if preferred.

Verification

pnpm gen, pnpm typecheck, pnpm build, pnpm lint and pnpm test all pass locally (39 files, 558 tests, no type errors). test/naming-allowed-words.spec.ts lints through the real setup item: targetCFrame errors by default and passes when enabled, while target_CFrame and targetXCFrame still error.

🤖 Generated with Claude Code

strictCamelCase and StrictPascalCase reject two capitals in a row, so a
CFrame had to be stored in targetCframe and the identifier stopped
matching the type it held. flawless 1.7.0 adds allowedWords, which lets
listed words keep their own casing while the rest of the name is still
checked.

Bumps flawless 1.5.1 -> 1.7.0 and adds `naming: { allowedWords }`, off by
default. `true` uses the generated Roblox list, an array uses exactly
those words. Set once as settings.flawless.namingConvention.allowedWords
on isentinel/naming/setup, so it reaches the TS and TSX blocks and any
user selectors; a selector opts out with its own `allowedWords: []`.

The list is generated, not hand-maintained. Only names holding two
capitals in a row can trip the strict formats, which is 82 of the 1534
names @rbxts/types declares. Pruning names a shorter word already
resolves - CFrame absorbs CFrameValue, CFrameConstructor and UserCFrame,
UDim absorbs UDim2 - leaves 67. roblox-allowed-words-shared.ts mirrors
flawless's own applyAllowedWords so the pruning asks the question the
rule asks at lint time.

@rbxts/types is a devDependency and the scrape runs at build time: a
consumer may pin a different version, or none, and parsing ~4MB of .d.ts
on every config load to answer a question that only changes on a bump is
not worth it. `nr check:roblox-words` runs in CI before the build, since
`pnpm gen` would otherwise repair a stale snapshot in place and the drift
would never be reported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for beamish-daffodil-b0f61d ready!

Name Link
🔨 Latest commit 6a50121
🔍 Latest deploy log https://app.netlify.com/projects/beamish-daffodil-b0f61d/deploys/6a7bcf9a02a9bf0008a91af0
😎 Deploy Preview https://deploy-preview-662--beamish-daffodil-b0f61d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@christopher-buss, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 15 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3cf69956-a2c4-418e-8db7-6d2bda798dd7

📥 Commits

Reviewing files that changed from the base of the PR and between c2ed278 and 6a50121.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/generated/roblox-allowed-words.ts is excluded by !**/generated/**
📒 Files selected for processing (12)
  • .github/workflows/ci.yaml
  • CLAUDE.md
  • README.md
  • package.json
  • pnpm-workspace.yaml
  • scripts/roblox-allowed-words-gen.ts
  • scripts/roblox-allowed-words-shared.ts
  • src/eslint/configs/naming.ts
  • src/eslint/index.ts
  • src/eslint/types.ts
  • test/naming-allowed-words.spec.ts
  • test/roblox-allowed-words.spec.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@christopher-buss
christopher-buss merged commit 59b2804 into main Aug 12, 2026
8 checks passed
@christopher-buss
christopher-buss deleted the claude/naming-convention-allowed-words-9f5fc7 branch August 12, 2026 02:01
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