-
Notifications
You must be signed in to change notification settings - Fork 5
build: format/lint with prettier/biome and use husky hooks via lintstaged #5
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| pnpm build check test | ||
| #!/bin/sh | ||
|
|
||
| pnpx lint-staged --config .lintstagedrc.commit.js |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
|
|
||
| pnpx lint-staged --config .lintstagedrc.push.js |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export default { | ||
| "**/*.{js,ts,json}": (filenames) => | ||
| filenames.length ? [`biome check --write ${filenames.join(" ")}`] : [], | ||
| "!(**/*.{js,ts,json})": (filenames) => | ||
| filenames.length ? [`prettier --write ${filenames.join(" ")}`] : [], | ||
| }; |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||||
| export default { | ||||||||
| "*": (filenames) => (filenames.length >= 5 ? ["pnpm build check test"] : []), | ||||||||
| }; | ||||||||
|
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider whether this conditional execution is the desired behavior. It might be better to always run the tests, or to have a more sophisticated criteria for when to run them. What is the rationale for only running tests when there are 5 or more files?
Suggested change
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "ignoreUnknown": true | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| **/generated** | ||
| **/*.{js,ts,json} | ||
| .husky/** | ||
| .prettierignore |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "recommendations": [ | ||
| "esbenp.prettier-vscode", | ||
| "biomejs.biome", | ||
| "google.geminicodeassist" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,22 @@ | ||
| { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "[javascript]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode" | ||
| }, | ||
| "windsurf.cascadeCommandsAllowList": [ | ||
| "pnpm test", | ||
| "pnpm build", | ||
| "pnpm build check test", | ||
| "pnpm format", | ||
| "cd" | ||
| ] | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "[javascript]": { | ||
| "editor.defaultFormatter": "biomejs.biome" | ||
| }, | ||
| "[typescript]": { | ||
| "editor.defaultFormatter": "biomejs.biome" | ||
| }, | ||
| "[json]": { | ||
| "editor.defaultFormatter": "biomejs.biome" | ||
| }, | ||
| "windsurf.cascadeCommandsAllowList": [ | ||
| "pnpm test", | ||
| "pnpm build", | ||
| "pnpm build check test", | ||
| "pnpm format", | ||
| "cd" | ||
| ], | ||
| "[shellscript]": { | ||
| "editor.defaultFormatter": "foxundermoon.shell-format" | ||
| } | ||
|
Comment on lines
+2
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indentation in this file is inconsistent. Some lines use tabs while others use spaces. Consider using a consistent indentation style (e.g., two spaces) for better readability. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
| "organizeImports": { | ||
| "enabled": true | ||
| }, | ||
| "linter": { | ||
| "enabled": true, | ||
| "rules": { | ||
| "recommended": true | ||
| } | ||
| }, | ||
| "files": { | ||
| "include": ["**/*.js", "**/*.ts", "**/*.json"], | ||
| "ignore": ["**/package.json"] | ||
| }, | ||
| "javascript": { | ||
| "formatter": { | ||
| "semicolons": "always" | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.