App: [$250] Create a new linter to find missing translated errors

Context https://expensify.slack.com/archives/C03TQ48KC/p1660838478754859

Problem

In actions files we are adding some default error messages. Given we are not in a react component, it’s easy to forget the error messages need to be localized and them being errors and some very uncommon, it will be very hard for anyone to notice they are not localized.

Solution

Figure out if we can build a linter that fails whenever we have a call to DateUtils.getMicroseconds() and not a call to Localize.translateLocal. Code usually looks like this:

                        errors: {
                            [DateUtils.getMicroseconds()]: "Your changes couldn't be saved. The workspace was modified while you were offline, please try again.",
                        },

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 24 (15 by maintainers)

Most upvoted comments

@adelekennedy applied, thanks

I think, this is ready for payment. Thanks you!

i was just typing that.

I raised a PR for the upgrade #10812

return dateUtilsProperties.length -> return dateUtilsProperties.length > 0

@iwiznia the proposal looks good to me as well! πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed