Skip to content

Commit 75230b5

Browse files
committed
Add biome and format code
1 parent ce00207 commit 75230b5

File tree

86 files changed

+4318
-3361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+4318
-3361
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ The [Bun](https://bun.sh/) runtime and package manager is used to manage depende
3535

3636
## Coding style
3737

38-
Source code is linted using [ts-standard](https://github.com/standard/ts-standard) (based on [eslint](https://eslint.org/)) and TypeScript is used with [strict type checking compiler options](https://www.typescriptlang.org/tsconfig#Strict_Type_Checking_Options_6173) enabled.
38+
Source code is linted and formatted using [Biome](https://biomejs.dev/). TypeScript is used with [strict type checking compiler options](https://www.typescriptlang.org/tsconfig#Strict_Type_Checking_Options_6173) enabled. Semicolons are not used at the end of statements (Biome uses `asNeeded`).
3939

40-
Use the following command to identify potential coding style and type annotation violations:
40+
Use the following commands to check and fix style:
4141

42-
$ bun run lint
42+
$ bun run lint # check for issues
43+
$ bun run lint:fix # auto-fix issues
44+
$ bun run fmt # format code
4345

4446

4547
### Documentation

biome.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"includes": [
10+
"src/**/*.{ts,tsx,js,jsx}",
11+
"!src/__mocks__/**",
12+
"!src/**/*.test.{ts,tsx}",
13+
"!src/**/__tests__/**"
14+
]
15+
},
16+
"formatter": {
17+
"enabled": true,
18+
"indentStyle": "space",
19+
"indentWidth": 2
20+
},
21+
"javascript": {
22+
"formatter": {
23+
"semicolons": "asNeeded",
24+
"quoteStyle": "single"
25+
}
26+
},
27+
"linter": {
28+
"enabled": true,
29+
"rules": {
30+
"recommended": true
31+
}
32+
}
33+
}

bun.lock

Lines changed: 32 additions & 190 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
"dev": "bun run start",
1010
"build": "./scripts/set-git-env.sh craco build",
1111
"build:firebase": "REACT_APP_CONFIG=gcp PUBLIC_URL=/ ./scripts/set-git-env.sh craco build",
12-
"lint": "ts-standard --env jest 'src/**/*.{tsx,ts}'",
13-
"fmt": "ts-standard --env jest 'src/**/*.{tsx,ts}' --fix",
14-
"test": "ts-standard --env jest 'src/**/*.{tsx,ts}' && craco test --watchAll=false",
12+
"lint": "biome check .",
13+
"lint:fix": "biome check --write --unsafe .",
14+
"fmt": "biome format --write .",
15+
"format": "biome format --write .",
16+
"test": "biome check . && craco test --watchAll=false",
1517
"predeploy": "REACT_APP_CONFIG=demo PUBLIC_URL='https://imagingdatacommons.github.io/slim/' ./scripts/set-git-env.sh craco build",
1618
"deploy": "gh-pages -d build",
1719
"clean": "rm -rf ./build ./node_modules"
@@ -32,6 +34,7 @@
3234
]
3335
},
3436
"devDependencies": {
37+
"@biomejs/biome": "^2.0.0",
3538
"@babel/preset-env": "^7.15.0",
3639
"@babel/preset-react": "^7.17.12",
3740
"@babel/preset-typescript": "^7.17.12",
@@ -72,7 +75,6 @@
7275
"retry": "^0.13.1",
7376
"semantic-release": "21.1.2",
7477
"sonarqube-scanner": "^4.3.0",
75-
"ts-standard": "^11.0.0",
7678
"typescript": "^4.7.4"
7779
},
7880
"dependencies": {

0 commit comments

Comments
 (0)