Skip to content

chore: add biome for linting/formatting + CI action for linting in SRC folder#1284

Merged
Azgaar merged 44 commits into
Azgaar:masterfrom
SheepFromHeaven:chore/add-biome
Jan 26, 2026
Merged

chore: add biome for linting/formatting + CI action for linting in SRC folder#1284
Azgaar merged 44 commits into
Azgaar:masterfrom
SheepFromHeaven:chore/add-biome

Conversation

@SheepFromHeaven

@SheepFromHeaven SheepFromHeaven commented Jan 26, 2026

Copy link
Copy Markdown
Collaborator

Description

Type of change

  • Bug fix
  • New feature
  • Refactoring / style
  • Documentation update / chore
  • Other (please describe)

Versioning

  • Version is updated
  • Changed files hash is updated

SheepFromHeaven and others added 30 commits January 11, 2026 20:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Added HeightmapGenerator class for generating heightmaps with various tools (Hill, Pit, Range, Trough, Strait, etc.).
- Introduced Voronoi class for creating Voronoi diagrams using Delaunator.
- Updated index.html to include new modules.
- Created index.ts to manage module imports.
- Enhanced arrayUtils and graphUtils with type definitions and improved functionality.
- Added utility functions for generating grids and calculating Voronoi cells.
chore: add npm + vite for progressive enhancement
…utils-to-ts

Refactor: migrate utils to typescript
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
Update copilot guidelines for NPM/Vite/TypeScript architecture
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/Fantasy-Map-Generator into refactor/migrate-modules
…modules

feat: Implement HeightmapGenerator and Voronoi module
@netlify

netlify Bot commented Jan 26, 2026

Copy link
Copy Markdown

Deploy Preview for afmg ready!

Name Link
🔨 Latest commit 309b386
🔍 Latest deploy log https://app.netlify.com/projects/afmg/deploys/6977b89ac53dd1000866cf2e
😎 Deploy Preview https://deploy-preview-1284--afmg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SheepFromHeaven

Copy link
Copy Markdown
Collaborator Author

this should be a good one early on in our refactor. To keep consistent styling. I chose biome for speed reasons.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Biome as the formatter/linter for the TypeScript sources and wires it into both local tooling and CI, while applying Biome-driven formatting and a few small safety/consistency tweaks across the src tree. It also adds an initial unit test for stringUtils.round.

Changes:

  • Added Biome configuration (biome.json), npm scripts (lint, format), and a GitHub Actions workflow to enforce linting on pushes and PRs.
  • Reformatted and lightly refactored multiple utilities and modules in src/ to satisfy Biome rules (e.g., parseInt radix, Number.isNaN, stronger typing, safer optional handling).
  • Introduced a Vitest unit test for round in stringUtils, exercising behavior with undefined input.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/unitUtils.ts Refactored temperature and SI helpers to use template strings and explicit parseInt radix for Biome compliance.
src/utils/stringUtils.ts Reformatted helpers, adjusted regex style, and suppressed unused error variables in JSON helpers; core behavior otherwise unchanged.
src/utils/stringUtils.test.ts Added a Vitest test asserting round(undefined) returns an empty string (currently not satisfied by implementation; see inline comment).
src/utils/probabilityUtils.ts Reordered imports, reformatted functions, used Number.isNaN and exponent operator, and expanded gauss for clarity.
src/utils/polyfills.ts Reflowed polyfill implementations and typings for replaceAll, flat, and async iterator on ReadableStream without altering behavior.
src/utils/pathUtils.ts Reformatted path/isolines utilities, improved typed options, and made internal closures more explicit while preserving existing logic.
src/utils/numberUtils.ts Switched Math.pow to exponent operator and added semicolons; numeric behavior remains the same.
src/utils/nodeUtils.ts Converted helper functions to arrow functions and tightened parent typing without changing semantics.
src/utils/languageUtils.ts Replaced new RegExp with regex literals, made heavy use of template strings, and slightly clarified getAdjective implementation.
src/utils/index.ts Reordered imports and window augmentations for consistency, and wrapped several window-exposed bindings for clarity while keeping the global API stable.
src/utils/graphUtils.ts Reorganized imports, strengthened typings (Cells, Vertices, Point), and refactored several helpers (Voronoi grid, quadtree search, height drawing) for readability and safer numeric handling.
src/utils/functionUtils.ts Reformatted rollups and distanceSquared and clarified internal nest helper signature.
src/utils/debugUtils.ts Reordered imports, expanded drawing helpers (drawPoint, drawPath) and ensured window typings reflect debug helpers.
src/utils/commonUtils.ts Reformatted utility helpers, added safer setTimeout usage, enforced parseInt radix, and slightly clarified prompt initialization logic.
src/utils/colorUtils.ts Split d3 imports, added type annotations, and refactored color helpers to use template strings and explicit HEX formatting.
src/utils/arrayUtils.ts Clarified deep-copy helper internals, made cf map typing more generic, and improved typed-array factory assertion messaging.
src/types/global.ts Normalized imports to double quotes and converted PackedGraph import to a type-only import.
src/types/PackedGraph.ts Reformatted TypedArray union across multiple lines and kept PackedGraph layout intact.
src/modules/voronoi.ts Switched Delaunator import to type-only, restructured Voronoi fields and methods formatting, and slightly clarified some math operations.
src/modules/river-generator.ts Reorganized imports, reformatted class methods, improved naming/spacing in river generation logic, and made some numeric expressions clearer.
src/modules/ocean-layers.ts Simplified imports, reordered parameters, and made vertex connection logic and path generation more readable.
src/modules/lakes.ts Reordered imports, converted PackedGraphFeature to a type import, and clarified lake climate calculations and cleanup logic.
src/modules/index.ts Ensured module side-effect imports include ./biomes with a trailing semicolon to keep module initialization order consistent.
src/modules/heightmap-generator.ts Renamed class to HeightmapModule, updated the global type, and significantly reformatted heightmap generation while preserving algorithmic behavior.
src/modules/features.ts Reorganized imports from ../utils, refactored feature-markup helpers for clarity, and made use of clipPoly and connectVertices more explicit.
src/modules/biomes.ts Reformatted biome configuration data, clarified arrays (names, colors, costs), and expanded define and getId signatures.
package.json Added @biomejs/biome devDependency and lint/format scripts invoking Biome.
package-lock.json Locked @biomejs/biome and its platform-specific binary packages, and updated dependency metadata accordingly.
biome.json New Biome configuration enabling formatter and linter for src/**/*.ts, with customized rules (including useParseIntRadix and noUnusedVariables).
.github/workflows/lint.yml New GitHub Actions workflow running biome ci . on push and PR to enforce linting/formatting in CI.

Comment thread src/utils/stringUtils.test.ts
@SheepFromHeaven

Copy link
Copy Markdown
Collaborator Author

ready for merge

@Azgaar Azgaar merged commit 9db40a5 into Azgaar:master Jan 26, 2026
7 checks passed
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.

4 participants