Skip to content

Commit 9cd72de

Browse files
committed
Lint
1 parent 98639de commit 9cd72de

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

hey

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
> @typescript/[email protected] generate
3+
> npm run build && npm run baseline-accept
4+
5+
6+
> @typescript/[email protected] build
7+
> tsc && node ./lib/build.js
8+
9+
10+
> @typescript/[email protected] baseline-accept
11+
> cpx "generated\**" baselines\
12+

src/build/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ export function emitWebIdl(
510510
}
511511

512512
// If it's a quoted string literal (has " " inside), just return it
513-
if (typeof objDomType === "string" && objDomType.includes("\"")) {
513+
if (typeof objDomType === "string" && objDomType.includes('"')) {
514514
return objDomType;
515515
}
516516

src/build/patches.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,10 @@ function handleProperty(child: Node): Partial<Property> {
231231
* @param child The child node to handle.
232232
* @param name Optional name for the method.
233233
*/
234-
function handleMethod(child: Node, name?:string): Partial<Method> {
235-
if (!name) name = string(child.values[0]);
234+
function handleMethod(child: Node, name?: string): Partial<Method> {
235+
if (!name) {
236+
name = string(child.values[0]);
237+
}
236238

237239
let typeNode: Node | undefined;
238240
const params: { name: string; type: string }[] = [];
@@ -253,13 +255,12 @@ function handleMethod(child: Node, name?:string): Partial<Method> {
253255
type: string(c.properties.type),
254256
});
255257
break;
256-
257-
case "signatures":
258+
259+
case "signatures":
258260
for (const sc of c.children) {
259-
signatures.push(handleMethod(sc, name).signature![0] || [])
261+
signatures.push(handleMethod(sc, name).signature![0] || []);
260262
}
261263
break;
262-
263264

264265
default:
265266
throw new Error(`Unexpected child "${c.name}" in method "${name}"`);
@@ -275,10 +276,10 @@ function handleMethod(child: Node, name?:string): Partial<Method> {
275276
: { type: string(child.properties?.returns) }),
276277
};
277278
}
278-
return { name, signature: [
279-
...(signature ? [signature] : []),
280-
...signatures as any
281-
] };
279+
return {
280+
name,
281+
signature: [...(signature ? [signature] : []), ...(signatures as any)],
282+
};
282283
}
283284

284285
/**

0 commit comments

Comments
 (0)