@schalkneethling/css-property-type-validator-cli
v0.4.0
Published
CLI for CSS custom property type validator.
Downloads
528
Maintainers
Readme
@schalkneethling/css-property-type-validator-cli
CLI for CSS Property Type Validator.
This package validates CSS @property registrations, checks whether registered custom properties are used compatibly through var(), and validates authored assignments to registered custom properties.
Install
npm install --global @schalkneethling/css-property-type-validator-cliOr run it with npx:
npx @schalkneethling/css-property-type-validator-cli "src/**/*.css"Usage
css-property-type-validator "src/**/*.css"
css-property-type-validator "src/**/*.css" --format json
css-property-type-validator "src/**/*.css" --registry "src/tokens/**/*.css"
css-property-type-validator "src/tokens/**/*.css" --registry-only
css-property-type-validator "fixtures/imports/main.css"Use --registry multiple times to include shared @property definitions without validating the rest of those files:
css-property-type-validator "src/**/*.css" \
--registry "src/tokens/**/*.css" \
--registry "src/brand/**/*.css"Registry-only files still report parse errors and invalid @property registrations. The CLI also follows local unconditioned @import rules automatically while assembling the registry, including relative and root-relative imports. Remote and conditioned imports are still out of scope for now.
Use --registry-only when you want to validate @property rules without also validating ordinary declarations from those files:
css-property-type-validator "src/tokens/**/*.css" --registry-onlyIn --registry-only mode, the positional patterns become registration sources instead of normal validation targets. You can still add extra shared registry inputs with --registry when needed.
Exit codes
0no diagnostics found1validation diagnostics found2CLI or input failure
Repository: schalkneethling/css-property-type-validator
