mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-24 16:29:45 +00:00
[ci] add stylelint dependency and minimal config (#5926)
## Summary Adds [stylelint](https://stylelint.io/) configuration and tooling to enforce CSS/SCSS code quality and consistency across Vue components. Starts with 21 focused rules for linting CSS in Vue SFC files and standalone stylesheets. Configuration uses postcss-html to parse Vue `<style>` blocks and includes whitelists for Tailwind v4 at-rules (`@reference`, `@plugin`, `@custom-variant`, `@utility`) and Electron-specific CSS properties (`speak: none`, `app-region`). Rules emphasize modern CSS syntax (numeric font weights, modern color functions, double-colon pseudo-elements) while avoiding overly opinionated rules like hex color length enforcement (for now). Currently finds 113 issues (79% auto-fixable). This PR only adds the tooling via `pnpm stylelint` and `pnpm stylelint:fix` scripts - no pre-commit hooks or CI integration yet. A follow-up PR will auto-fix the fixable issues and optionally add enforcement to the commit workflow. ## Changes - **What**: Integrated [stylelint](https://stylelint.io/) with Vue.js support via postcss-html parser - **Dependencies**: Added `stylelint@16.24.0`, `postcss-html@1.8.0` ## Review Focus CSS rule strictness and Tailwind CSS compatibility - particularly the `no-descending-specificity` rule and Tailwind-specific function ignores. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5926-ci-add-stylelint-dependency-and-minimal-config-2836d73d3650813ea7b7eb714ba7748a) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
"prepare": "husky || true && git config blame.ignoreRevsFile .git-blame-ignore-revs || true",
|
||||
"preview": "nx preview",
|
||||
"storybook": "nx storybook -p 6006",
|
||||
"stylelint:fix": "stylelint --cache --fix",
|
||||
"stylelint": "stylelint --cache",
|
||||
"test:browser": "pnpm exec nx e2e",
|
||||
"test:unit": "nx run test",
|
||||
"typecheck": "vue-tsc --noEmit",
|
||||
@@ -79,8 +81,10 @@
|
||||
"knip": "catalog:",
|
||||
"lint-staged": "catalog:",
|
||||
"nx": "catalog:",
|
||||
"postcss-html": "catalog:",
|
||||
"prettier": "catalog:",
|
||||
"storybook": "catalog:",
|
||||
"stylelint": "catalog:",
|
||||
"tailwindcss": "catalog:",
|
||||
"tailwindcss-primeui": "catalog:",
|
||||
"tsx": "catalog:",
|
||||
|
||||
Reference in New Issue
Block a user