sonarjs/no-unthrown-error
eslint-plugin-sonarjs
SuggestionRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-unthrown-error": "error",
},
},
];if (x < 0) {
new Error("x must be nonnegative");
}if (x < 0) {
throw new Error("x must be nonnegative");
}Examples from the ESLint documentation.
sonarjs/no-unthrown-error
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-unthrown-error": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
JSX list components keys should match up between renders
Multiline blocks should be enclosed in curly braces
Unused local variables and functions should be removed
"undefined" should not be passed as the value of optional parameters
The return value of void functions should not be used