Lint: enable stricter Biome rules and fix surfaced issues - #182
Merged
Conversation
…type, throw-only-error, default switch clause, no-enum)
…s-else, empty-block, top-level-regex, misplaced-assertion)
…ptyBlockStatements)
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.
Tightens the Biome ruleset beyond
recommendedto ratchet code quality, plus fixes the issues those rules surfaced.Tier 1 — new rules at
error(0 violations, pure ratchet)correctness:noUnusedVariables,noUnusedFunctionParameterscomplexity:noUselessFragmentsstyle:useImportType,useExportType,useThrowOnlyError,useDefaultSwitchClause,noEnum,useFilenamingConventionTier 2 — new rules at
warn+ fixesAdded at
warnlevel, then resolved each (one commit per rule):noFloatingPromises— fixed 6 unawaited async calls. These were real bugs:cleanup()inbuilder.tsraced against generators writing the output dir, andwriteNdjson/writeJsonFilesletIntrospectionWriter.generate()resolve before files finished writing.noUselessElse— converted 7else-after-return blocks to guard clauses (matches house style).noEmptyBlockStatements— documented the intentional emptycatchin the mustache config loader.useTopLevelRegex— hoisted 7 hot-path regex literals to module scope; disabled the rule fortest/examples(one-shot assertions get no runtime benefit). Python generator sites left as-is per scope.noMisplacedAssertionremains atwarn(31 test-only hits) for a follow-up cleanup.Config diff (
biome.json)Example before/after for the
noFloatingPromisesfix: