Skip to content

Commit 842b78e

Browse files
Issue #432: Migrate linting and formatting to Biome (#452)
* chore(tooling): migrate npm tooling scripts to biome * chore(biome): add biome configuration * ci: switch lint workflow to biome * docs: update contribution and readme for biome * chore(lint): remove legacy eslint config files * docs: update lint tooling wording to biome * fix(lint): address Copilot review feedback
1 parent f53a471 commit 842b78e

15 files changed

Lines changed: 248 additions & 1237 deletions

File tree

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
cache: npm
4141
- name: Install package dependencies
4242
run: npm ci
43-
- name: Run ESLint
43+
- name: Run Biome
4444
run: npm run lint
4545
- name: Run Knip
4646
run: npm run knip
@@ -56,7 +56,7 @@ jobs:
5656
cache: npm
5757
- name: Install package dependencies
5858
run: npm ci
59-
- name: Run ESLint
59+
- name: Run build check
6060
run: npm run build:check
6161
test-units-and-cover:
6262
name: Unit Tests And Coverage

CONTRIBUTING.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Run dead code and dependency analysis before opening a pull request:
1414
npm run knip
1515
```
1616

17-
`npm run lint` now runs Knip first, then ESLint.
17+
`npm run lint` now runs Biome.
1818

1919
## Pull Request Process
2020

@@ -24,3 +24,12 @@ npm run knip
2424
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
2525
3. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
2626
do not have permission to do that, you may request the second reviewer to merge it for you.
27+
28+
## Code Quality
29+
30+
Run Biome checks before opening a pull request:
31+
32+
```
33+
npm run lint
34+
npm run format:check
35+
```

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,17 @@ Start:
470470
471471
## Tests
472472
473+
### Linting and formatting (Biome)
474+
475+
Run code quality checks with Biome:
476+
477+
```
478+
npm run lint
479+
npm run lint:fix
480+
npm run format
481+
npm run format:check
482+
```
483+
473484
### Unit tests
474485
475486
Open a terminal and change to the project's directory:

biome.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.11/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": {
5+
"ignoreUnknown": false,
6+
"includes": [
7+
"**",
8+
"!**/node_modules/**",
9+
"!**/dist/**",
10+
"!**/.test-reports/**",
11+
"!**/.coverage/**",
12+
"!**/.nostr/**",
13+
"!**/tslint.json"
14+
]
15+
},
16+
"formatter": {
17+
"enabled": true,
18+
"indentStyle": "space",
19+
"lineWidth": 120
20+
},
21+
"linter": {
22+
"enabled": true,
23+
"rules": {
24+
"recommended": false,
25+
"correctness": { "noUnusedVariables": "error" },
26+
"style": { "useBlockStatements": "warn" },
27+
"suspicious": { "noExplicitAny": "off" }
28+
}
29+
},
30+
"javascript": {
31+
"formatter": {
32+
"quoteStyle": "single",
33+
"semicolons": "asNeeded",
34+
"trailingCommas": "all"
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)