验证 nodemon 配置文件(nodemon.json、.nodemonrc、package.json#nodemonConfig)的监视设置、忽略模式、exec 冲突以及最佳实践。
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.
bash
# 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
#CategorySeverityRuleS1StructureErrorFile not found or unreadableS2StructureErrorEmpty configS3StructureErrorInvalid JSON syntaxS4StructureWarningUnknown top-level keysS5StructureWarningBoth nodemon.json and .nodemonrc present (conflict)W1WatchWarningEmpty watch arrayW2WatchInfoWatch path uses absolute path (portability)W3WatchErrorWatching node_modules (severe performance issue)W4WatchInfoNo watch or ext specified (relying on defaults)E1ExtensionsWarningEmpty ext stringE2ExtensionsWarningWatching too many extensions (>10, performance)E3ExtensionsInfoMissing common extensions for detected project typeI1IgnoreWarningEmpty ignore arrayI2IgnoreInfonode_modules not explicitly ignoredI3IgnoreWarningOverly broad ignore patterns (e.g. "*")X1ExecWarningexec command with shell injection riskX2ExecWarningBoth exec and script specified (conflict)X3ExecInfoexecMap with unusual/unknown extensionD1DelayWarningDelay too low (<100ms, rapid restarts)D2DelayWarningDelay too high (>10000ms, slow feedback)B1Best PracticesInfoverbose not set (useful for debugging)B2Best PracticesWarningNo ignore patterns at all
text (default): Human-readable with severity iconsjson: Machine-parseable JSON array of findingssummary: Pass/fail with error/warning/info counts0: No errors (warnings/infos only or clean)1: One or more errors found2: File not found or invalid input