-
Notifications
You must be signed in to change notification settings - Fork 0
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
Switch to Biome #58
Merged
Merged
Switch to Biome #58
Conversation
This file contains 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
This allows us to visualise the diff more easily in GitHub pull requests, for instance (the `bun.lockb` file is a binary)
68e6725
to
ac47135
Compare
We'll add Biome to replace these in the next commit
ac47135
to
61e9c3c
Compare
Biome is a linter and formatter built in Rust (fast). We're going to try this as an alternative to ESLint or Standard. It has an opinionated default config, but we can extend it if we like. I've configured it so that [all rules are turned on](https://biomejs.dev/reference/configuration/#linterrulesall), except the more experimental [nursery rules](https://biomejs.dev/reference/configuration/#linterrulesgroup) Using an exact version of the package is recommended: https://biomejs.dev/internals/versioning The state names are converted to regular camelcase here. There appears to be no particular default/convention for this, so following Biome's default seems the most sensible: https://stately.ai/blog/2024-01-23-state-machines-whats-in-a-name#what-style-should-that-name-be-in
By default, Bun will respect shebang lines in CLIs that indicate that they should be executed with Node. We could force the use of Bun in CLIs (like `eslint` and `stylelint`) using `--bun`, but this will sometimes lead to unexpected behaviour. Playwright doesn't seem to work very well, for instance Meanwhile, using `nodenv` (which is fairly standard at dxw) without specifying a `.node-version` can lead to errors like the following when running CLIs that try to use it: ``` nodenv: node: command not found The `node' command exists in these Node versions: 16.17.0 20.9.0 20.10.0 20.11.0 ``` This adds a `.node-version` to fix this issue See: - https://bun.sh/docs/cli/run#bun - https://bun.sh/docs/cli/bunx#shebangs
In `github.com/dxw` repos, we use [doc/architecture/decisions][] in 46 files, [doc/adr][] in 14 files, and [docs/decisions][] in 2 (both in this repo) We've used the `doc/architecture/decisions` on RODA and Approved Premises externally (and probably other repos). `doc/adr` is the default for [adr-tools][] and what we used on Accredited Programmes, but the example override on `adr-tools` uses `doc/architecture/decisions` This moves us to our most common pattern, adds the default ADR generated by `adr-tools` backdated to the same date as our previously-first ADR, and fixes the ADR numbering [adr-tools]: https://github.com/npryce/adr-tools?tab=readme-ov-file [doc/adr]: https://github.com/search?q=org:dxw+path:doc/adr&type=code [doc/architecture/decisions]: https://github.com/search?q=org:dxw+path:doc/architecture&type=code [docs/decisions]: https://github.com/search?q=org:dxw+path:docs/decisions&type=code
905adb7
to
a3103c3
Compare
jkempster34
reviewed
Feb 15, 2024
These are VSCode extensions that support various pieces of tech we use on this project: Biome, Bun, Playwright, and XState
a3103c3
to
7c72f57
Compare
richpjames
approved these changes
Feb 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this Ynda.
I think we should wait for @lookupdaily before merging but I am keen to stop talking about linting soon 😅
lookupdaily
approved these changes
Feb 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do it
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.
Today we discussed giving this shiny new linter/formatter a try instead of ESLint or Standard. By default, it doesn't care about all the things we had ESLint rules for, but we were having some issues with ESLint (and Standard) and I'm outvoted on being overly pedantic! This seems to be very quick, and the entire test suite runs very quick right now
Closes #57