Skip to content

Commit 1476eaf

Browse files
committed
chore: [STMS-4058] Add biomejs
1 parent e3174bb commit 1476eaf

29 files changed

+4351
-3096
lines changed

.codesandbox/ci.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"node": "16",
2+
"node": "20",
33
"buildCommand": "build",
44
"packages": [
55
"packages/babel-preset",

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- uses: umidbekk/actions/prepare-node-repo@v2
1717
with:
1818
cache-key: npm-v2-
19+
node-version: 20
1920

2021
- run: yarn tsc
2122
- run: yarn lint
@@ -24,4 +25,3 @@ jobs:
2425
command: yarn test
2526
update-command: yarn test -u
2627
- uses: codecov/codecov-action@v2
27-
- run: yarn build

lerna.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
"version": "0.12.0",
33
"npmClient": "yarn",
44
"useWorkspaces": true,
5-
"packages": [
6-
"packages/*"
7-
],
5+
"packages": ["packages/*"],
86
"command": {
97
"publish": {
108
"message": "%s",
11-
"ignoreChanges": [
12-
"**/__tests__/*.*",
13-
"**/__testutils__/*.*"
14-
]
9+
"ignoreChanges": ["**/__tests__/*.*", "**/__testutils__/*.*"]
1510
}
1611
}
1712
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prerelease": "yarn --force && yarn tsc && yarn lint && yarn test",
1717
"release": "lerna publish",
1818
"tdd": "jest --watch",
19-
"test": "jest --coverage"
19+
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage"
2020
},
2121
"lint-staged": {
2222
"*": "js-tools lint --fix"
@@ -54,7 +54,7 @@
5454
"@types/jest": "27.5.2",
5555
"@types/listr": "0.14.4",
5656
"@types/lodash": "4.14.186",
57-
"@types/node": "16.18.0",
57+
"@types/node": "24.0.10",
5858
"@types/prettier": "2.7.1",
5959
"enhanced-resolve": "5.10.0",
6060
"eslint": "8.23.0",
@@ -70,6 +70,6 @@
7070
"typescript": "4.8.4"
7171
},
7272
"engines": {
73-
"node": ">=16"
73+
"node": "20"
7474
}
7575
}

packages/babel-preset/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
"@babel/preset-typescript": "^7.26.0",
2626
"babel-plugin-annotate-pure-calls": "^0.4.0",
2727
"babel-plugin-dev-expression": "^0.2.2",
28-
"babel-plugin-transform-react-remove-prop-types": "^0.4.24"
28+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
29+
"snapshot-diff": "^0.10.0"
2930
},
3031
"peerDependencies": {
3132
"@babel/runtime": "^7.0.0"
3233
},
3334
"engines": {
34-
"node": ">=12"
35+
"node": "20"
3536
},
3637
"publishConfig": {
3738
"access": "public"

packages/babel-preset/src/preset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default function preset(
7979
);
8080
}
8181

