

Add ESLint rule to prevent use of nsIScriptableUnicodeConverter
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1460100
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Add ESLint rule to prevent use of nsIScriptableUnicodeConverter
Categories
(Firefox Build System :: Lint and Formatting, enhancement)
Tracking
(firefox96 fixed)
96 Branch
People
(Reporter: kmag, Assigned: onuohaoluebube05, Mentored)
References
Details
(Whiteboard: [lang=js][good-next-bug])
nsIScriptableUnicodeConverter is going away, but that fact unfortunately does not stop people from cargo culting existing uses of it for new code. We should add a rule to point people who try to use it to TextEncoder().
I'm happy to mentor this. Here's what I think we should do:
- Create a new rule, i.e.
reject-scriptableunicodeconverter
, this can be based on the existing reject-osfile rule. This should largely be duplicating the existing references toreject-osfile
and then updating the rule & test.- The rule should pick up on the use of
Ci.nsIScriptableUnicodeConverter
in code.
- The rule should pick up on the use of
- The rule can be tested via the unit tests
- The rule should also be tested against the full tree using
./mach eslint --warnings
(note there are currently other warnings output as well at the moment. - Ensure documentation is added similar to the existing .rst file, documentation can be checked via
./mach doc
Hello,
Should the rules be in the same files with the "reject-osfile" or in the a separate file in the same folder.
Thanks
As discussed on Matrix, these should be a separate file in the same folder.
I just submitted a patch for this bug. Please review and guide me on the next step forward.
Thanks.
Hello,
I actually forgot to do hg add
Have done that.
Thanks
No need to request info / comment when submitting a patch - review requests are automatically notified to us.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK