Add Propel Oxlint rule for Tailwind shorthand#112
Merged
Conversation
|
📚 Storybook preview: https://pr-112-propel-storybook.vamsi-906.workers.dev |
There was a problem hiding this comment.
Pull request overview
Adds a project-specific Oxlint plugin to enforce Tailwind CSS v4 shorthand forms (CSS var arbitrary values + presence-only data-* variants), wires it into the workspace lint config, and applies the resulting shorthand updates across Propel components. The branch also keeps Storybook interaction-test stability improvements and Vitest coverage dependency updates.
Changes:
- Introduce
tools/oxlint-plugin-propelwith thepropel/prefer-tailwind-v4-shorthandrule + unit tests. - Enable the rule in the root
vite.config.tsand apply shorthand rewrites across component class strings. - Update Storybook interaction tests to use more robust portal queries; add Vitest coverage dependency and lockfile updates.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Registers the local Oxlint plugin and enables the new Propel rule. |
| tools/oxlint-plugin-propel/vite.config.ts | Adds Vite+ config for building/linting/formatting the plugin package. |
| tools/oxlint-plugin-propel/tsconfig.json | TypeScript config for the new Oxlint plugin package. |
| tools/oxlint-plugin-propel/tests/index.test.ts | RuleTester-based unit tests for the new rule + autofix output. |
| tools/oxlint-plugin-propel/src/index.ts | Implements the prefer-tailwind-v4-shorthand rule and exports the plugin. |
| tools/oxlint-plugin-propel/README.md | Documents the rule behavior and local jsPlugins setup. |
| tools/oxlint-plugin-propel/package.json | Declares the new workspace-private plugin package and its dependencies. |
| tools/oxlint-plugin-propel/.gitignore | Ignores build output and local artifacts for the plugin package. |
| pnpm-lock.yaml | Adds the new tool package and updates dependency graph (Vitest coverage-related). |
| packages/propel/src/internal/scrollbar.ts | Converts presence-only data variants to Tailwind v4 shorthand. |
| packages/propel/src/internal/node-slot.ts | Converts CSS var arbitrary values to Tailwind v4 shorthand. |
| packages/propel/src/components/toolbar/index.tsx | Converts presence-only data variants to shorthand. |
| packages/propel/src/components/toast/toast.stories.tsx | Makes portal assertions more robust via findByRole with name scoping. |
| packages/propel/src/components/toast/index.tsx | Converts data-[ending] variant to shorthand. |
| packages/propel/src/components/tabs/index.tsx | Converts data-[active] / group-data-[active] to shorthand. |
| packages/propel/src/components/table/index.tsx | Converts data-[popup-open] to shorthand. |
| packages/propel/src/components/switch/index.tsx | Converts `data-[checked |
| packages/propel/src/components/search/index.tsx | Converts data-[expanded] / not-data-[expanded] to shorthand. |
| packages/propel/src/components/radio/index.tsx | Converts `data-[checked |
| packages/propel/src/components/pill/index.tsx | Converts CSS var and data-[pressed] variants to shorthand. |
| packages/propel/src/components/pagination/pagination.stories.tsx | Reduces flake by waiting on portaled menuitems and highlighting state. |
| packages/propel/src/components/nav-item/index.tsx | Converts `data-[active |
| packages/propel/src/components/icon-button/index.tsx | Converts CSS var arbitrary value to shorthand. |
| packages/propel/src/components/checkbox/index.tsx | Converts presence-only data-* variants to shorthand, including stacked variants. |
| packages/propel/src/components/checkbox/checkbox.stories.tsx | Updates test assertions to match new shorthand class names. |
| packages/propel/src/components/button/index.tsx | Converts CSS var arbitrary value to shorthand. |
| packages/propel/src/components/breadcrumb/index.tsx | Converts `data-[popup-open |
| packages/propel/src/components/breadcrumb/breadcrumb.stories.tsx | Updates portal queries and menu close assertions for stability. |
| packages/propel/src/components/accordion/index.tsx | Converts CSS var arbitrary value + presence-only data variants to shorthand. |
| packages/propel/src/components/accordion/accordion.stories.tsx | Updates documentation comment to match shorthand form. |
| packages/propel/package.json | Adds @vitest/coverage-v8 dev dependency. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (1)
packages/propel/package.json:88
@vitest/coverage-v8is pinned to 4.1.8 whilevitestis pinned to 4.1.9 in this package. In the lockfile this results in an additionalvitest@4.1.8install to satisfy peers, which can be confusing and can lead to subtle mismatches in coverage tooling. Consider aligning the@vitest/coverage-v8version with thevitestversion used by this package (or vice-versa) so only one Vitest version is required.
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@typescript/native-preview": "7.0.0-dev.20260509.2",
"@vitest/browser-playwright": "4.1.9",
"@vitest/coverage-v8": "4.1.8",
"playwright": "^1.61.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"storybook": "^10.4.5",
"storybook-addon-pseudo-states": "^10.4.5",
"tailwindcss": "^4.3.1",
"typescript": "^6.0.3",
"vite-plus": "catalog:",
"vitest": "4.1.9",
"wrangler": "4.100.0"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+45
to
+53
| docs: { | ||
| description: | ||
| "Prefer Tailwind CSS v4 shorthand syntax for simple arbitrary values and data variants.", | ||
| recommended: true, | ||
| }, | ||
| fixable: "code", | ||
| messages: { | ||
| preferTailwindV4Shorthand: "Use Tailwind CSS v4 shorthand syntax for this class string.", | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation