-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use biome over ESLint and prettier (#1304)
* refactor: use biome formatting and check fix * refactor: remove eslint disabled rules * refactor: apply unsafe rules * refactor: refactor to comply with biome rules * fix: make biome default formatter * refactor: last biome fixes * test: adjust assertion * test: adjust more tests to not skip them * refactor: use codecov action * fix: remove matrix * chore: fix lockfile * Create famous-hotels-accept.md
- Loading branch information
Showing
54 changed files
with
492 additions
and
1,426 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@promster/apollo": patch | ||
"@promster/express": patch | ||
"@promster/fastify": patch | ||
"@promster/hapi": patch | ||
--- | ||
|
||
Refactor to use biome over ESLint and prettier |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[tools] | ||
node = "22.8" | ||
node = "22" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"tab.unfocusedActiveBorder": "#fff0" | ||
}, | ||
"gitdoc.enabled": false | ||
} | ||
"workbench.colorCustomizations": { | ||
"tab.unfocusedActiveBorder": "#fff0" | ||
}, | ||
"gitdoc.enabled": false, | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"vcs": { | ||
"clientKind": "git", | ||
"enabled": true, | ||
"useIgnoreFile": true | ||
}, | ||
"files": { | ||
"ignoreUnknown": true | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineEnding": "lf", | ||
"lineWidth": 80, | ||
"ignore": [ | ||
"**/package.json", | ||
"**/dist/**", | ||
"**/.changeset", | ||
"**/CHANGELOG.md", | ||
"**/pnpm-lock.yaml", | ||
"**/pnpm-workspace.yaml" | ||
] | ||
}, | ||
"organizeImports": { "enabled": true }, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"performance": { | ||
"noAccumulatingSpread": "off" | ||
}, | ||
"complexity": { | ||
"noVoid": "error" | ||
}, | ||
"correctness": { | ||
"noUndeclaredVariables": "error", | ||
"noUnreachableSuper": "error", | ||
"noUnusedVariables": "error", | ||
"useArrayLiterals": "error", | ||
"useExhaustiveDependencies": "warn" | ||
}, | ||
"style": { | ||
"noNegationElse": "error", | ||
"noRestrictedGlobals": { | ||
"level": "error", | ||
"options": { "deniedGlobals": ["event", "atob", "btoa"] } | ||
}, | ||
"useBlockStatements": "error", | ||
"useCollapsedElseIf": "error", | ||
"useConsistentArrayType": { | ||
"level": "error", | ||
"options": { "syntax": "shorthand" } | ||
}, | ||
"useForOf": "error", | ||
"useFragmentSyntax": "error", | ||
"useShorthandAssign": "error" | ||
}, | ||
"suspicious": { | ||
"noEmptyBlockStatements": "error", | ||
"noSkippedTests": "warn", | ||
"noExplicitAny": "off" | ||
} | ||
}, | ||
"ignore": ["**/node_modules/", "**/coverage/", "**/dist/"] | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"jsxQuoteStyle": "double", | ||
"quoteProperties": "asNeeded", | ||
"trailingCommas": "es5", | ||
"semicolons": "always", | ||
"arrowParentheses": "always", | ||
"bracketSpacing": true, | ||
"quoteStyle": "single" | ||
}, | ||
"globals": [ | ||
"it", | ||
"describe", | ||
"expect", | ||
"jest", | ||
"before", | ||
"beforeAll", | ||
"beforeEach", | ||
"after", | ||
"afterAll", | ||
"afterEach" | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* eslint-disable */ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
parserPreset: { | ||
|
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 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 file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
module.exports = { | ||
'packages/**/*.{ts,js}': ['npm run fix:eslint', 'npm run format:js'], | ||
'*.md': ['npm run format:md'], | ||
'*': [ | ||
'biome check', // Format, sort imports, lint, and apply safe fixes | ||
], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,18 @@ | |
"auth": "npm_config_registry=https://registry.npmjs.org npm whoami", | ||
"build:watch": "preconstruct watch", | ||
"build": "preconstruct build", | ||
"changeset:version-and-format": "changeset version && prettier --write --parser json '**/package.json' && pnpm install --no-frozen-lockfile", | ||
"changeset:version-and-format": "changeset version && pnpm format '**/package.json' && pnpm install --no-frozen-lockfile", | ||
"changeset": "changeset", | ||
"clean": "manypkg exec rm -rf build dist tsconfig.tsbuildinfo ts-build-cache", | ||
"develop": "jest --projects .jestrc.*.json --watch", | ||
"fix:eslint": "eslint --fix --format=node_modules/eslint-formatter-pretty", | ||
"format:js": "prettier --write '**/packages/**/*.{js,ts}'", | ||
"format:md": "prettier --parser markdown --write '*.md'", | ||
"format:yaml": "prettier --parser yaml --write '*.yaml'", | ||
"format": "npm run format:md && npm run format:js && npm run format:yaml", | ||
"lint": "jest --config .jestrc.lint.json", | ||
"develop": "jest --projects .jestrc.test.json --watch", | ||
"biome:check": "biome check --write", | ||
"biome:fix": "biome lint --write", | ||
"format": "biome format --write", | ||
"lint": "biome lint", | ||
"prerelease": "cross-env NODE_ENV=production pnpm auth && pnpm build", | ||
"release": "changeset publish", | ||
"setup": "husky install && preconstruct dev && manypkg check && check-node-version --package --print", | ||
"test:ci:coverage": "cross-env NODE_ENV=test npm test -- --no-watchman --coverage && codecov", | ||
"test:ci:coverage": "cross-env NODE_ENV=test npm test -- --no-watchman --coverage", | ||
"test:ci": "cross-env NODE_ENV=test npm test -- --no-watchman", | ||
"test:coverage": "cross-env NODE_ENV=test npm test -- --coverage", | ||
"test:watch": "cross-env NODE_ENV=test npm test -- --watch", | ||
|
@@ -51,9 +49,9 @@ | |
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@babel/core": "7.25.2", | ||
"@babel/eslint-parser": "7.25.1", | ||
"@babel/preset-env": "7.25.4", | ||
"@babel/preset-typescript": "7.24.7", | ||
"@biomejs/biome": "1.9.4", | ||
"@changesets/changelog-github": "0.5.0", | ||
"@changesets/cli": "2.27.8", | ||
"@commitlint/cli": "19.5.0", | ||
|
@@ -63,24 +61,12 @@ | |
"@tsconfig/node18": "18.2.4", | ||
"@types/node": "20.16.13", | ||
"@types/semver": "7.5.8", | ||
"@typescript-eslint/eslint-plugin": "7.7.1", | ||
"@typescript-eslint/parser": "7.7.1", | ||
"check-node-version": "4.2.1", | ||
"codecov": "3.8.3", | ||
"cross-env": "7.0.3", | ||
"eslint": "8.57.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-config-xo": "0.44.0", | ||
"eslint-config-xo-typescript": "4.0.0", | ||
"eslint-formatter-pretty": "5.0.0", | ||
"eslint-plugin-jest": "28.3.0", | ||
"eslint-plugin-prettier": "5.1.3", | ||
"husky": "9.0.11", | ||
"jest": "29.7.0", | ||
"jest-runner-eslint": "2.2.0", | ||
"jest-watch-typeahead": "2.2.2", | ||
"lint-staged": "15.2.10", | ||
"prettier": "3.2.5", | ||
"rimraf": "5.0.10", | ||
"ts-jest": "29.1.5", | ||
"typescript": "5.6.2" | ||
|
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
Oops, something went wrong.