Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biome formatting/linting fixes #59

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

jmuzina
Copy link
Member

@jmuzina jmuzina commented Dec 5, 2024

Done

Running check:ts on check:fix

Running bun run check:fix will now also run Typescript type-checking, if that package uses Typescript. Currently, running check:fix may pass, but running check immediately after may fail (because the check command does not also type-check). This makes the check:fix command more indicative of the check status of the repository after it is completed, meaning you don't need to run check after check:fix to be sure that tests will pass.

Removing usage of unsupported glob syntax

Globstar (**) expansion

The biome check glob arguments behave differently on different shells. Running biome check src/**/*.ts directly in a shell has been seen to have different behavior than running that same command from within a package.json script, meaning that files that are deeply nested enough can escape linting and formatting.

See related issue on Biome.

Brace expansion ({a,b})

Brace expansion is handled differently by different shells and has inconsistent behavior. Biome plans to implement it themselves; It will be released in v2. Until then, we should not use brace expansion, as it can lead to files not being tested.

Glob syntax solution:

This PR removes usages of brace and globstar expansion, instead directly checking directories and allowing Biome to check all files it has support for.

Un-formatted files have been formatted

Due to the above glob inconsistencies, some files were not being checked. They are now properly checked by Biome, and their changes have been added to this PR.

Consistent Biome dev dependency

Prior to this PR, some packages used Biome for formatting and linting but did not explicitly depend on it - their checking was only working because other packages in the monorepo depend on Biome. This PR adds explicit dev depencies on Biome where applicable.

I have also updated packages to use the latest version of Biome & its configuration schema.

Issues fixed

PR readiness check

  • PR should have one of the following labels:
    • Feature 🎁, Breaking Change 💣, Bug 🐛, Documentation 📝, Maintenance 🔨.
  • All packages define the required scripts in package.json: build, check, and check:fix.

@advl advl merged commit 39ef575 into canonical:main Dec 9, 2024
2 checks passed
@jmuzina jmuzina deleted the package-script-cleanup branch December 9, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add biome devDependency for packages that use it
2 participants