@blitz/eslint-plugin
Version:
An ESLint config to enforce a consistent code styles across StackBlitz projects
56 lines (42 loc) • 642 B
Markdown
> Enforce a specific name in catch clauses
Examples of incorrect code:
```ts
try {
doSomething();
} catch (err) {
// handle error
}
```
```ts
try {
doSomething();
} catch (e) {
// handle error
}
```
Examples of correct code:
```ts
try {
doSomething();
} catch (error) {
// handle error
}
```
```ts
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.