{"_id":"@brickjs-fe/stylelint-config","_rev":"2-a7de01b80752868badb7ca1da390ebf9","name":"@brickjs-fe/stylelint-config","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@brickjs-fe/stylelint-config","version":"0.0.1","keywords":["stylelint","stylelint-config","css","scss","sass","less","vue3","typescript","brickjs"],"author":{"name":"brickFE","email":"brickfe@163.com"},"license":"MIT","_id":"@brickjs-fe/stylelint-config@0.0.1","maintainers":[{"name":"brickjs-fe","email":"brickfe@163.com"}],"homepage":"https://github.com/brickFE/brickjs#readme","bugs":{"url":"https://github.com/brickFE/brickjs/issues"},"dist":{"shasum":"75d55a29efde1b3192d19c3e1b8942eeb1bb5dae","tarball":"https://registry.npmjs.org/@brickjs-fe/stylelint-config/-/stylelint-config-0.0.1.tgz","fileCount":3,"integrity":"sha512-eKURfObh6bPZRwdDsjTKnNOt8BjSVbJYXoXSxTmjcNyeDO/pSYQtBFplrD7WZS3d5Zf2kVNCu5M2ouUD6jYong==","signatures":[{"sig":"MEUCIQDOhPUBuVd5joWXbw4k8pi7nJRs6VBZddJkPYoVnJC6uAIgL7Esetr+OQXbf6VHOmUP7RewORPI3zkJU1WbvzIf8Wo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16055},"main":"index.js","type":"module","engines":{"node":">=20.10.0","pnpm":">=10.11.0"},"gitHead":"073808cdd3d4ab12a6e708ae78f6a9393c1385dd","scripts":{"test":"echo \"Error: no test specified\" && exit 1","release":"npm publish","postpublish":"echo 'Successfully published @brickjs-fe/brick-stylelint-config!'","prepublishOnly":"echo 'Preparing to publish @brickjs-fe/brick-stylelint-config...'","release:dry-run":"npm publish --dry-run"},"_npmUser":{"name":"brickjs-fe","email":"brickfe@163.com"},"repository":{"url":"git+https://github.com/brickFE/brickjs.git","type":"git","directory":"packages/brick-stylelint-config"},"_npmVersion":"10.8.2","description":"BrickJs Stylelint 配置 - 适用于 Vue3 + TypeScript 项目的 CSS 代码检查配置","directories":{},"_nodeVersion":"20.19.4","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.11.0","peerDependencies":{"stylelint":"^16.0.0"},"peerDependenciesMeta":{"stylelint":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/stylelint-config_0.0.1_1757942859764_0.14751594593517647","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@brickjs-fe/stylelint-config","version":"0.0.2","description":"BrickJs Stylelint 配置 - 适用于 Vue3 + TypeScript 项目的 CSS 代码检查配置","main":"index.js","type":"module","scripts":{"test":"echo \"Error: no test specified\" && exit 1","postinstall":"node ./bin/setup.js","prepublishOnly":"echo 'Preparing to publish @brickjs-fe/stylelint-config...'","postpublish":"echo 'Successfully published @brickjs-fe/stylelint-config!'","release":"pnpm exec brick release --skip-build","release:dry-run":"pnpm exec brick release --dry-run --skip-build"},"bin":{"brick-stylelint-setup":"bin/setup.js"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"keywords":["stylelint","stylelint-config","css","scss","sass","less","vue3","typescript","brickjs"],"author":{"name":"brickFE","email":"brickfe@163.com"},"license":"MIT","packageManager":"pnpm@10.11.0","repository":{"type":"git","url":"git+https://github.com/brickFE/brickjs.git","directory":"packages/brick-stylelint-config"},"bugs":{"url":"https://github.com/brickFE/brickjs/issues"},"homepage":"https://github.com/brickFE/brickjs#readme","peerDependencies":{"stylelint":"^16.0.0"},"peerDependenciesMeta":{"stylelint":{"optional":true}},"devDependencies":{"@brickjs-fe/brick-cli":"workspace:^"},"engines":{"node":">=20.10.0","pnpm":">=10.11.0"},"_id":"@brickjs-fe/stylelint-config@0.0.2","gitHead":"51972656049ecbb3c1614c7f62c11f9a4ec888d2","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Zd75s4TAMDGqrJkZDkkDqb+r3Tg0g0pAhfcNswHQNFLJtdJXXVRlLYcoNWrlO43Io8cT2axKf+WkVHXgrKHpXw==","shasum":"0c3468246e4ba56ea7f57cd8e198fc00f7789eba","tarball":"https://registry.npmjs.org/@brickjs-fe/stylelint-config/-/stylelint-config-0.0.2.tgz","fileCount":5,"unpackedSize":19800,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGkblw69ePpmOaOKLkyKcOdV9MQKHv5sn6v+rAbGRLisAiEAlQvVZ8R3UHHHuFzmpApkfeCHUe9VciVk7CkfYhNp6ko="}]},"_npmUser":{"name":"brickjs-fe","email":"brickfe@163.com"},"directories":{},"maintainers":[{"name":"brickjs-fe","email":"brickfe@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stylelint-config_0.0.2_1758119918806_0.6272019280001999"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-15T13:27:39.656Z","modified":"2025-09-17T14:38:39.255Z","0.0.1":"2025-09-15T13:27:39.954Z","0.0.2":"2025-09-17T14:38:39.026Z"},"bugs":{"url":"https://github.com/brickFE/brickjs/issues"},"author":{"name":"brickFE","email":"brickfe@163.com"},"license":"MIT","homepage":"https://github.com/brickFE/brickjs#readme","keywords":["stylelint","stylelint-config","css","scss","sass","less","vue3","typescript","brickjs"],"repository":{"type":"git","url":"git+https://github.com/brickFE/brickjs.git","directory":"packages/brick-stylelint-config"},"description":"BrickJs Stylelint 配置 - 适用于 Vue3 + TypeScript 项目的 CSS 代码检查配置","maintainers":[{"name":"brickjs-fe","email":"brickfe@163.com"}],"readme":"# @brickjs-fe/stylelint-config\n\n<div align=\"center\">\n\n![BrickJs Stylelint Config](https://img.shields.io/badge/BrickJs-Stylelint%20Config-blue?style=for-the-badge&logo=stylelint)\n\n**适用于 Vue3 + TypeScript 项目的 CSS 代码检查配置**\n\n[![npm version](https://img.shields.io/npm/v/@brickjs-fe/stylelint-config?style=flat-square)](https://www.npmjs.com/package/@brickjs-fe/stylelint-config)\n[![npm downloads](https://img.shields.io/npm/dm/@brickjs-fe/stylelint-config?style=flat-square)](https://www.npmjs.com/package/@brickjs-fe/stylelint-config)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n</div>\n\n## 📖 项目介绍\n\n`@brickjs-fe/stylelint-config` 是 BrickJs 项目提供的 Stylelint 配置包，专为 Vue3 + TypeScript 项目设计。该配置提供了完整的 CSS 代码检查规则，确保样式代码的质量和一致性。\n\n## ✨ 特性\n\n- 🎯 **Vue3 支持**: 完整的 Vue3 单文件组件样式支持\n- 🔧 **多语言支持**: 支持 CSS、SCSS、SASS、Less 等样式语言\n- 🎨 **统一风格**: 与 Prettier 规则完美兼容\n- 📝 **详细注释**: 每个规则都有详细的中文注释说明\n- 🔄 **灵活配置**: 支持覆盖和自定义规则\n- 🚀 **现代 CSS**: 支持现代 CSS 特性和最佳实践\n\n## 🛠️ 技术栈\n\n- **Stylelint**: CSS 代码检查工具\n- **stylelint-config-standard**: 标准配置\n- **stylelint-config-standard-scss**: SCSS 标准配置\n- **stylelint-config-prettier**: Prettier 兼容配置\n- **stylelint-order**: 属性顺序检查\n\n## 🚀 快速开始\n\n### 安装\n\n```bash\n# 使用 pnpm 安装\npnpm add -D @brickjs-fe/stylelint-config stylelint\n\n# 或使用 npm 安装\nnpm install -D @brickjs-fe/stylelint-config stylelint\n\n# 或使用 yarn 安装\nyarn add -D @brickjs-fe/stylelint-config stylelint\n\n# 或使用 bun 安装\nbun add -D @brickjs-fe/stylelint-config stylelint\n```\n\n### 基本使用\n\n在项目根目录创建 `.stylelintrc.js` 文件：\n\n```javascript\nmodule.exports = require(\"@brickjs-fe/stylelint-config\");\n```\n\n### 在 package.json 中使用\n\n```json\n{\n  \"stylelint\": {\n    \"extends\": [\"@brickjs-fe/stylelint-config\"]\n  }\n}\n```\n\n### 使用 ES 模块\n\n```javascript\n// .stylelintrc.mjs\nimport config from \"@brickjs-fe/stylelint-config\";\n\nexport default config;\n```\n\n## 📋 配置说明\n\n### 基础规则\n\n- **at-rule-no-unknown**: 禁止未知的 at 规则\n- **selector-pseudo-class-no-unknown**: 禁止未知的伪类选择器\n- **selector-pseudo-element-no-unknown**: 禁止未知的伪元素选择器\n\n### 代码风格规则\n\n- **block-no-empty**: 禁止空块\n- **comment-no-empty**: 禁止空注释\n- **no-duplicate-selectors**: 禁止重复的选择器\n- **no-empty-source**: 禁止空源\n- **no-extra-semicolons**: 禁止额外的分号\n\n### 颜色和值规则\n\n- **color-no-invalid-hex**: 禁止无效的十六进制颜色\n- **function-name-case**: 禁止无效的命名\n- **number-no-trailing-zeros**: 禁止无效的数字\n- **string-no-newline**: 禁止无效的字符串\n- **unit-no-unknown**: 禁止无效的单位\n\n### 属性规则\n\n- **property-no-unknown**: 禁止无效的属性\n- **keyframe-declaration-no-important**: 禁止无效的关键字\n- **declaration-block-no-duplicate-properties**: 禁止无效的声明\n- **declaration-block-no-redundant-longhand-properties**: 禁止无效的声明块\n- **shorthand-property-no-redundant-values**: 禁止无效的简写属性\n\n### 选择器规则\n\n- **selector-max-compound-selectors**: 限制选择器数量\n- **selector-max-id**: 限制 ID 选择器\n- **selector-max-type**: 限制类型选择器\n- **selector-max-universal**: 限制通用选择器\n\n### 媒体查询规则\n\n- **media-feature-name-no-unknown**: 禁止无效的媒体特性\n- **media-feature-range-notation**: 使用现代媒体查询\n\n### 属性顺序规则\n\n- **order/properties-order**: 属性顺序检查\n  - 定位属性\n  - 盒模型属性\n  - 字体属性\n  - 背景属性\n  - 其他属性\n\n### 兼容性规则\n\n- **property-no-vendor-prefix**: 禁止使用浏览器前缀\n- **value-no-vendor-prefix**: 禁止使用浏览器前缀\n- **selector-no-vendor-prefix**: 禁止使用浏览器前缀\n\n### 性能规则\n\n- **max-nesting-depth**: 限制选择器嵌套深度\n- **selector-max-compound-selectors**: 限制选择器数量\n- **selector-max-id**: 限制 ID 选择器\n\n### 可访问性规则\n\n- **color-no-hex**: 禁止使用颜色作为唯一标识\n- **color-named**: 禁止使用颜色名称\n- **color-function-notation**: 使用现代颜色函数\n\n### 现代 CSS 规则\n\n- **color-function-notation**: 使用现代颜色函数\n- **length-zero-no-unit**: 使用现代长度单位\n- **selector-not-notation**: 使用现代选择器\n- **media-feature-range-notation**: 使用现代媒体查询\n\n## 🔧 配置选项\n\n### 环境配置\n\n```javascript\nmodule.exports = {\n  ...require(\"@brickjs-fe/stylelint-config\"),\n  // 可以在这里添加项目特定的配置\n  rules: {\n    // 覆盖特定规则\n    \"max-nesting-depth\": 4, // 允许更深的嵌套\n  },\n};\n```\n\n### 规则覆盖\n\n```javascript\nmodule.exports = {\n  ...require(\"@brickjs-fe/stylelint-config\"),\n  rules: {\n    // 覆盖特定规则\n    \"color-no-hex\": false, // 允许使用十六进制颜色\n    \"property-no-unknown\": [\n      true,\n      {\n        ignoreProperties: [\"composes\", \"custom-property\"],\n      },\n    ],\n  },\n};\n```\n\n## 📁 文件支持\n\n该配置支持以下文件类型：\n\n- `.css` - CSS 文件\n- `.scss` - SCSS 文件\n- `.sass` - SASS 文件\n- `.less` - Less 文件\n- `.vue` - Vue 单文件组件\n- `.jsx` - React JSX 文件\n- `.tsx` - TypeScript JSX 文件\n\n## 🎯 最佳实践\n\n### 1. 项目结构\n\n```\nproject/\n├── .stylelintrc.js        # Stylelint 配置\n├── .prettierrc.js         # Prettier 配置\n├── .eslintrc.js           # ESLint 配置\n├── src/                   # 源代码目录\n│   ├── styles/           # 样式文件\n│   │   ├── global.css    # 全局样式\n│   │   ├── variables.css # 变量定义\n│   │   └── components/   # 组件样式\n│   ├── components/       # Vue 组件\n│   └── views/           # 页面组件\n└── package.json          # 项目配置\n```\n\n### 2. 样式示例\n\n```css\n/* 组件样式 */\n.example {\n  /* 定位 */\n  position: relative;\n  top: 0;\n  left: 0;\n  z-index: 1;\n\n  /* 盒模型 */\n  display: flex;\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  padding: 20px;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n\n  /* 字体 */\n  font-family: \"Arial\", sans-serif;\n  font-size: 16px;\n  font-weight: 400;\n  line-height: 1.5;\n  text-align: center;\n  color: #333;\n\n  /* 背景 */\n  background-color: #fff;\n  background-image: url(\"bg.png\");\n  background-position: center;\n  background-repeat: no-repeat;\n  background-size: cover;\n\n  /* 其他 */\n  opacity: 1;\n  visibility: visible;\n  overflow: hidden;\n  cursor: pointer;\n  user-select: none;\n  transition: all 0.3s ease;\n  transform: translateX(0);\n  animation: fadeIn 0.5s ease;\n}\n\n@keyframes fadeIn {\n  from {\n    opacity: 0;\n  }\n  to {\n    opacity: 1;\n  }\n}\n```\n\n### 3. SCSS 示例\n\n```scss\n// 变量定义\n$primary-color: #007bff;\n$secondary-color: #6c757d;\n$border-radius: 4px;\n\n// 混入\n@mixin button-style($bg-color, $text-color: #fff) {\n  background-color: $bg-color;\n  color: $text-color;\n  border: none;\n  border-radius: $border-radius;\n  padding: 8px 16px;\n  cursor: pointer;\n  transition: background-color 0.3s ease;\n\n  &:hover {\n    background-color: darken($bg-color, 10%);\n  }\n}\n\n// 组件样式\n.button {\n  @include button-style($primary-color);\n\n  &--secondary {\n    @include button-style($secondary-color);\n  }\n\n  &--large {\n    padding: 12px 24px;\n    font-size: 18px;\n  }\n}\n```\n\n## 🔍 故障排除\n\n### 常见问题\n\n1. **规则冲突**: 确保 Stylelint 配置与 Prettier 规则兼容\n2. **文件格式**: 检查文件扩展名是否被支持\n3. **编辑器集成**: 确保编辑器已安装 Stylelint 插件\n\n### 调试技巧\n\n```bash\n# 检查 Stylelint 配置\nnpx stylelint --print-config src/styles/main.css\n\n# 检查特定文件的样式\nnpx stylelint src/components/Button.vue\n\n# 运行 Stylelint 检查\nnpx stylelint src --ext .css,.scss,.vue\n```\n\n## 🤝 贡献指南\n\n1. Fork 本仓库\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'feat: add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 打开 Pull Request\n\n## 📄 许可证\n\n本项目基于 [MIT](https://opensource.org/licenses/MIT) 许可证开源。\n\n## 👥 维护者\n\n- [brickFE](https://github.com/brickFE) - _项目维护者_\n\n## 🙏 致谢\n\n感谢以下开源项目的支持：\n\n- [Stylelint](https://stylelint.io/) - CSS 代码检查工具\n- [stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard) - 标准配置\n- [stylelint-config-prettier](https://github.com/prettier/stylelint-config-prettier) - Prettier 兼容配置\n- [stylelint-order](https://github.com/hudochenkov/stylelint-order) - 属性顺序检查\n\n---\n\n<div align=\"center\">\n\n**如果这个项目对你有帮助，请给它一个 ⭐️**\n\n[报告问题](https://github.com/brickFE/brickjs/issues) · [提出建议](https://github.com/brickFE/brickjs/discussions) · [贡献代码](https://github.com/brickFE/brickjs/pulls)\n\n</div>\n","readmeFilename":"README.md"}