Skip to content

Lint: enable stricter Biome rules and fix surfaced issues - #182

Merged
ryukzak merged 6 commits into
mainfrom
force-lint
Jun 18, 2026
Merged

Lint: enable stricter Biome rules and fix surfaced issues#182
ryukzak merged 6 commits into
mainfrom
force-lint

Conversation

@ryukzak

@ryukzak ryukzak commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Tightens the Biome ruleset beyond recommended to ratchet code quality, plus fixes the issues those rules surfaced.

Tier 1 — new rules at error (0 violations, pure ratchet)

  • correctness: noUnusedVariables, noUnusedFunctionParameters
  • complexity: noUselessFragments
  • style: useImportType, useExportType, useThrowOnlyError, useDefaultSwitchClause, noEnum, useFilenamingConvention

Tier 2 — new rules at warn + fixes

Added at warn level, then resolved each (one commit per rule):

  • noFloatingPromises — fixed 6 unawaited async calls. These were real bugs: cleanup() in builder.ts raced against generators writing the output dir, and writeNdjson/writeJsonFiles let IntrospectionWriter.generate() resolve before files finished writing.
  • noUselessElse — converted 7 else-after-return blocks to guard clauses (matches house style).
  • noEmptyBlockStatements — documented the intentional empty catch in the mustache config loader.
  • useTopLevelRegex — hoisted 7 hot-path regex literals to module scope; disabled the rule for test/examples (one-shot assertions get no runtime benefit). Python generator sites left as-is per scope.

noMisplacedAssertion remains at warn (31 test-only hits) for a follow-up cleanup.

Config diff (biome.json)

// before
"style": {
  "useConsistentArrayType": "error",
  "useArrayLiterals": "error",
  "noNestedTernary": "error"
}

// after
"style": {
  "useConsistentArrayType": "error",
  "useArrayLiterals": "error",
  "noNestedTernary": "error",
  "useImportType": "error",
  "useExportType": "error",
  "useThrowOnlyError": "error",
  "useDefaultSwitchClause": "error",
  "noEnum": "error",
  "useFilenamingConvention": "error",
  "noUselessElse": "warn"
},
"performance": { "useTopLevelRegex": "warn" },
"nursery": { "noFloatingPromises": "warn" }

Example before/after for the noFloatingPromises fix:

// before — generate() resolves before files are written
this.writeNdjson(tsIndex.schemas, this.opts.typeSchemas, typeSchemaToJson);

// after
await this.writeNdjson(tsIndex.schemas, this.opts.typeSchemas, typeSchemaToJson);

@ryukzak
ryukzak merged commit f1c0da7 into main Jun 18, 2026
39 checks passed
@ryukzak
ryukzak deleted the force-lint branch June 18, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant