aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-14 11:07:03 +0200
committerGitHub <[email protected]>2023-10-14 09:07:03 +0000
commite946e6a651b39d49a884acd9f6468bb18e985bf2 (patch)
tree058d76a86567dade923a22db2f7f57d957769dcb
parente228183efc0fe74ee0438fbcb693932358921a20 (diff)
downloadfaker-e946e6a651b39d49a884acd9f6468bb18e985bf2.tar.xz
faker-e946e6a651b39d49a884acd9f6468bb18e985bf2.zip
infra(unicorn): catch-error-name (#2471)
-rw-r--r--.eslintrc.js1
-rw-r--r--scripts/generateLocales.ts8
-rw-r--r--src/modules/helpers/index.ts2
3 files changed, 5 insertions, 6 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index aa20f3ce..5f83641a 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -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',
diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts
index 70e40157..86704a7c 100644
--- a/scripts/generateLocales.ts
+++ b/scripts/generateLocales.ts
@@ -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) =>
@@ -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);
});
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts
index 7548c15b..f4ceaaf4 100644
--- a/src/modules/helpers/index.ts
+++ b/src/modules/helpers/index.ts
@@ -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];
}