{"_id":"@brickjs-fe/eslint-config","name":"@brickjs-fe/eslint-config","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@brickjs-fe/eslint-config","version":"0.0.1","description":"BrickJs ESLint 配置 - 适用于 Vue3 + TypeScript 项目的 ESLint 配置","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublishOnly":"echo 'Preparing to publish @brickjs-fe/brick-eslint-config...'","postpublish":"echo 'Successfully published @brickjs-fe/brick-eslint-config!'","release":"npm publish","release:dry-run":"npm publish --dry-run"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"keywords":["eslint","eslint-config","vue3","typescript","prettier","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-eslint-config"},"bugs":{"url":"https://github.com/brickFE/brickjs/issues"},"homepage":"https://github.com/brickFE/brickjs#readme","peerDependencies":{"eslint":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","eslint-plugin-vue":"^9.0.0","eslint-plugin-prettier":"^5.0.0","eslint-config-prettier":"^9.0.0"},"peerDependenciesMeta":{"@typescript-eslint/eslint-plugin":{"optional":true},"@typescript-eslint/parser":{"optional":true},"eslint-plugin-vue":{"optional":true},"eslint-plugin-prettier":{"optional":true},"eslint-config-prettier":{"optional":true}},"engines":{"node":">=20.10.0","pnpm":">=10.11.0"},"_id":"@brickjs-fe/eslint-config@0.0.1","gitHead":"073808cdd3d4ab12a6e708ae78f6a9393c1385dd","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-AUqgX9Nm7yluC2jUy5ebSCfXUvqEyBNr+JTTvEbBBP54Eb0qgzIB79Mz3QC4UnqAiNqImt1uLHHLlf+szVuSKA==","shasum":"ec689002c7d02e1e345051bf20335926057cd3c2","tarball":"https://registry.npmjs.org/@brickjs-fe/eslint-config/-/eslint-config-0.0.1.tgz","fileCount":3,"unpackedSize":13405,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEw2CvTyZ4RpuHxpcwdx+YhgBN4aRk2toknmEdCGW1lHAiEA3m3c8vo3qbC/WCLoU0iT3+vNLLENf4eIJR8IBVhD9Ss="}]},"_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/eslint-config_0.0.1_1757942787293_0.8332915974712185"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-15T13:26:26.966Z","0.0.1":"2025-09-15T13:26:27.482Z","modified":"2025-09-15T13:26:27.893Z"},"maintainers":[{"name":"brickjs-fe","email":"brickfe@163.com"}],"description":"BrickJs ESLint 配置 - 适用于 Vue3 + TypeScript 项目的 ESLint 配置","homepage":"https://github.com/brickFE/brickjs#readme","keywords":["eslint","eslint-config","vue3","typescript","prettier","brickjs"],"repository":{"type":"git","url":"git+https://github.com/brickFE/brickjs.git","directory":"packages/brick-eslint-config"},"author":{"name":"brickFE","email":"brickfe@163.com"},"bugs":{"url":"https://github.com/brickFE/brickjs/issues"},"license":"MIT","readme":"# @brickjs-fe/brick-eslint-config\n\n<div align=\"center\">\n\n![BrickJs ESLint Config](https://img.shields.io/badge/BrickJs-ESLint%20Config-blue?style=for-the-badge&logo=eslint)\n\n**适用于 Vue3 + TypeScript 项目的 ESLint 配置**\n\n[![npm version](https://img.shields.io/npm/v/@brickjs-fe/brick-eslint-config?style=flat-square)](https://www.npmjs.com/package/@brickjs-fe/brick-eslint-config)\n[![npm downloads](https://img.shields.io/npm/dm/@brickjs-fe/brick-eslint-config?style=flat-square)](https://www.npmjs.com/package/@brickjs-fe/brick-eslint-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/brick-eslint-config` 是 BrickJs 项目提供的 ESLint 配置包，专为 Vue3 + TypeScript 项目设计。该配置集成了 ESLint、Prettier、Vue 和 TypeScript 的最佳实践，确保代码质量和一致性。\n\n## ✨ 特性\n\n- 🎯 **Vue3 支持**: 完整的 Vue3 单文件组件支持\n- 🔧 **TypeScript 集成**: 全面的 TypeScript 类型检查\n- 🎨 **Prettier 兼容**: 与 Prettier 完美集成，避免冲突\n- 📝 **详细注释**: 每个规则都有详细的中文注释说明\n- 🚫 **禁止末尾逗号**: 内置禁止末尾逗号的规则\n- 🔄 **灵活配置**: 支持覆盖和自定义规则\n\n## 🛠️ 技术栈\n\n- **ESLint**: JavaScript/TypeScript 代码检查\n- **Vue ESLint Plugin**: Vue 单文件组件支持\n- **TypeScript ESLint**: TypeScript 类型检查\n- **Prettier**: 代码格式化集成\n\n## 🚀 快速开始\n\n### 安装\n\n```bash\n# 使用 pnpm 安装\npnpm add -D @brickjs-fe/brick-eslint-config\n\n# 或使用 npm 安装\nnpm install -D @brickjs-fe/brick-eslint-config\n\n# 或使用 yarn 安装\nyarn add -D @brickjs-fe/brick-eslint-config\n\n# 或使用 bun 安装\nbun add -D @brickjs-fe/brick-eslint-config\n```\n\n### 基本使用\n\n在项目根目录创建 `.eslintrc.js` 文件：\n\n```javascript\nmodule.exports = {\n  extends: [\"@brickjs-fe/brick-eslint-config\"],\n  // 可以在这里添加项目特定的规则\n  rules: {\n    // 自定义规则\n  },\n};\n```\n\n### 在 package.json 中使用\n\n```json\n{\n  \"eslintConfig\": {\n    \"extends\": [\"@brickjs-fe/brick-eslint-config\"]\n  }\n}\n```\n\n## 📋 规则说明\n\n### 基础 JavaScript 规则\n\n- **prefer-destructuring**: 优先使用解构赋值（对象必须，数组可选）\n\n### Vue 相关规则\n\n- **vue/no-v-html**: 允许使用 v-html 指令\n- **vue/attributes-order**: 关闭属性顺序检查\n- **vue/require-v-for-key**: 关闭 v-for 必须使用 key 的检查\n- **vue/require-default-prop**: 关闭 props 必须设置默认值的检查\n- **vue/no-unused-components**: 关闭未使用组件的检查\n- **vue/multi-word-component-names**: 关闭组件名必须多个单词的检查\n- **vue/no-setup-props-destructure**: 关闭 setup props 解构的检查\n- **vue/return-in-computed-property**: 关闭计算属性必须有返回值的检查\n\n### TypeScript 相关规则\n\n- **@typescript-eslint/camelcase**: 关闭驼峰命名检查\n- **@typescript-eslint/ban-ts-comment**: 关闭禁止 @ts-ignore 注释的检查\n- **@typescript-eslint/no-unused-vars**: 开启未使用变量的检查\n- **@typescript-eslint/no-var-requires**: 关闭禁止使用 require 的检查\n- **@typescript-eslint/no-explicit-any**: 关闭禁止使用 any 类型的检查\n- **@typescript-eslint/no-empty-function**: 关闭禁止空函数的检查\n- **@typescript-eslint/no-non-null-assertion**: 关闭禁止非空断言的检查\n- **@typescript-eslint/explicit-function-return-type**: 关闭函数必须显式返回类型的检查\n- **@typescript-eslint/explicit-module-boundary-types**: 关闭模块边界必须显式类型的检查\n\n### 代码风格规则\n\n- **comma-dangle**: 禁止末尾逗号\n- **trailing-comma**: 关闭尾随逗号规则\n\n## 🔧 配置选项\n\n### 环境配置\n\n```javascript\nmodule.exports = {\n  extends: [\"@brickjs-fe/brick-eslint-config\"],\n  env: {\n    browser: true, // 浏览器环境\n    node: true, // Node.js 环境\n    es6: true, // ES6 语法支持\n  },\n};\n```\n\n### 解析器配置\n\n```javascript\nmodule.exports = {\n  extends: [\"@brickjs-fe/brick-eslint-config\"],\n  parserOptions: {\n    parser: \"@typescript-eslint/parser\", // TypeScript 解析器\n    ecmaVersion: \"latest\", // ECMAScript 版本\n    sourceType: \"module\", // 模块类型\n  },\n};\n```\n\n### 规则覆盖\n\n```javascript\nmodule.exports = {\n  extends: [\"@brickjs-fe/brick-eslint-config\"],\n  rules: {\n    // 覆盖特定规则\n    \"vue/no-v-html\": \"error\", // 禁止使用 v-html\n    \"comma-dangle\": \"off\", // 关闭末尾逗号检查\n  },\n};\n```\n\n## 📁 文件支持\n\n该配置支持以下文件类型：\n\n- `.js` - JavaScript 文件\n- `.jsx` - React JSX 文件\n- `.ts` - TypeScript 文件\n- `.tsx` - TypeScript JSX 文件\n- `.vue` - Vue 单文件组件\n\n## 🎯 最佳实践\n\n### 1. 项目结构\n\n```\nproject/\n├── .eslintrc.js          # ESLint 配置\n├── .prettierrc           # Prettier 配置\n├── src/                  # 源代码目录\n│   ├── components/       # Vue 组件\n│   ├── views/           # 页面组件\n│   ├── utils/           # 工具函数\n│   └── types/           # 类型定义\n└── package.json         # 项目配置\n```\n\n### 2. 代码示例\n\n```vue\n<template>\n  <div class=\"example\">\n    <h1>{{ title }}</h1>\n    <button @click=\"handleClick\">点击我</button>\n  </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\n\n// 响应式数据\nconst title = ref(\"Hello World\");\n\n// 事件处理函数\nconst handleClick = () => {\n  console.log(\"按钮被点击了\");\n};\n</script>\n\n<style scoped>\n.example {\n  padding: 20px;\n}\n</style>\n```\n\n### 3. TypeScript 类型定义\n\n```typescript\n// types/index.ts\nexport interface User {\n  id: number;\n  name: string;\n  email: string;\n}\n\nexport interface ApiResponse<T> {\n  data: T;\n  message: string;\n  success: boolean;\n}\n```\n\n## 🔍 故障排除\n\n### 常见问题\n\n1. **规则冲突**: 确保 Prettier 配置与 ESLint 规则兼容\n2. **TypeScript 错误**: 检查 `tsconfig.json` 配置\n3. **Vue 文件解析**: 确保安装了 `vue-eslint-parser`\n\n### 调试技巧\n\n```bash\n# 检查 ESLint 配置\nnpx eslint --print-config src/main.ts\n\n# 检查特定文件的规则\nnpx eslint --print-config src/components/HelloWorld.vue\n\n# 运行 ESLint 检查\nnpx eslint src --ext .js,.ts,.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- [ESLint](https://eslint.org/) - JavaScript/TypeScript 代码检查\n- [Vue ESLint Plugin](https://eslint.vuejs.org/) - Vue 单文件组件支持\n- [TypeScript ESLint](https://typescript-eslint.io/) - TypeScript 类型检查\n- [Prettier](https://prettier.io/) - 代码格式化工具\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","_rev":"1-66ff198489b567c864e459c95b6f5142"}