12

Add ESLint rule to prevent use of nsIScriptableUnicodeConverter

 3 years ago
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.
neoserver,ios ssh client
Closed Bug 1460100 Opened 4 years ago Closed 17 days ago

Add ESLint rule to prevent use of nsIScriptableUnicodeConverter

Categories

(Firefox Build System :: Lint and Formatting, enhancement)

Firefox Build System ▾
Lint and Formatting ▾

3 Branch

Tracking

(firefox96 fixed)

RESOLVED FIXED

96 Branch

Tracking Status firefox96 --- fixed

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 to reject-osfile and then updating the rule & test.
    • The rule should pick up on the use of Ci.nsIScriptableUnicodeConverter in code.
  • 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
Mentor: standard8
Whiteboard: [lang=js][good-next-bug]

Hello,

Should the rules be in the same files with the "reject-osfile" or in the a separate file in the same folder.

Thanks

Flags: needinfo?(standard8)

As discussed on Matrix, these should be a separate file in the same folder.

Flags: needinfo?(standard8)
Assignee: nobody → onuohaoluebube05
Status: NEW → ASSIGNED

I just submitted a patch for this bug. Please review and guide me on the next step forward.

Thanks.

Flags: needinfo?(standard8)

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.

Flags: needinfo?(standard8)
You need to log in before you can comment on or make changes to this bug.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK