Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Repo: Add lint rules for using context wrappers #7930

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

Closed
JoshuaKGoldberg opened this issue Nov 14, 2023 · 1 comment
Closed

Repo: Add lint rules for using context wrappers #7930

JoshuaKGoldberg opened this issue Nov 14, 2023 · 1 comment
Labels
repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look

Comments

@JoshuaKGoldberg
Copy link
Member

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!

@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for team members to take a look repo maintenance things to do with maintenance of the repo, and not with code/docs labels Nov 14, 2023
@bradzacher
Copy link
Member

I don't think we need lint rules for this - once v9 releases we'll update the types to make the methods optional and we can add instructions to the JSDoc.

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look
Projects
None yet
Development

No branches or pull requests

2 participants