Skip to content

feat(eslint-plugin): export recommended flat config#1656

Draft
AdityyaX wants to merge 2 commits into
facebook:mainfrom
AdityyaX:feat/eslint-recommended-config
Draft

feat(eslint-plugin): export recommended flat config#1656
AdityyaX wants to merge 2 commits into
facebook:mainfrom
AdityyaX:feat/eslint-recommended-config

Conversation

@AdityyaX

@AdityyaX AdityyaX commented May 10, 2026

Copy link
Copy Markdown

What changed / motivation ?

This PR adds an exported recommended configuration to @stylexjs/eslint-plugin. This enables users of the new ESLint Flat Config system (ESLint 9+) to set up StyleX rules easily using stylex.configs.recommended.

Previously, users had to manually register the plugin and enable every rule. This change aligns StyleX with standard ESLint plugin patterns like js.configs.recommended or tseslint.configs.recommended.

Linked PR/Issues

Fixes #1632

Additional Context

The recommended configuration automatically handles the plugin registration under the @stylexjs namespace and enables the following core rules:

  • @stylexjs/valid-styles: 'error'
  • @stylexjs/valid-shorthands: 'error'
  • @stylexjs/no-unused: 'error'
  • @stylexjs/no-legacy-contextual-styles: 'error'
  • @stylexjs/sort-keys: 'warn'

Screenshots, Tests, Anything Else

Changes:

  • Modified packages/@stylexjs/eslint-plugin/src/index.js to export a configs object.
  • Updated Flow type definitions to support the new exports.

Tests:

  • Verified that the plugin correctly exports the configs.recommended object.
  • Confirmed the configuration structure is compatible with ESLint Flat Config.

Pre-flight checklist

  • I have read the contributing guidelines

@meta-cla

meta-cla Bot commented May 10, 2026

Copy link
Copy Markdown

Hi @AdityyaX!

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 May 10, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
stylex Skipped Skipped May 12, 2026 3:07am

Request Review

@meta-cla

meta-cla Bot commented May 10, 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 May 10, 2026
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] Export recommended config

1 participant