-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Support biome.js as a linter / formatter option in the cli #2021
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: cbad9bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@aidansunbury is attempting to deploy a commit to the t3-oss Team on Vercel. A member of the Team first needs to authorize it. |
I checked it out locally, and from what I can tell, things are working. However, the format:check and format:write commands aren't working for me. Unfortunately, there's no biome format --check, and it's also impossible to specify file extensions to go through, as you can with Prettier. Another thing to consider: do you plan to do anything with the next lint commands inside the package.json file? |
Thanks for catching that! There are now three scripts added when you use biome. Check linting and formatting without applying fixes, apply only safe fixes, and apply unsafe fixes. They should all be working now, and biome only checks js/ts files anyways, so it is not needed to specify the file types. I removed the Also, as a minor refactoring note, I created an |
I thing Biome is cool as only a formatter until |
@TheCukitoDev Biome has three main commands: format, lint, and check (which runs the formatter and linter). I personally pretty much always just use the check command, so that is what I added in this pr, but would you from a dx perspective also prefer to have lint and format commands already included in the package.json? |
Closes #1973
✅ Checklist
Changelog
The CLI now prompts the user to select either eslint/prettier or biome as a formatting and linting option. If eslint/prettier is selected, the app is scaffolded the same way it always is. If biome is selected, files (prettier.config.js, .eslintrc.cjs) and all eslint/prettier related dependencies are no longer included and instead a biome.jsonc file is generated and @biomejs/biome is installed.
Prettier and eslint are enabled by default through cli flags, but a linter selection can now be specified with either an --eslint or --biome flag.
Additionally, the installation of prettier used to be tied to using tailwind css, meaning selecting no for "Will you be using Tailwind CSS for styling?" meant that prettier was not installed. A choice of formatter and a choice of using tailwind css should not be coupled, so now prettier will be installed so long as biome is not selected as a formatter. The 'prettier-plugin-tailwindcss' will only be configured in the prettier config file if tailwind css is selected.
For the biome.jsonc file, I just used the default configuration and added the use-sorted-classes nursery rule. I would love to hear thoughts on what should be in the default config, but making changes to the template file will not impact the changes to the functionality of this feature.
Screenshots
💯