Skip to content

Commit

Permalink
Replace Prettier with Biome
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Nov 17, 2024
1 parent d8dfbad commit 0915ff2
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 1,177 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The preset includes the following tools:

- **[ESLint](https://www.npmjs.com/package/eslint)** identifies and fixes problematic patterns in your code so you can spot mistakes early.
- **[Stylelint](https://www.npmjs.com/package/stylelint)** identifies and fixes problematic patterns in your styles so you can spot mistakes early.
- **[Prettier](https://prettier.io)** is our code formatter of choice. It makes all our code look the same after every save.
- **[Biome](https://biomejs.dev/)** formats your code to look the same after every save.
- **[lint-staged](https://www.npmjs.com/package/lint-staged)** is a tool for running linters on files staged for your next commit in git. Together with Husky (see below) it prevents problematic code from being committed.
- **[Husky](https://github.com/typicode/husky)** makes setting up git hooks very easy. Whenever someone installs your project, Husky will automatically set up git hooks as part of its `postinstall` script.

Expand Down
139 changes: 31 additions & 108 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"./eslint": "./dist/eslint.js",
"./husky": "./dist/husky.js",
"./lint-staged": "./dist/lint-staged.js",
"./prettier": "./dist/prettier.js",
"./stylelint": "./dist/stylelint.js",
"./biome": "./dist/biome.jsonc"
},
Expand Down Expand Up @@ -45,6 +44,9 @@
"dependencies": {
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@biomejs/biome": "1.9.4",
"@biomejs/js-api": "^0.7.1",
"@biomejs/wasm-nodejs": "^1.9.4",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.18.0",
"chalk": "^4.1.2",
Expand All @@ -60,7 +62,6 @@
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-notice": "^1.0.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-security": "^3.0.1",
Expand All @@ -71,7 +72,6 @@
"listr": "^0.14.3",
"listr-inquirer": "^0.1.0",
"lodash": "^4.17.21",
"prettier": "^3.3.3",
"read-pkg-up": "^7.0.1",
"semver": "^7.6.3",
"stylelint": "^16.10.0",
Expand All @@ -81,7 +81,6 @@
"yargs": "^17.7.2"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"@types/cross-spawn": "^6.0.6",
Expand All @@ -91,7 +90,6 @@
"@types/listr": "^0.14.9",
"@types/lodash": "^4.17.13",
"@types/node": "^18.19.0",
"@types/prettier": "^3.0.0",
"@types/semver": "^7.5.8",
"@types/yargs": "^17.0.33",
"@vitest/coverage-v8": "^2.1.4",
Expand Down
8 changes: 2 additions & 6 deletions src/cli/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export async function init({ $0, _, ...args }: InitParams): Promise<void> {
{
type: 'confirm',
name: 'useBiome',
message: 'Do you want to use Biome instead of Prettier to format code?',
message:
'Do you want to use Biome in addition to ESLint to lint code faster?',
default: DEFAULT_OPTIONS.useBiome,
when: (): boolean => typeof args.useBiome === 'undefined',
},
Expand All @@ -75,11 +76,6 @@ export async function init({ $0, _, ...args }: InitParams): Promise<void> {

const selectedTools: Record<string, ToolOptions> = tools;

if (options.useBiome) {
// biome-ignore lint/performance/noDelete:
delete selectedTools.prettier;
}

const files = getFilesForTools(options, selectedTools);

const scripts = getScripts(options);
Expand Down
Loading

0 comments on commit 0915ff2

Please sign in to comment.