This commit is contained in:
Bertie690 2025-08-13 23:55:39 -04:00 committed by Sirz Benjie
parent 9bb736ce59
commit c885c1e3f3
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
4 changed files with 15 additions and 10 deletions

View File

@ -3,7 +3,7 @@
# top-most EditorConfig file
root = true
[src/*.{js,ts}]
[**/*.{js,ts,json,jsonc}]
indent_style = space
indent_size = 2
end_of_line = lf

View File

@ -1,4 +1,5 @@
{
// ! Just ignore the errors for now guys.
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
"vcs": {
"enabled": true,
@ -65,6 +66,7 @@
},
"style": {
"useCollapsedIf": "error",
"useCollapsedElseIf": "error",
"noDoneCallback": "error",
"noSubstr": "error",
"noYodaExpression": "error",
@ -85,7 +87,10 @@
"level": "warn",
"fix": "none"
},
"useSingleVarDeclarator": "error",
"useSingleVarDeclarator": {
"level": "error",
"fix": "safe"
},
"useNodejsImportProtocol": "off",
"useTemplate": "off", // string concatenation is faster: https://stackoverflow.com/questions/29055518/are-es6-template-literals-faster-than-string-concatenation
"useAsConstAssertion": "error",

View File

@ -19,23 +19,22 @@ Generally speaking, most users shouldn't need to run Biome directly; in addition
> ![WARNING]
> You will **not** be able to commit code if any staged files contain `error`-level linting problems. \
> If you, for whatever reason, _absolutely need_ to bypass Lefthook while committing,
> `LEFTHOOK=0 git commit` will skip all pre-commit hooks for the given operation.
> If you, for whatever reason, _absolutely need_ to bypass Lefthook for a given commit,
> `LEFTHOOK=0 git commit` will skip running all pre-commit hooks during the commit process.
We also have a [Github Action](../.github/workflows/quality.yml) to verify code quality each time a PR is updated, preventing bad code from inadvertently making its way upstream. \
We also have a [Github Action](../.github/workflows/linting.yml) to verify code quality each time a PR is updated, preventing bad code from inadvertently making its way upstream. \
These are effectively the same commands as run by Lefthook, merely on a project-wide scale.
## Running Biome via CLI
If you want Biome to check your files manually, you have 2 options:
1. Run the `biome` script included in `package.json` (`pnpm biome`).
This has sensible defaults for command-line options, but does not allow altering certain flags (as some cannot be specified twice in the same command)
To run you Biome on your files manually, you have 2 main options:
1. Run the scripts included in `package.json` (`pnpm biome` and `pnpm biome:all`). \
These have sensible defaults for command-line options, but do not allow altering certain flags (as some cannot be specified twice in the same command)
2. Execute the Biome executable manually from the command line like so:
```sh
pnpm exec biome check --[flags]
```
This allows customizing flags non-overridable flags like `--diagnostic-level` on a more granular level, but requires slightly more verbosity.
This allows customizing non-overridable flags like `--diagnostic-level` on a more granular level, but requires slightly more verbosity and specifying more options.
A full list of flags and options can be found on [their website](https://biomejs.dev/reference/cli/), but here's a few useful ones to keep in mind:

View File

@ -20,6 +20,7 @@
"typecheck": "tsc --noEmit",
"typecheck:scripts": "tsc -p scripts/jsconfig.json",
"biome": "biome check --write --changed --no-errors-on-unmatched --diagnostic-level=error",
"biome:all": "biome check --write --no-errors-on-unmatched --diagnostic-level=error",
"biome-ci": "biome ci --diagnostic-level=error --reporter=github --no-errors-on-unmatched",
"typedoc": "typedoc",
"depcruise": "depcruise src test",