feat(eslint-plugin): export recommended flat config#1656
Conversation
|
Hi @AdityyaX! 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. |
|
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 ?
This PR adds an exported
recommendedconfiguration to@stylexjs/eslint-plugin. This enables users of the new ESLint Flat Config system (ESLint 9+) to set up StyleX rules easily usingstylex.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.recommendedortseslint.configs.recommended.Linked PR/Issues
Fixes #1632
Additional Context
The
recommendedconfiguration automatically handles the plugin registration under the@stylexjsnamespace 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:
packages/@stylexjs/eslint-plugin/src/index.jsto export aconfigsobject.Tests:
configs.recommendedobject.Pre-flight checklist