← 返回
未分类 中文

Postcss Config Validator

Validate PostCSS config files (.postcssrc, postcss.config.js, package.json#postcss) for plugin ordering, deprecated plugins, Tailwind integration, and best p...
验证 PostCSS 配置文件(.postcssrc、postcss.config.js、package.json#postcss)的插件顺序、已弃用插件、Tailwind 集成及最佳实践。
charlie-morrison charlie-morrison 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 405
下载
💾 1
安装
1
版本
#latest

概述

PostCSS Config Validator

Validate .postcssrc, .postcssrc.json, postcss.config.js, postcss.config.ts, and package.json#postcss for deprecated plugins, ordering issues, Tailwind integration problems, parser misconfiguration, and best practices. JS/TS configs are detected but cannot be statically validated. Supports text, JSON, and summary output formats with CI-friendly exit codes.

Commands

# Full validation (all 22+ rules)
python3 scripts/postcss_config_validator.py validate .postcssrc

# Quick structure-only check
python3 scripts/postcss_config_validator.py check .postcssrc.json

# Explain config in human-readable form
python3 scripts/postcss_config_validator.py explain package.json

# Suggest improvements
python3 scripts/postcss_config_validator.py suggest .postcssrc

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

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

# Strict mode (warnings and infos become errors)
python3 scripts/postcss_config_validator.py validate .postcssrc --strict

Rules (22+)

#IDCategorySeverityRule
----------------------------------
1S1StructureErrorFile not found or unreadable
2S2StructureErrorEmpty config file
3S3StructureErrorInvalid JSON syntax
4S4StructureWarningUnknown top-level keys (valid: plugins, parser, syntax, stringifier, map, from, to)
5S5StructureInfoJS/TS config detected — cannot statically validate
6P1PluginsWarningEmpty plugins object/array
7P2PluginsWarningDeprecated plugin (autoprefixer-core, postcss-cssnext, lost, postcss-sprites)
8P3PluginsWarningDuplicate plugins
9P4PluginsInfoPlugin ordering issues (autoprefixer after preset-env, cssnano last)
10P5PluginsInfopostcss-import should be first plugin
11P6PluginsInfoUnknown/uncommon plugin name (not in top 50 list)
12T1TailwindInfotailwindcss without nesting plugin
13T2TailwindWarningtailwindcss after autoprefixer (wrong order)
14T3TailwindInfopostcss-preset-env with tailwindcss (potential conflict)
15X1Syntax/ParserWarningBoth parser and syntax specified
16X2Syntax/ParserInfoUnknown parser value
17X3Syntax/ParserInfoParser set but no matching preprocessor plugin
18M1Source MapsInfoSource maps disabled (map: false)
19M2Source MapsInfoInline source maps enabled (map.inline: true)
20B1Best PracticesWarningNo plugins configured
21B2Best PracticesInfoUsing postcss-preset-env AND individual feature plugins it includes
22B3Best PracticesInfoVery large number of plugins (>15)

Output Formats

  • text (default): Human-readable with severity icons
  • json: Machine-parseable JSON with findings array and summary
  • 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)

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 05:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 686 📥 331,173
it-ops-security

Vulnerability Prioritizer

charlie-morrison
在CVSS评分之外,利用EPSS、CISA KEV、资产关键性、可达性分析以及利用成熟度进行漏洞优先级排序
★ 1 📥 538
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,124