build: configure Biome linting (#231)#422
Merged
Merged
Conversation
- Add biome.json (lint-only; recommended rules). Disabled rules that conflict with deliberate idioms: noAssignInExpressions (while ((m=re.exec()))), noDuplicateProperties/noDuplicateCustomProperties (intentional hex→oklch CSS fallbacks), noImplicitAnyLet (irrelevant for plain JS). - Add @biomejs/biome@2.5.0 devDep + 'lint'/'lint:fix' scripts + a 'Lint (Biome)' CI job. - Apply safe lint fixes (useOptionalChain, useIndexOf, noUselessContinue, unused imports) across plugins/tools/tests; fix a forEach implicit-return in diagrams.js. All 650 tests still pass.
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.
Configures a linter for the project (#231).
@biomejs/biome@2.5.0) withnpm run lint/npm run lint:fixscripts and a dedicated Lint (Biome) CI job.biome.jsonenables therecommendedruleset (lint-only; the formatter is left off to avoid a disruptive repo-wide reformat). Four rules are disabled because they conflict with deliberate, correct idioms in this codebase:noAssignInExpressions— the lexer/router use the conventionalwhile ((m = re.exec(s)))/if ((m = path.match(...)))pattern.noDuplicateProperties/noDuplicateCustomProperties— the Lab CSS intentionally declares a hex value then anoklch()value for progressive enhancement (added in Lab web frontend uses oklch() colors — Safari <15.4 and older browsers unsupported #214).noImplicitAnyLet— a TS-oriented rule that is noise for plain JS.useOptionalChain,useIndexOf,noUselessContinue, unused imports/vars) acrossplugins/,tools/,tests/, and fixed aforEachimplicit-return indiagrams.js.Verification
npm run lintexits 0 (errors resolved; remaining items are advisory warnings).node --test "tests/*.test.mjs"→ 650 pass, 0 fail (the shell-analyzer suite confirms the lexer auto-fixes are behavior-preserving).node scripts/validate-opencode-config.mjspasses;npm audit→ 0 vulnerabilities.Closes #231