mirror of
https://github.com/Unleash/unleash.git
synced 2026-10-23 20:37:06 +00:00
chore: forbid Node.js builtin imports in frontend source
- Turns on Biome's `correctness/noNodejsModules` for `oss/frontend/src/**`. - #2019 imported `node:util` in a frontend file. Type check, unit tests and the build passed, and the app broke in the browser (fixed in #2029). This makes that import a lint error. - Checked against the #2019 version of `strategy-change-diff-calculation.ts`: lint fails on the import. Current `main` passes with no hits, so no source changes are needed. - Scoped to `src` so `vite.config.mts` and the Cypress config can keep using Node builtins. - Does not cover a dependency that imports a Node builtin. That still needs a runtime check.
This commit is contained in:
+8
-1
@@ -99,7 +99,14 @@
|
||||
},
|
||||
{
|
||||
"includes": ["frontend/src/**"],
|
||||
"plugins": ["./tracking-shape.grit"]
|
||||
"plugins": ["./tracking-shape.grit"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noNodejsModules": "error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"includes": [
|
||||
|
||||
Reference in New Issue
Block a user