82-
if (typeof transpileJSX != 'boolean' && transpileJSX !== 'runtime') {
82+
if (typeof transpileJSX !== 'boolean' && transpileJSX !== 'runtime') {
8383
throw new Error(
8484
format(
8585
'Invalid "jsx" option, expected "boolean" or "runtime", but got: %j',

packages/biome-config/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### `@superdispatch/biome-config`
2+
3+
[![npm](https://img.shields.io/npm/v/@superdispatch/biome-config)](https://www.npmjs.com/package/@superdispatch/biome-config)
4+
5+
#### Installation
6+
7+
```bash
8+
yarn add @superdispatch/biome-config -D
9+
```

packages/biome-config/biome.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
3+
"formatter": {
4+
"enabled": true,
5+
"formatWithErrors": false,
6+
"indentStyle": "space",
7+
"indentWidth": 2,
8+
"lineEnding": "lf",
9+
"lineWidth": 80,
10+
"attributePosition": "auto",
11+
"bracketSameLine": false,
12+
"expand": "auto"
13+
},
14+
"files": {
15+
"ignoreUnknown": true,
16+
"includes": ["**/*", "!**/dist/**"]
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": { "recommended": false }
21+
},
22+
"javascript": {
23+
"formatter": {
24+
"jsxQuoteStyle": "double",
25+
"quoteProperties": "asNeeded",
26+
"trailingCommas": "all",
27+
"semicolons": "always",
28+
"arrowParentheses": "always",
29+
"bracketSameLine": false,
30+
"quoteStyle": "single"
31+
}
32+
},
33+
"overrides": [
34+
{
35+
"includes": ["*.js", "!public/**/*.js", "!src/**/*.js"],
36+
"linter": {
37+
"rules": { "correctness": { "noUndeclaredDependencies": "error" } }
38+
}
39+
},
40+
{
41+
"includes": ["scripts/**/*.ts"],
42+
"linter": {
43+
"rules": { "correctness": { "noUndeclaredDependencies": "error" } }
44+
}
45+
},
46+
{
47+
"includes": ["**/*.{ts,tsx}"],
48+
"linter": {
49+
"rules": {
50+
"complexity": { "noBannedTypes": "warn", "useOptionalChain": "warn" },
51+
"correctness": { "useExhaustiveDependencies": "warn" },
52+
"style": { "noRestrictedImports": "warn" },
53+
"suspicious": { "noAlert": "warn", "noEmptyBlockStatements": "warn" }
54+
}
55+
}
56+
},
57+
{ "includes": ["src/**/*.{js,jsx}"], "linter": { "rules": {} } },
58+
{
59+
"includes": ["src/service-worker.ts"],
60+
"linter": {
61+
"rules": {
62+
"style": { "noRestrictedGlobals": { "level": "off", "options": {} } }
63+
}
64+
}
65+
},
66+
{
67+
"includes": [
68+
"setup-vitest.ts",
69+
"**/*.{test,spec}.{ts,tsx,js,jsx}",
70+
"**/{__tests__,__testutils__}/**/*.{ts,tsx,js,jsx}"
71+
],
72+
"linter": {
73+
"rules": {
74+
"correctness": { "noUndeclaredDependencies": "error" },
75+
"style": {
76+
"noNonNullAssertion": "off",
77+
"noRestrictedImports": "off"
78+
},
79+
"suspicious": {
80+
"noEmptyBlockStatements": "warn",
81+
"noExplicitAny": "off"
82+
}
83+
}
84+
}
85+
},
86+
{
87+
"includes": ["e2e/**/*.{ts,tsx}"],
88+
"linter": {
89+
"rules": {
90+
"complexity": { "noBannedTypes": "warn" },
91+
"correctness": { "noUndeclaredDependencies": "error" }
92+
}
93+
}
94+
},
95+
{ "includes": ["types"] }
96+
],
97+
"html": { "formatter": { "selfCloseVoidElements": "always" } }
98+
}

packages/biome-config/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@superdispatch/biome-config",
3+
"version": "0.12.0",
4+
"description": "Shared config for Biomejs.",
5+
"keywords": [
6+
"biome"
7+
],
8+
"repository": "https://github.com/superdispatch/js-tools.git",
9+
"license": "MIT",
10+
"main": "biome.json",
11+
"files": [
12+
"biome.json"
13+
],
14+
"engines": {
15+
"node": "20"
16+
},
17+
"publishConfig": {
18+
"access": "public"
19+
},
20+
"devDependencies": {
21+
"@biomejs/biome": "2.0.6"
22+
}
23+
}

packages/eslint-plugin/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"dependencies": {
1818
"@typescript-eslint/eslint-plugin": "6.21.0",
1919
"@typescript-eslint/parser": "6.21.0",
20+
"@typescript-eslint/types": "^8.35.1",
2021
"@typescript-eslint/typescript-estree": "5.8.0",
2122
"confusing-browser-globals": "^1.0.10",
2223
"eslint-config-prettier": "^8.3.0",
@@ -30,15 +31,16 @@
3031
"eslint-plugin-react": "^7.28.0",
3132
"eslint-plugin-react-hooks": "^4.3.0",
3233
"eslint-plugin-testing-library": "^5.0.1",
33-
"lodash": "^4.17.19"
34+
"lodash": "^4.17.19",
35+
"snapshot-diff": "0.10.0"
3436
},
3537
"peerDependencies": {
3638
"eslint": "^7.0.0 || ^8.0.0",
3739
"prettier": "^2.0.0",
3840
"typescript": "^4"
3941
},
4042
"engines": {
41-
"node": ">=12"
43+
"node": "20"
4244
},
4345
"publishConfig": {
4446
"access": "public"

0 commit comments

Comments
 (0)