Repository navigation
🔧 Biome - Turn on noCommonJs so a require call fails lint, not the Tina admin - #2808
Merged
Merged
Conversation
…na admin A require call in code that the Tina admin bundles stops the admin in the browser (#2807). The CI admin build passes with such a call, and Jest runs CommonJS, so only a person who opens /admin finds it. - style/noCommonJs is an error for the application code. - The rule is off for the root config files (*.js) and scripts/, which are CommonJS Node scripts. - lib/appInsights.server.ts keeps its two require calls, with a biome-ignore comment that gives the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UTtNDpWnuaUUQ2winSSgMb
AntPolkanov
approved these changes
Nov 13, 2026
This branch was previously deployed
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.
Description
✏️ Follow-up to #2807.
A
requirecall in code that the Tina admin bundles stops the admin in the browser (Dynamic require of ... is not supported). Nothing catches it before production: the CI admin build passes with such a call, and Jest runs CommonJS. So only a person who opens/adminfinds it.style/noCommonJsis an error for the application code.*.js) andscripts/. Those are CommonJS Node scripts, and nothing bundles them.lib/appInsights.server.tskeeps its tworequire("applicationinsights")calls, with abiome-ignorecomment that gives the reason.Tests
pnpm lintpasses.require("prismjs/components/prism-csharp")) inlib/and incomponents/fails lint withlint/style/noCommonJs.Note
The existing override in
biome.jsonuses"*.ts","*.tsx","*.mts"and"*.cts". In Biome 2 these patterns match only files in the root folder, not inapp/,components/orlib/. So the TypeScript rules in that override (for exampleuseConst: "error"andnoVar: "error") do not apply to most files. This pull request does not change that.Screenshot (optional)
✏️ Not applicable.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UTtNDpWnuaUUQ2winSSgMb