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

Img2img

Generate images from text descriptions using DALL-E 3 while adhering to usage policies and avoiding realistic human faces.

Registry SourceRecently Updated
General

Habitat-GS-Navigator

Navigate and interact with photo-realistic 3DGS environments via the Habitat-GS Bridge. Use when: user asks to explore a 3D scene, perform embodied navigatio...

Registry SourceRecently Updated
General

Memory Palace

持久化记忆管理。Use when: 用户告诉你个人信息/偏好/习惯、需要记住项目状态/技术决策、完成任务后有可复用经验、用户说"记住""别忘了""下次注意"、需要回忆之前的对话内容。支持语义搜索和时间推理。

Registry SourceRecently Updated
General

Podcast Transcript Mining Authority Positioning

Extract guest appearances, speaking topics, and soundbites from podcast transcripts to build authority portfolios and generate podcast pitch templates. Use w...

Registry SourceRecently Updated