← 返回 Skills 市场
charlie-morrison

Jest Config Validator

作者 charlie-morrison · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
110
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install jest-config-validator
功能描述
Validate jest.config.ts/js/json and Jest configuration in package.json for deprecated options, transform conflicts, and best practices. Use when validating J...
使用说明 (SKILL.md)

Jest Config Validator

Validate jest.config.ts, jest.config.js, jest.config.json, and package.json#jest for deprecated options, transform conflicts, coverage misconfigurations, and best practices. Supports text, JSON, and summary output formats with CI-friendly exit codes.

Commands

# Full validation (all 22+ rules)
python3 scripts/jest_config_validator.py validate jest.config.js

# Quick syntax-only check (structure rules only)
python3 scripts/jest_config_validator.py check jest.config.ts

# Explain config in human-readable form
python3 scripts/jest_config_validator.py explain jest.config.json

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

# JSON output (CI-friendly)
python3 scripts/jest_config_validator.py validate jest.config.js --format json

# Summary only (pass/fail + counts)
python3 scripts/jest_config_validator.py validate jest.config.js --format summary

# Strict mode (warnings become errors)
python3 scripts/jest_config_validator.py validate jest.config.js --strict

Rules (22+)

# Category Severity Rule
S1 Structure Error File not found or unreadable
S2 Structure Error Empty config or missing module.exports/export default
S3 Structure Warning Both jest.config and package.json#jest present (conflict)
S4 Structure Warning Unknown top-level config keys detected
S5 Structure Error Invalid JSON syntax (for .json configs)
T1 Test Environment Error Invalid testEnvironment value
T2 Test Environment Warning testEnvironment: jsdom without jest-environment-jsdom (Jest 28+)
T3 Test Environment Warning testURL deprecated in Jest 28+ (use testEnvironmentOptions)
T4 Test Environment Warning Empty testMatch or testPathPattern
X1 Transforms Warning Overlapping transform patterns (conflict)
X2 Transforms Warning ts-jest and babel-jest used together without clear separation
X3 Transforms Warning transformIgnorePatterns too broad (may skip needed transforms)
X4 Transforms Warning Missing transform for .tsx/.jsx when React detected
V1 Coverage Warning collectCoverageFrom empty or too broad
V2 Coverage Warning coverageThreshold set but collectCoverage not enabled
V3 Coverage Warning Deprecated coverageReporters values
D1 Deprecated Warning Deprecated Jest options detected
D2 Deprecated Warning jest.fn() used inside config file (configs should not mock)
D3 Deprecated Warning timers: 'fake' (old syntax, use fakeTimers object)
B1 Best Practices Info No clearMocks/resetMocks/restoreMocks set
B2 Best Practices Warning roots pointing outside project directory
B3 Best Practices Warning setupFiles/setupFilesAfterFramework path pattern issues
B4 Best Practices Info moduleNameMapper with complex regex missing comment
B5 Best Practices Warning preset and manual config overlap
B6 Best Practices Warning maxWorkers set to 1 in non-CI context

Output Formats

text (default): Human-readable with file path, rule code, severity, and message per finding.

json: Machine-readable JSON with file, summary, and findings array. Each finding has rule, severity, message, and line fields.

summary: One-line pass/fail with error/warning/info counts. Ideal for CI output gates.

Exit Codes

Code Meaning
0 No errors found (warnings/info may exist)
1 One or more errors found
2 File not found or parse error
安全使用建议
This skill appears to be what it says—a local Jest config validator. Before installing or running: (1) review the included scripts if you will run them in sensitive repositories (the tool reads files you point it at and uses regex-based parsing, which can misreport complex JS/TS configs); (2) run it on a non-production checkout or in a sandbox if you are concerned about false positives or unexpected behavior; and (3) note it does not require network access or credentials, so risks are low. If you need stronger parsing (accurate AST-level JS/TS analysis), consider tools that use a JS parser rather than approximate regex-based checks.
功能分析
Type: OpenClaw Skill Name: jest-config-validator Version: 1.0.0 The skill bundle provides a legitimate utility for validating Jest configuration files (JS, TS, JSON, and package.json). The core logic in scripts/jest_config_validator.py uses regex-based parsing and standard JSON processing to check for deprecated options, transform conflicts, and best practices without executing the configuration files or making network calls. No indicators of data exfiltration, malicious execution, or prompt injection were found.
能力评估
Purpose & Capability
Name/description match the included script and SKILL.md: the tool analyzes jest.config.* and package.json#jest for deprecated options, transforms, coverage, and best practices. No unrelated binaries, env vars, or platform-level access are requested.
Instruction Scope
Runtime instructions and the script focus on reading and analyzing local Jest config files (jest.config.js/ts/json and package.json). The actions (file reads, regex parsing, producing text/json/summary output) are within the stated purpose. Note: the script performs approximate JS/TS parsing with regexes, so it may produce false positives/negatives for complex configs.
Install Mechanism
No install spec; the skill is instruction-only with an included Python script. Nothing is downloaded from external URLs or written to system-wide locations by an installer.
Credentials
No environment variables, credentials, or config paths are required. The script only reads files the user points it to or that it discovers in the project directory.
Persistence & Privilege
The skill is not always-enabled and does not request system-wide persistence or modify other skills. Autonomous invocation is possible (platform default) but does not appear to expand privileges or access secrets.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install jest-config-validator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /jest-config-validator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: 25 rules for jest.config validation
元数据
Slug jest-config-validator
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Jest Config Validator 是什么?

Validate jest.config.ts/js/json and Jest configuration in package.json for deprecated options, transform conflicts, and best practices. Use when validating J... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 110 次。

如何安装 Jest Config Validator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install jest-config-validator」即可一键安装,无需额外配置。

Jest Config Validator 是免费的吗?

是的,Jest Config Validator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Jest Config Validator 支持哪些平台?

Jest Config Validator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Jest Config Validator?

由 charlie-morrison(@charlie-morrison)开发并维护,当前版本 v1.0.0。

💬 留言讨论