Skip to content

Commit

Permalink
Allow descriptive error names in unicorn/catch-error-name
Browse files Browse the repository at this point in the history
  • Loading branch information
codykaup committed Sep 12, 2024
1 parent 86a1af1 commit 7e18667
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ export default [
'unicorn/catch-error-name': [
'error',
{
name: 'err',
ignore: ['^err.*$'],
ignore: ['err'],
},
],
'unicorn/switch-case-braces': 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ try {
a: z.string(),
b: z.number(),
}).parse({ a: 1, b: '1' });
} catch (aErr) {
err = aErr;
} catch (error) {
err = error;
}

export const InvalidConfigurationFile = () => invalidConfigurationFile('./my.config.json', err);
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default {
let err;
try {
JSON.parse('foo');
} catch (aErr) {
err = aErr;
} catch (error) {
err = error;
}

export const UnparseableConfigurationFile = () =>
Expand Down

0 comments on commit 7e18667

Please sign in to comment.