Repository navigation
Add an opt-in Biome style check - #214
Merged
Merged
Conversation
Pin Biome 2.6.7 for a local check:style script. Leave unformatted legacy JS alone via a formatter override, and rename the valueOf parameter that shadowed a restricted global. Co-authored-by: Aviran Swissa <swissa.aviran@s.afeka.ac.il>
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.
Summary
Adds Biome 2.6.7 as a local, opt-in check, following the same setup as DoMeAfavor. CI workflows are unchanged.
biome.jsonuses schema 2.6.7. VCS is git withuseIgnoreFile.files.ignoreUnknownis true and only**/*.jsis included. The formatter uses spaces, indent 2, line width 120, single quotes, semicolons always, and no trailing commas (the style the existing JS already uses). Assist is off.package.jsonpins@biomejs/biomeat2.6.7and addscheck:style(biome check). Thetestscript is unchanged. This repo has nopackage-lock.json, so none was added.npm run check:stylein one Hebrew line and notes that the check does not run in CI.Formatter override
These existing files are not already formatted, so the formatter is disabled for them.
npx @biomejs/biome@2.6.7 checkdoes not rewrite them. New JS files are formatted.attic/proof-big5.jsattic/proof-body.jsattic/proof-composite.jsattic/proof-demo.jsattic/proof-identity.jsattic/proof-match.jsattic/proof-offball.jsattic/proof-tournament.jsattic/proof-xt.jsbasketball.jsdemo.jstest/basketball.test.jstest/byod.test.jstest/csv-export-with-provenance.test.jstest/data.test.jstest/demo.test.jstest/filter-by-position.test.jstest/lessonFirstStructure.test.jstest/links.test.jstest/pages.test.jstest/position-ut-audit.test.jstest/pr-size.test.jstest/trap.test.jstools/make-basketball-example.jstools/pr-size.jstrap.jsAlready formatted, so left under the formatter:
test/dom-ids.test.jstest/meta.test.jstest/panim.test.jstest/selected-fallback.test.jsRules downgraded to warn
Noisy legacy rules from the recommended preset, same set called out for this repo:
correctness.noInnerDeclarations(no current hits)suspicious.noRedeclare(no current hits)suspicious.noAssignInExpressions(hits in the current tree)suspicious.useIterableCallbackReturn(hits in the current tree)No other rule was downgraded.
Lint fix
One recommended-preset error remained:
rankOfinbasketball.jstook a parameter namedvalueOf, which shadows the restricted global. Renamed toreadValue. Call sites pass a function as the second argument, so behavior is unchanged.Checks
npx @biomejs/biome@2.6.7 checkexits 0 (371 warnings, 228 infos, 0 errors).npm run check:styleexits 0.npm test— 185 tests, 0 failures.