Closed Bug 1460100 Opened 6 years ago Closed 3 years ago

Add ESLint rule to prevent use of nsIScriptableUnicodeConverter

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

3 Branch
enhancement
Not set
normal

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])

Attachments

(1 file)

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().
Version: Version 3 → 3 Branch

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)
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3c2ab42e8391
Added ESLint rule to prevent use of nsIScriptableUnicodeConverter r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: