-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add custom linter rule to prevent usage of string literals in widgets #260
Comments
This should be easy to implement, but I fear about all the false positives this might raise. This would have to be empirically verified. Where exactly do you think string literals should be disallowed? In the build method of widgets? In the whole widget class? |
I was thinking in the build method. We might have a issue about logs though, how would you approach that? |
It all depends on what logic we would define for this.
There could be some config to describe exceptions for where the lint error should be raised. TBH I feel like there would be a plethora of false positives making this lint very annoying to use. |
I'll propose an implementation in the next hours and perhaps we can discuss it better looking at the code. |
Thanks for the suggestion, its true that the codebase is not prepared for outside contributions. Regarding the implementation, before you jump into code I think we can first discuss what kind of logic we want here, since implementation will be the least of the problems methinks. |
Sure, I'm experimenting so we can use it on our project directly using my fork (or simply putting the code in our project) if the team wants it. |
Here's a quick proposal draft to further add to our discussion: #261 |
This is definitely possible to track. Generally our approach to lints is that we are a-ok with them not catching every violation, but we want to avoid false-positives to fullest extent. |
When using internalization (e.g. through a package such as
i18n
), no text placed in the UI should be hardcoded to one language. We could implement a custom linter rule to prevent this from happening.The text was updated successfully, but these errors were encountered: