Skip to content

[Quality] KISS: Missing .gitignore file causes node_modules pollution #31

Description

@newtontech

实际问题

文件: Repository root (missing .gitignore)

问题:
No .gitignore file exists in the repository. This means:

  1. Developers may accidentally commit node_modules/ directory
  2. No protection against committing build artifacts, logs, or OS files
  3. Violates KISS principle: "Simple things should be simple" - developers shouldn't have to think about what not to commit

改进建议

Create .gitignore file:

# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
yarn.lock

# Build outputs
out/
dist/
build/
*.tgz

# Environment variables
.env
.env.local
.env.*.local

# IDE and editor files
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Test coverage
coverage/
.nyc_output/

# Electron specific
*.log

为什么重要

  • Severity: MEDIUM - Risk of repository pollution
  • node_modules can be 500MB+ and should never be committed
  • Build artifacts cause merge conflicts and bloat repository
  • Simple oversight that causes real problems

优先级

  • 高 - 影响系统稳定性/安全性
  • 中 - 影响代码质量
  • 低 - 改进建议

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions