Skip to content

Commit

Permalink
infra(unicorn): catch-error-name (#2471)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Oct 14, 2023
1 parent e228183 commit e946e6a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ module.exports = defineConfig({
// TODO @Shinigami92 2023-09-23: The following rules currently conflict with our code.
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
'unicorn/better-regex': 'off',
'unicorn/catch-error-name': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/escape-case': 'off',
'unicorn/filename-case': 'off',
Expand Down
8 changes: 4 additions & 4 deletions scripts/generateLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ async function main(): Promise<void> {
}

localeTitle = title;
} catch (e) {
} catch (error) {
console.error(
`Failed to load ${pathMetadata}. Please make sure the file exists and exports a MetadataDefinition.`
);
console.error(e);
console.error(error);
}

const localizedFaker = `faker${locale.replace(/^([a-z]+)/, (part) =>
Expand Down Expand Up @@ -367,8 +367,8 @@ async function main(): Promise<void> {
writeFileSync(pathDocsGuideLocalization, localizationContent);
}

main().catch((e) => {
main().catch((error) => {
// Workaround until top level await is available
console.error(e);
console.error(error);
process.exit(1);
});
2 changes: 1 addition & 1 deletion src/modules/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ export class HelpersModule extends SimpleHelpersModule {
// If anyone actually needs to optimize this specific code path, please open a support issue on github
try {
params = JSON.parse(`[${parameters}]`);
} catch (err) {
} catch {
// since JSON.parse threw an error, assume parameters was actually a string
params = [parameters];
}
Expand Down

0 comments on commit e946e6a

Please sign in to comment.