Skip to content

No Error

Error
small-rules/no-error

Use throw instead of error().

Diagnostic Messages

noError
Replace error(...) with throw.

Configuration

This rule does not accept options.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/no-error": "error"
}
}

Examples

Ban global error call
error('Hello');
Throw a new error
throw new Error('test');