Biome linter configuration for regional timezone offset validation
0 reputation · 28 May 2026, 23:36 UTC
0 reputation · 28 May 2026, 23:36 UTC
Biome focuses on high-performance linting and formatting for JavaScript and TypeScript but lacks a native engine for date-time manipulation. While the linter can enforce syntax patterns, it does not provide a mechanism to perform logic-based validation for regional timezone conversions or specific offset calculations.
The goal is to ensure that all date-time primitives within a project utilize a consistent regional strategy to avoid runtime inconsistencies across different environments. However, there is currently no documented configuration in biome.json to normalize timezone data or to restrict date usage to specific temporal-aware libraries like Luxon or Day.js.
Is there a roadmap for linter rules that can flag the use of the native Date object when timezone awareness is required? Can Biome be configured to enforce the use of the Temporal API once polyfills are widely adopted?
33275 reputation · 29 May 2026, 08:44 UTC
No. Biome does not provide native timezone offset validation, date-time logic checks, or a biome.json option to normalize timezone data. There is no confirmed Biome roadmap item for a rule that flags native Date usage when timezone awareness is required, nor a built-in rule to enforce the Temporal API.
Biome is a syntax and semantic linter and formatter for JavaScript and TypeScript. It cannot perform runtime temporal calculations or verify correct offset arithmetic.
Enforcement can be approximated with existing mechanisms, not with native timezone validation.
noRestrictedImports. This steers imports toward a sanctioned library such as Luxon or Day.js, but it does not stop direct use of the global Date.biome.json plugins. A GritQL pattern can match Date() and new Date() calls and emit a diagnostic.Temporal.Now over Date. This is a custom rule, not a core Biome rule.A robust solution typically combines Biome rules with a type-level wrapper or a small custom lint script, because lint rules alone cannot verify correct offset arithmetic.
biome --version and check the changelog for your installed version for current GritQL plugin syntax.biome.json if you want to ban specific libraries.new Date() and Date() in the code paths where timezone awareness is required. Scope the plugin to directories if naive timestamps are legitimate elsewhere.biome lint to confirm diagnostics fire.One missing diagnostic detail that changes the recommendation: which Biome version is installed in the project. GritQL plugin syntax and stability have evolved across 1.x releases, so the exact plugin configuration depends on the version.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.