swc-config-validator

Validate SWC config files (.swcrc, package.json#swc) for parser settings, transform conflicts, module type issues, and best practices. Use when validating SWC transpiler configs, auditing Next.js/Turbopack build setups, or linting swc config files.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "swc-config-validator" with this command: npx skills add charlie-morrison/swc-config-validator

SWC Config Validator

Validate .swcrc and package.json#swc for parser errors, invalid targets, transform conflicts, module type issues, minification problems, and best practices. Supports text, JSON, and summary output formats with CI-friendly exit codes.

Commands

# Full validation (all 22+ rules)
python3 scripts/swc_config_validator.py validate .swcrc

# Quick syntax/structure check only
python3 scripts/swc_config_validator.py check .swcrc

# Explain config in human-readable form
python3 scripts/swc_config_validator.py explain .swcrc

# Suggest improvements
python3 scripts/swc_config_validator.py suggest .swcrc

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

# Summary only (pass/fail + counts)
python3 scripts/swc_config_validator.py validate .swcrc --format summary

# Strict mode (warnings become errors)
python3 scripts/swc_config_validator.py validate .swcrc --strict

# Validate from package.json#swc
python3 scripts/swc_config_validator.py validate package.json

Rules (22+)

#CategorySeverityRule
S1StructureErrorFile not found or unreadable
S2StructureErrorEmpty config
S3StructureErrorInvalid JSON syntax
S4StructureWarningUnknown top-level keys
S5StructureWarningMissing jsc key (most configs need it)
J1JSC ConfigErrorInvalid parser syntax (must be ecmascript or typescript)
J2JSC ConfigWarningJSX enabled in parser without React transform
J3JSC ConfigWarningDeprecated loose mode in jsc.transform
J4JSC ConfigWarningMissing target (no compilation target specified)
J5JSC ConfigErrorInvalid target value (not es3/es5/es2015-es2024/esnext)
M1ModulesErrorUnknown module type
M2ModulesWarningisModule: false with ESM module type
M3ModulesWarningCommonJS module with ESM-only parser features
T1TransformErrorReact transform without parser.jsx enabled
T2TransformWarningLegacy decorators without decoratorsBeforeExport
T3TransformWarningConflicting useDefineForClassFields with TypeScript
T4TransformWarningDeprecated constModules in jsc.experimental
N1MinificationWarningMinification enabled with compress: false
N2MinificationWarningMangle enabled without compress
N3MinificationWarningDrop console in development config
B1Best PracticesWarningsourceMaps not configured
B2Best PracticesInfoNo env config for different environments

Output Formats

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

Exit Codes

  • 0: No errors (warnings/info 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)

Supported Targets

es3, es5, es2015 through es2024, esnext

Supported Module Types

es6, commonjs, umd, amd, nodenext, systemjs

Valid Top-Level Keys

$schema, jsc, module, minify, env, isModule, sourceMaps, inlineSourcesContent, emitSourceMapColumns, inputSourceMap, test, exclude, filename

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

公文格式转换

公文格式排版工具。将 doc/docx/wps/txt/md 文档按照公文排版习惯自动格式化,输出标准 docx。支持智能识别标题层级(一、/(一)/1./(1))、题目/副标题、附件格式化、图表标题识别、页面边距、页码、行距、字体字号、TXT/MD 空行模式、自定义配置和目录批量处理。当用户需要排版公文、格式化...

Registry SourceRecently Updated
General

Postzee Skill

Generate AI images/videos and post to 30+ social media platforms with Postzee. Use when the user wants to create AI media, generate images or videos, optimiz...

Registry SourceRecently Updated
General

Chart Splat (x402)

Generate beautiful charts by paying per request with x402 micropayments (USDC on Base) instead of an API key. Use when the user wants a chart and has no CHAR...

Registry SourceRecently Updated
General

Mimotts25 Plus

🚀 小米 MiMo TTS 2.5 Plus — 基于 mimotts25 深度优化增强。升级到 v2.5-tts 模型,新增声音设计(文字定制音色)、声音克隆(音频复刻)、导演模式等高级功能。支持 v2.5 新音色:冰糖、茉莉、苏打、白桦等。

Registry SourceRecently Updated