Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra(unicorn): catch-error-name #2471

Merged
merged 2 commits into from Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
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
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
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