Repository navigation
[eslint-plugin] Declare eslint as a peer dependency - #1977
rodrigosdev wants to merge 4 commits into
Conversation
`isNumber` called `context.getScope()`, which ESLint 9 removed. Any number-valued property set to an imported or undeclared identifier made `valid-styles` throw `context.getScope is not a function`. Use `sourceCode.getScope(node)` instead, available since ESLint 8.37. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi @rodrigosdev! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
can it stay in draft until that lands? or be based off of that branch. I understand you probably can't use github stacked PRs since you are opening the PR from your fork. |
Converted to draft! |
The reasoning lives in the PR description instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Supported range is ESLint 8.40.0 and up, since rules read `context.filename` and `context.sourceCode`. Verified against 8.40.0, 8.57.1, 9.39.5 and 10.13.0. Fixes meta#1248 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
866eba7 to
1561791
Compare
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
What changed / motivation ?
@stylexjs/eslint-plugindoes not declare which ESLint versions it supports, so users cannot tell if it works with their setup.This adds
peerDependencies: { "eslint": "^8.40.0 || ^9.0.0 || ^10.0.0" }. 8.40.0 is the floor because rules readcontext.filenameandcontext.sourceCode.Linked PR/Issues
Fixes #1248
Depends on #1976, which makes the 9 and 10 ranges accurate. Until it merges, this diff also includes its commit.
Additional Context
Linted a fixture with every rule against ESLint 8.39.0, 8.40.0, 8.57.1, 9.39.5 and 10.13.0. 8.39.0 fails because
context.filenameis undefined. 8.40.0 through 10.13.0 give identical results with the crash fix applied. No lockfile change.Pre-flight checklist
Contribution Guidelines
🤖 Generated with Claude Code