Skip to content

fix: Enable compilerOptions noImplicitReturns and noUnusedParameters to improve type safety #347

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,7 +45,8 @@
});
}

// @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 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 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 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 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 lts/* 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 18 on macos-latest

'O' is defined but never used. Allowed unused vars must match /^_/u
plugin: Plugin;
result?: string | Buffer | S;
error?: any;
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
Loading