360 Secure SkillHub
360 安全技能中心

Nodemon Config Validator

核心功能:校验nodemon.json、.nodemonrc、package.json等配置文件,覆盖结构、监听、忽略、执行命令等22+规则,可检查性能问题、冲突及最佳实践。典型场景:Node.js开发配置校验、监听设置审计、配置lint。输入输出:通过命令行调用,支持文本、JSON、摘要输出,提供解释和改进建议,带有CI友好退出码,无需外部依赖,需Python3.8+运行。

charlie-morrison
charlie-morrison
热度 53.05
最近更新 2026-05-11 17:45:02
分类:开发依赖:代码执行 / 读写文件应用场景:代码审查 / 调试排错 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nodemon-config-validator
Metadata
name
nodemon-config-validator
description
Validate nodemon config files (nodemon.json, .nodemonrc, package.json#nodemonConfig) for watch settings, ignore patterns, exec conflicts, and best practices. Use when validating Node.js development configs, auditing watch setups, or linting nodemon configuration.

Nodemon Config Validator

Validate nodemon.json, .nodemonrc, .nodemonrc.json, and package.json#nodemonConfig for watch performance issues, ignore patterns, exec conflicts, delay settings, and best practices. Supports text, JSON, and summary output formats with CI-friendly exit codes.

Commands

# Full validation (all 22+ rules)
python3 scripts/nodemon_config_validator.py validate nodemon.json

# Quick syntax-only check (structure rules only)
python3 scripts/nodemon_config_validator.py check .nodemonrc

# Explain config in human-readable form
python3 scripts/nodemon_config_validator.py explain nodemon.json

# Suggest improvements
python3 scripts/nodemon_config_validator.py suggest package.json

# JSON output (CI-friendly)
python3 scripts/nodemon_config_validator.py validate nodemon.json --format json

# Summary only (pass/fail + counts)
python3 scripts/nodemon_config_validator.py validate nodemon.json --format summary

# Strict mode (warnings become errors)
python3 scripts/nodemon_config_validator.py validate nodemon.json --strict

Rules (22+)

# Category Severity Rule
S1 Structure Error File not found or unreadable
S2 Structure Error Empty config
S3 Structure Error Invalid JSON syntax
S4 Structure Warning Unknown top-level keys
S5 Structure Warning Both nodemon.json and .nodemonrc present (conflict)
W1 Watch Warning Empty watch array
W2 Watch Info Watch path uses absolute path (portability)
W3 Watch Error Watching node_modules (severe performance issue)
W4 Watch Info No watch or ext specified (relying on defaults)
E1 Extensions Warning Empty ext string
E2 Extensions Warning Watching too many extensions (>10, performance)
E3 Extensions Info Missing common extensions for detected project type
I1 Ignore Warning Empty ignore array
I2 Ignore Info node_modules not explicitly ignored
I3 Ignore Warning Overly broad ignore patterns (e.g. "*")
X1 Exec Warning exec command with shell injection risk
X2 Exec Warning Both exec and script specified (conflict)
X3 Exec Info execMap with unusual/unknown extension
D1 Delay Warning Delay too low (<100ms, rapid restarts)
D2 Delay Warning Delay too high (>10000ms, slow feedback)
B1 Best Practices Info verbose not set (useful for debugging)
B2 Best Practices Warning No ignore patterns at all

Output Formats

  • text (default): Human-readable with severity icons
  • json: Machine-parseable JSON array of findings
  • summary: Pass/fail with error/warning/info counts

Exit Codes

  • 0: No errors (warnings/infos only or clean)
  • 1: One or more errors found
  • 2: File not found or invalid input

Requirements

  • Python 3.8+
  • No external dependencies (pure stdlib)