-
Notifications
You must be signed in to change notification settings - Fork 19
chore(lint): enforce tailwind design tokens #241
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ | |
| "ecmaVersion": 2021, | ||
| "sourceType": "module" | ||
| }, | ||
| "plugins": ["react", "@typescript-eslint", "jsx-a11y"], | ||
| "plugins": ["react", "@typescript-eslint", "jsx-a11y", "tailwindcss"], | ||
| "rules": { | ||
| "import/extensions": [ | ||
| "warn", | ||
|
|
@@ -42,7 +42,8 @@ | |
| "import/no-unresolved": [2, { "commonjs": true, "amd": true }], | ||
| "import/no-extraneous-dependencies": 2, | ||
| "import/order": "error", | ||
| "react/react-in-jsx-scope": ["off"] | ||
| "react/react-in-jsx-scope": ["off"], | ||
| "tailwindcss/no-arbitrary-value": "error" | ||
| }, | ||
| "settings": { | ||
| "import/resolver": { | ||
|
|
@@ -52,6 +53,9 @@ | |
| }, | ||
| "react": { | ||
| "version": "detect" | ||
| }, | ||
| "tailwindcss": { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn’t fully enforce the rule across the current codebase because the plugin’s default
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plugin only inspects call expressions whose callee is listed in |
||
| "config": "tailwind.config.js" | ||
| } | ||
| }, | ||
| "overrides": [ | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tailwindcss/no-arbitrary-valueis broader than "design token enforcement" here: it also rejects valid Tailwind arbitrary variants/modifiers, not just raw values. I reproduced this locally with<div className="data-[state=open]:pb-8" />, which fails withArbitrary value detected in data-[state=open]:pb-8. Because this repo already depends on Headless UI, that is a realistic false-positive path for standard Tailwind state selectors, and it will force inline disables as soon as we adopt them.