Enforce a specific name in catch clauses
Examples of incorrect code:
try {
doSomething();
} catch (err) {
// handle error
}try {
doSomething();
} catch (e) {
// handle error
}Examples of correct code:
try {
doSomething();
} catch (error) {
// handle error
}type Options = [
{
name: string;
ignore: string[];
}
];
const defaultOptions: Options = {
name: 'error',
ignore: [],
};This option defines the name that is allowed in catch clauses.
This option defines multiple names that get ignored.