Skip to content

Commit 4c491cb

Browse files
authored
Merge pull request #18 from getlang-dev/chores
chore: upgrade deps, lint rules
2 parents db33ad9 + 9483ffc commit 4c491cb

File tree

11 files changed

+35
-17
lines changed

11 files changed

+35
-17
lines changed

.changeset/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/[email protected].1/schema.json",
2+
"$schema": "https://unpkg.com/@changesets/[email protected].3/schema.json",
33
"changelog": ["@changesets/changelog-github", { "repo": "getlang-dev/get" }],
44
"commit": false,
55
"fixed": [],
66
"linked": [],
77
"access": "public",
88
"baseBranch": "main",
9-
"updateInternalDependencies": "patch",
9+
"updateInternalDependencies": "minor",
1010
"ignore": []
1111
}

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
},
2626
"style": {
2727
"noUselessElse": "off",
28-
"noNonNullAssertion": "off"
28+
"noNonNullAssertion": "off",
29+
"useBlockStatements": "error"
2930
}
3031
}
3132
},

bun.lockb

-328 Bytes
Binary file not shown.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "get",
33
"license": "Apache-2.0",
44
"private": true,
5-
"packageManager": "[email protected].27",
5+
"packageManager": "[email protected].29",
66
"scripts": {
77
"format": "biome check --write",
88
"lint": "bun lint:check && bun lint:types && bun lint:unused && bun lint:repo",
@@ -21,10 +21,10 @@
2121
"@biomejs/biome": "1.8.2",
2222
"@changesets/changelog-github": "^0.5.0",
2323
"@changesets/cli": "^2.27.8",
24-
"@types/bun": "^1.1.8",
25-
"knip": "^5.30.0",
24+
"@types/bun": "^1.1.10",
25+
"knip": "^5.30.5",
2626
"sherif": "^1.0.0",
27-
"typescript": "^5.5.4"
27+
"typescript": "^5.6.2"
2828
},
2929
"knip": {
3030
"vitest": {},

packages/get/execute.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ export async function execute(
119119
let value = await visit(node.context)
120120
const optional = node.typeInfo.type === Type.Maybe
121121
value = optional ? value : assert(value)
122-
if (value instanceof NullSelection) return value
122+
if (value instanceof NullSelection) {
123+
return value
124+
}
123125
context = { value, typeInfo: node.context.typeInfo }
124126
}
125127
return unwrap(context, cb)

packages/lib/values/html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const toValue = (el: AnyHtmlNode) => {
6666
if (el.nodeType === 2) {
6767
str = el.value
6868
} else if (textContent(el)) {
69-
str = textContent(el)
69+
str = textContent(el).replaceAll(/\s+/g, ' ')
7070
}
7171
return str.trim()
7272
}

packages/parser/ast/typeinfo.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export function tequal(a: TypeInfo, b: TypeInfo): boolean {
3737
} else if (a.type === 'struct' && b.type === 'struct') {
3838
const ax = Object.entries(a.schema)
3939
const bx = Object.entries(b.schema)
40-
if (ax.length !== bx.length) return false
40+
if (ax.length !== bx.length) {
41+
return false
42+
}
4143
return ax.every(([ak, av]) => {
4244
const bv = b.schema[ak]
4345
return bv && tequal(av, bv)

packages/parser/desugar/inference/typeinfo.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ export function inferTypeInfo(): TransformVisitor {
6464

6565
function ctx<C extends CExpr>(cb: (tnode: C, ivisit: Visit) => C) {
6666
return function enter(node: C, visit: Visit): C {
67-
if (!node.context) return cb(node, visit)
67+
if (!node.context) {
68+
return cb(node, visit)
69+
}
6870
const context = visit(node.context)
6971
const itemContext: any = {
7072
...context,
@@ -133,7 +135,9 @@ export function inferTypeInfo(): TransformVisitor {
133135
enter: ctx((node, visit) => {
134136
const xnode = trace.SliceExpr.enter(node, visit)
135137
let typeInfo: TypeInfo = { type: Type.Value }
136-
if (optional) typeInfo = { type: Type.Maybe, option: typeInfo }
138+
if (optional) {
139+
typeInfo = { type: Type.Maybe, option: typeInfo }
140+
}
137141
return { ...xnode, typeInfo }
138142
}),
139143
},
@@ -189,7 +193,9 @@ export function inferTypeInfo(): TransformVisitor {
189193
ObjectLiteralExpr: {
190194
enter: ctx((node, visit) => {
191195
const xnode = trace.ObjectLiteralExpr.enter(node, child => {
192-
if (child === node.context) return visit(child)
196+
if (child === node.context) {
197+
return visit(child)
198+
}
193199
const entry = node.entries.find(e => e.value === child)
194200
invariant(
195201
entry,

packages/parser/desugar/trace.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import type { TransformVisitor, Visit } from '../visitor/transform.js'
55

66
export function traceVisitor(scope: RootScope<Expr>) {
77
function ctx<C extends CExpr>(node: C, visit: Visit, cb: (tnode: C) => C) {
8-
if (!node.context) return cb(node)
8+
if (!node.context) {
9+
return cb(node)
10+
}
911
const context = visit(node.context)
1012
scope.pushContext(context)
1113
const xnode = cb({ ...node, context })

packages/parser/desugar/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export function selectTypeInfo(
1919
selector: Expr,
2020
): TypeInfo | null {
2121
const sel = render(selector)
22-
if (!sel) return null
22+
if (!sel) {
23+
return null
24+
}
2325
return toPath(sel).reduce<TypeInfo>(
2426
(acc, cur) =>
2527
(acc.type === Type.Struct && acc.schema[cur]) || { type: Type.Value },

0 commit comments

Comments
 (0)