apache / apache/cloudstack

8 top pre-commit hooks specifically targeting `Vue` and `C#`. Gemini can make mistakes, so double-check it

未关闭
#11,322 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
long-term-plan
主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 19 小时
30 天内合并 PR
32

描述

For a large-scale, multi-language project like Apache CloudStack, which includes Vue.js for its frontend for certain components, a robust set of pre-commit hooks is essential. These hooks help enforce code quality, consistency, and identify potential issues early in the development cycle, reducing the burden on CI/CD pipelines and code reviews.

Here are 8 top pre-commit hooks, categorized for clarity, that would be highly beneficial:

### Vue.js / Frontend Specific Hooks

- [ ] 1. **ESLint**: Enforces JavaScript/TypeScript code quality and stylistic guidelines for Vue components. Catches common errors and ensures consistency.
- [ ] 2. **Prettier**: An opinionated code formatter that supports JavaScript, TypeScript, HTML, CSS, and Vue files, ensuring consistent code style across the frontend.
- [ ] 3. **`eslint-plugin-vuejs-accessibility`**: Integrates accessibility linting specifically for Vue templates, helping prevent common A11y issues.
- [ ] 4. **Stylelint**: A linter for CSS, SCSS, Less, and other stylesheets, vital for maintaining consistent styling within Vue's scoped or global styles.
- [ ] 5. **`stylelint-a11y`**: A Stylelint plugin focused on enforcing accessibility standards in CSS, complementing the Vue accessibility linting.
- [ ] 6. **Biome**: A fast all-in-one toolchain for web projects (formatter, linter), which can handle JavaScript, TypeScript, JSON, and CSS. A powerful alternative or supplement to ESLint/Prettier for parts of the frontend.
- [ ] 7. **`check-html`**: Basic HTML validation to catch syntax errors in Vue templates (if not fully handled by ESLint or Biome).
- [ ] 8. **`prettier-json`**: Ensures consistent formatting for any JSON configuration files used by the Vue application (e.g., `package.json`).

Implementing these hooks, especially with a tool like `pre-commit.com`, will significantly enhance code quality, reduce review cycles, and maintain a high standard of consistency across the Apache CloudStack project. Remember to start with a smaller set of critical hooks and gradually add more as the team adapts.

贡献指南

打开贡献指南

调研方向

该 issue 为 Vue.js 前端工作提出了八个候选 pre-commit hook,包括 ESLint、可访问性检查、Stylelint、Biome、HTML 验证和 JSON 格式化,但没有指定配置文件或测试。首先检查现有的 pre-commit 设置,然后确定支持哪些 hook,以及如何在整个项目中验证完成情况。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, eslint, javascript
领域
devtools, frontend, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。