Skip to content

Repo: Add lint rules for using context wrappers #7930

Closed as not planned
Closed as not planned
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Suggestion

In #7914 I added wrapper methods so we can support multiple versions of ESLint, per https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/ -> #7816 -> #7812.

- context.getSourceCode()
+ getSourceCode(context)

The wrapper methods mean our rules will work on ESLint 7, 8, and even 9 once the old deprecated versions are removed. We should lint to make sure folks are using the wrappers and not the new, doesn't-exist-in-old-ESLint versions equivalents.

Unit tests will eventually capture this too but I think failing a lint rule -especially if it has an auto-fixer- would be much easier for contributors.

Aside: I did that PR without any review to quickly fix lint failures on the main branch. If there's some better way to approach this problem, we should consider it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    repo maintenancethings to do with maintenance of the repo, and not with code/docstriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions