Skip to content

Commit

Permalink
Enable compilerOptions noImplicitReturns and noUnusedParameters to im…
Browse files Browse the repository at this point in the history
…prove type safety. (#347)
  • Loading branch information
tekener authored Apr 25, 2024
1 parent 4069bfa commit 683be31
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ function findInInventory(inventory: InventoryEntry[], $refParent: any, $refKey:
return existingEntry;
}
}
return undefined
}

function removeFromInventory(inventory: InventoryEntry[], entry: any) {
Expand Down
1 change: 1 addition & 0 deletions lib/pointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ function resolveIf$Ref(pointer: any, options: any, pathFromRoot?: any) {
return true;
}
}
return undefined
}
export default Pointer;

Expand Down
1 change: 1 addition & 0 deletions lib/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class $Ref<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOpt
return true;
}
}
return undefined
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/util/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function sort(plugins: Plugin[]) {
});
}

// @ts-ignore
export interface PluginResult<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>> {

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node lts/* on ubuntu-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node current on ubuntu-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node 18 on ubuntu-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node current on windows-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node lts/* on windows-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node 18 on windows-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node 18 on macos-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node current on macos-latest

'O' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 49 in lib/util/plugins.ts

View workflow job for this annotation

GitHub Actions / Node lts/* on macos-latest

'O' is defined but never used. Allowed unused vars must match /^_/u
plugin: Plugin;
result?: string | Buffer | S;
Expand Down
1 change: 1 addition & 0 deletions lib/util/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function getProtocol(path: string | undefined) {
if (match) {
return match[1].toLowerCase();
}
return undefined;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"resolveJsonModule": true,
"rootDir": ".",
"skipLibCheck": true,
"strict": true
"strict": true,
"noImplicitReturns": true,
"noUnusedParameters": true
},
"compileOnSave": false,
"exclude": ["node_modules", "dist"],
Expand Down

0 comments on commit 683be31

Please sign in to comment.