Skip to content

Commit 2abfaa8

Browse files
committed
chore(deps): update Biome and node types
- Make `biome.json` more readable - Disable noNegationElse lint rule because it now covers ternaries. - Move the promoted lint rules to their stable groups. - Enable the `types` domain.
1 parent 5c19993 commit 2abfaa8

4 files changed

Lines changed: 84 additions & 69 deletions

File tree

biome.json

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
2-
"$schema": "https://next.biomejs.dev/schemas/2.3.10/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.8/schema.json",
33
"root": true,
44
"files": {
55
"ignoreUnknown": true
66
},
7+
"vcs": {
8+
"enabled": true,
9+
"clientKind": "git",
10+
"useIgnoreFile": true
11+
},
712
"formatter": {
813
"includes": [
914
"**",
@@ -12,30 +17,44 @@
1217
"indentStyle": "space",
1318
"indentWidth": 4
1419
},
20+
"javascript": {
21+
"formatter": {
22+
"semicolons": "asNeeded"
23+
}
24+
},
25+
"json": {
26+
"formatter": {
27+
"expand": "always",
28+
"indentWidth": 2
29+
}
30+
},
1531
"linter": {
1632
"domains": {
1733
"project": "recommended",
34+
"types": "recommended",
1835
"test": "recommended"
1936
},
2037
"rules": {
2138
"complexity": {
2239
"noImplicitCoercions": "on",
40+
"noUselessCatchBinding": "on",
2341
"noUselessLoneBlockStatements": "off",
42+
"noUselessUndefined": "off",
2443
"noVoid": "on"
2544
},
2645
"nursery": {
27-
"noDeprecatedImports": "on",
28-
"noDuplicateDependencies": "on",
2946
"noForIn": "on",
30-
"noImportCycles": "on",
3147
"noParametersOnlyUsedInRecursion": "on",
3248
"noProto": "on",
33-
"noUselessCatchBinding": "on",
34-
"noUselessUndefined": "off",
49+
"noUselessReturn": "on",
50+
"useArraySome": "on",
3551
"useArraySortCompare": "on",
52+
"useConsistentMethodSignatures": "on",
53+
"useErrorCause": "on",
3654
"useExhaustiveSwitchCases": "off",
3755
"useExplicitType": "off",
3856
"useFind": "on",
57+
"useGlobalThis": "on",
3958
"useRegexpExec": "on"
4059
},
4160
"performance": {
@@ -47,7 +66,6 @@
4766
"noImplicitBoolean": "on",
4867
"noInferrableTypes": "on",
4968
"noNamespace": "on",
50-
"noNegationElse": "on",
5169
"noParameterAssign": "on",
5270
"noParameterProperties": "on",
5371
"noUnusedTemplateLiteral": "on",
@@ -120,9 +138,12 @@
120138
}
121139
},
122140
"noConstantBinaryExpressions": "on",
141+
"noDeprecatedImports": "on",
142+
"noDuplicateDependencies": "on",
123143
"noEmptyBlockStatements": "on",
124144
"noEvolvingTypes": "on",
125145
"noExportsInTest": "on",
146+
"noImportCycles": "on",
126147
"noUnassignedVariables": "on",
127148
"noUselessEscapeInString": "on",
128149
"noVar": "on",
@@ -133,21 +154,5 @@
133154
"useJsonImportAttributes": "on"
134155
}
135156
}
136-
},
137-
"javascript": {
138-
"formatter": {
139-
"semicolons": "asNeeded"
140-
}
141-
},
142-
"json": {
143-
"formatter": {
144-
"expand": "always",
145-
"indentWidth": 2
146-
}
147-
},
148-
"vcs": {
149-
"enabled": true,
150-
"clientKind": "git",
151-
"useIgnoreFile": true
152157
}
153158
}

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
},
5555
"devDependencies": {
5656
"@bare-ts/lib": "~0.7.0",
57-
"@biomejs/biome": "2.3.13",
58-
"@types/node": "20.19.21",
57+
"@biomejs/biome": "2.4.10",
58+
"@types/node": "20.19.37",
5959
"typescript": "6.0.2"
6060
},
6161
"peerDependencies": {

src/configure.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,13 @@ function configureType(
100100
case "union": {
101101
if (
102102
config.usePrimitiveFlatUnion &&
103-
types != null &&
104-
types.every(ast.isBaseOrVoidType) &&
103+
types?.every(ast.isBaseOrVoidType) &&
105104
ast.haveDistinctTypeof(type.types)
106105
) {
107106
extra = { flat: true }
108107
} else if (
109108
config.useStructFlatUnion &&
110-
types != null &&
111-
types.every(
109+
types?.every(
112110
(t) => t.tag === "alias" || t.tag === "struct",
113111
) &&
114112
types

0 commit comments

Comments
 (0)