Skip to content
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

ESLint Rule to enforce usage of shared media queries and other constants #725

Open
nmn opened this issue Oct 9, 2024 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@nmn
Copy link
Contributor

nmn commented Oct 9, 2024

Depends on #724


If we implement a stylex.defineConsts API, we should also have a lint rule that enforces consistent usage of those constants in your codebase.

For example, you should be able to configure this lint rule to disallow any string media queries from being used and to enforce that all media queries are used by importing the shared media queries instead.

Advanced: File tree knowledge

The lint rule could discover all stylex.defineConsts definitions in your codebase and automatically error only when a value equal or close to a constant is used in the codebase. This can include all types of values (such as lengths, colors, and media queries)

@nmn nmn added enhancement New feature or request good first issue Good for newcomers labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant