Skip to content

Commit d9d0d64

Browse files
committed
Add strict to tsconfig
1 parent 63e73cf commit d9d0d64

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

index.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ const defined = new Set(['type', 'value', 'children', 'position'])
6969
* Wrapper that adds the current node (and parent, if available) to error
7070
* messages.
7171
*
72-
* @param {(node?: unknown, parent?: Parent|null) => asserts node is Node} fn
73-
* @returns {(node?: unknown, parent?: Parent|null) => asserts node is Node}
72+
* @param {(node?: any, parent?: Parent|null) => asserts node is Node} fn
73+
* @returns {(node?: any, parent?: Parent|null) => asserts node is Node}
7474
*/
7575
export function wrap(fn) {
7676
return wrapped
7777

7878
/**
7979
* @param {unknown} node
80-
* @param {Parent} [parent]
80+
* @param {Parent|null|undefined} [parent]
8181
* @throws {AssertionError}
82-
* @returns {asserts node is T}
82+
* @returns {void}
8383
*/
8484
function wrapped(node, parent) {
8585
try {
@@ -138,7 +138,10 @@ function assertNode(node) {
138138

139139
for (key in node) {
140140
if (!defined.has(key)) {
141-
vanilla(key, node[key])
141+
/** @type {unknown} */
142+
// @ts-expect-error: hush.
143+
const value = node[key]
144+
vanilla(key, value)
142145
}
143146
}
144147

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@
8484
"atLeast": 100,
8585
"detail": true,
8686
"strict": true,
87-
"ignoreCatch": true
87+
"ignoreCatch": true,
88+
"#": "Couple of needed any’s",
89+
"ignoreFiles": [
90+
"index.d.ts"
91+
]
8892
}
8993
}

tsconfig.json

+2-1
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)