Skip to content

🔧 Biome - Turn on noCommonJs so a require call fails lint, not the Tina admin - #2808

Merged
bradystroud merged 1 commit into
mainfrom
bs/biome-no-commonjs
Nov 13, 2026
Merged

bradystroud merged 1 commit into
mainfrom
bs/biome-no-commonjs

Conversation

@bradystroud

Copy link
Copy Markdown
Member

Description

✏️ Follow-up to #2807.

A require call 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 /admin finds it.

  • style/noCommonJs is an error for the application code.
  • The rule is off for the root config files (*.js) and scripts/. Those are CommonJS Node scripts, and nothing bundles them.
  • lib/appInsights.server.ts keeps its two require("applicationinsights") calls, with a biome-ignore comment that gives the reason.

Tests

Note

The existing override in biome.json uses "*.ts", "*.tsx", "*.mts" and "*.cts". In Biome 2 these patterns match only files in the root folder, not in app/, components/ or lib/. So the TypeScript rules in that override (for example useConst: "error" and noVar: "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

…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
@bradystroud
bradystroud merged commit 2313df1 into main Nov 13, 2026
1 check passed
@bradystroud
bradystroud deleted the bs/biome-no-commonjs branch November 13, 2026 00:09

This branch was previously deployed

1 inactive deployment
staging — e18765a8 Deployed Nov 13, 2026 by bradystroud via Delete PR Slot #200
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.

2 participants