-
Notifications
You must be signed in to change notification settings - Fork 37
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
chore(condo): DOMA-10737 improve lint-i18n-translations.js #5530
base: main
Are you sure you want to change the base?
Conversation
@@ -3,55 +3,59 @@ const fetch = require('node-fetch') | |||
|
|||
const { getAppServerUrl } = require('@open-condo/cli') | |||
|
|||
program.option('-f, --filter <names...>', 'Filters apps by name') | |||
program.option('-s, --sleep <number>', 'Sleep interval between polling in ms', /\d{1,12}/, '3000') | |||
program.option('-t, --timeout <number>', 'Max polling time in ms', /\d{1,12}/, '120000') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RegExp is deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we don't use a "RESET_PASSWORD" message type, so you should remove translations for that type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I want to add this check to the linter
|
const filePath = path.join(messageDirPath, file) | ||
if (file.endsWith('.njk')) { | ||
try { | ||
await fs.access(filePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about to nest code even more and wrap every single line in try-catch? Because right now the code reads too easily :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need to refactor this part heavily, right now its heavy 400-liner, no one can read and understand.
I hate this kind of files, because you cannot even tell somebody to fix something in it.
It's like @open-condo/next
, very heavy and hard to understand files with unstructured code...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can partially fix it with naming (for example this utils scans for push / email templates, you can call it loadNotificationTemplates
or something, remove nested try catches here, panic is enough for bin
No description provided.