Validate Stylelint configuration files for correctness, deprecated rules, and best practices.
Checks .stylelintrc / .stylelintrc.json / .stylelintrc.yaml for:
| Category | Rules | Examples |
|---|---|---|
| ---------- | ------- | --------- |
| Config structure (4) | Unknown keys, invalid types, no rules or extends, invalid defaultSeverity | customConfig: true → unknown key |
| Rules validation (5) | Deprecated rules (70+), unknown rules, null values, disabled rule ratio | indentation: 2 → deprecated in v16 |
| Extends (3) | Duplicate entries, non-array type, prettier ordering | prettier before standard → wrong order |
| Plugins (3) | Duplicate plugins, non-array type, plugin rules without plugins | scss/no-dollar-variables without plugin |
| Overrides (3) | Non-array type, missing files, deprecated rules in overrides | Override without files property |
| Ignore files (1) | Catch-all patterns | ignoreFiles: "*" matches everything |
0 — no errors1 — errors found (or --strict with any issue)2 — file not found or parse errorFull config validation.
python3 scripts/stylelint_validator.py lint .stylelintrc.json
python3 scripts/stylelint_validator.py validate --format json .stylelintrc
Check rules only (deprecated, unknown, conflicts).
python3 scripts/stylelint_validator.py rules .stylelintrc.json
List only deprecated rules in the config.
python3 scripts/stylelint_validator.py deprecated .stylelintrc.json
| Option | Values | Default | Description |
|---|---|---|---|
| -------- | -------- | --------- | ------------- |
--format | text, json, summary | text | Output format |
--min-severity | error, warning, info | info | Filter by minimum severity |
--strict | flag | off | Exit 1 on any issue |
# Quick check
python3 scripts/stylelint_validator.py lint .stylelintrc.json
# CI pipeline
python3 scripts/stylelint_validator.py lint --strict --format summary .stylelintrc
# Find deprecated rules to upgrade
python3 scripts/stylelint_validator.py deprecated .stylelintrc.json
# JSON output for tooling
python3 scripts/stylelint_validator.py validate --format json .stylelintrc.yaml
共 1 个版本