Skip to content

[eslint-plugin] Declare eslint as a peer dependency - #1977

Draft
rodrigosdev wants to merge 4 commits into
meta:mainfrom
rodrigosdev:chore/1248-eslint-peer-dep
Draft

rodrigosdev wants to merge 4 commits into
meta:mainfrom
rodrigosdev:chore/1248-eslint-peer-dep

Conversation

@rodrigosdev

Copy link
Copy Markdown

What changed / motivation ?

@stylexjs/eslint-plugin does 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 read context.filename and context.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.filename is undefined. 8.40.0 through 10.13.0 give identical results with the crash fix applied. No lockfile change.

Pre-flight checklist

🤖 Generated with Claude Code

`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>
@meta-cla

meta-cla Bot commented Oct 21, 2026

Copy link
Copy Markdown

Hi @rodrigosdev!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
stylex Ignored Ignored Oct 21, 2026 4:21pm UTC

Request Review

@henryqdineen

Copy link
Copy Markdown
Collaborator

Depends on #1976

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.

@rodrigosdev
rodrigosdev marked this pull request as draft October 21, 2026 16:03
@rodrigosdev

Copy link
Copy Markdown
Author

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!

rodrigosdev and others added 2 commits October 21, 2026 17:04
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>
@rodrigosdev
rodrigosdev force-pushed the chore/1248-eslint-peer-dep branch from 866eba7 to 1561791 Compare October 21, 2026 16:05
@meta-cla

meta-cla Bot commented Oct 21, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 21, 2026
@rodrigosdev
rodrigosdev marked this pull request as ready for review October 23, 2026 19:09
@rodrigosdev
rodrigosdev marked this pull request as draft October 23, 2026 19:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[eslint-plugin] eslint plugin doesn't specify eslint version compat

2 participants