Skip to content

Commit 683be31

Browse files
authored
Enable compilerOptions noImplicitReturns and noUnusedParameters to improve type safety. (#347)
1 parent 4069bfa commit 683be31

File tree

6 files changed

+8
-1
lines changed

6 files changed

+8
-1
lines changed

lib/bundle.ts

+1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ function findInInventory(inventory: InventoryEntry[], $refParent: any, $refKey:
290290
return existingEntry;
291291
}
292292
}
293+
return undefined
293294
}
294295

295296
function removeFromInventory(inventory: InventoryEntry[], entry: any) {

lib/pointer.ts

+1
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ function resolveIf$Ref(pointer: any, options: any, pathFromRoot?: any) {
284284
return true;
285285
}
286286
}
287+
return undefined
287288
}
288289
export default Pointer;
289290

lib/ref.ts

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ class $Ref<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOpt
195195
return true;
196196
}
197197
}
198+
return undefined
198199
}
199200

200201
/**

lib/util/plugins.ts

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function sort(plugins: Plugin[]) {
4545
});
4646
}
4747

48+
// @ts-ignore
4849
export interface PluginResult<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>> {
4950
plugin: Plugin;
5051
result?: string | Buffer | S;

lib/util/url.ts

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export function getProtocol(path: string | undefined) {
6868
if (match) {
6969
return match[1].toLowerCase();
7070
}
71+
return undefined;
7172
}
7273

7374
/**

tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"resolveJsonModule": true,
1818
"rootDir": ".",
1919
"skipLibCheck": true,
20-
"strict": true
20+
"strict": true,
21+
"noImplicitReturns": true,
22+
"noUnusedParameters": true
2123
},
2224
"compileOnSave": false,
2325
"exclude": ["node_modules", "dist"],

0 commit comments

Comments
 (0)