10000 Add `strict` to `tsconfig.json` · syntax-tree/xast-util-to-string@b1398f6 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1398f6

Browse files
committed
Add strict to tsconfig.json
1 parent df09bb9 commit b1398f6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
*/
1414
export function toString(node) {
1515
// A root or an element
16-
// @ts-ignore Looks like a parent.
1716
if ('children' in node) return all(node)
18-
// @ts-ignore Looks like a literal.
1917
return 'value' in node ? node.value : ''
2018
}
2119

@@ -26,8 +24,7 @@ export function toString(node) {
2624
function one(node) {
2725
if (node.type === 'text') return node.value
2826
// Ignore things like comments, instruction, cdata.
29-
// @ts-ignore Looks like a parent.
30-
return node.children ? all(node) : ''
27+
return 'children' in node ? all(node) : ''
3128
}
3229

3330
/**

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"declaration": true,
1111
"emitDeclarationOnly": true,
1212
"allowSyntheticDefaultImports": true,
13-
"skipLibCheck": true
13+
"skipLibCheck": true,
14+
"strict": true
1415
}
1516
}

0 commit comments

Comments
 (0)
0