You can ignore throw statement warnings by adding the following comment to the line above the throw statement:
const someThrow = () => {
// @does-it-throw-ignore
throw new Error("This will not be reported");
};
Any calls to functions/methods that throw that are marked with the @it-throws or @does-it-throw-ignore comment will also be ignored as a result. For example:
const someThrow = () => {
// @it-throws
throw new Error("This will not be reported");
};
const callToThrow = () => {
someThrow(); // This will not be reported
};
You can configure the string to match with the following vscode/LSP settings:
Ignoring Throw Statement Warnings
You can ignore throw statement warnings by adding the following comment to the line above the throw statement:
Any calls to functions/methods that
throw
that are marked with the@it-throws
or@does-it-throw-ignore
comment will also be ignored as a result. For example:ignoreStatements
["@it-throws", "@does-it-throw-ignore"]
Let me know if you have any feedback!