API Reference

Master CSS ESLint

The ESLint configuration and plugin reference for Master CSS.

Usage

{
"extends": ["@master/css"]
}

The extended recommended configuration:

{
"plugins": [
"@master/css"
],
"rules": {
"@master/css/class-order": "warn",
"@master/css/class-validation": "error",
"@master/css/class-collision": "warn"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
}
}

To learn more about features, check out the Code Linting.


Rules

class-order

Enforce a consistent and logical order of classes.

{
"rules": {
"@master/css/class-order": "warn"
}
}

class-validation

Detect syntax errors early when writing classes.

{
"rules": {
"@master/css/class-validation": "error"
}
}

Set disallowUnknownClass: true to disallow unknow classes and enforce strict checks:

{
"rules": {
"@master/css/class-validation": ["error", {
"disallowUnknownClass": true
}]
}
}

class-collision

Avoid applying classes with the same CSS declaration.

{
"rules": {
"@master/css/class-collision": "warn"
}
}

Settings

calleeMatching

Specify the names of the callee to check its arguments.

{
"settings": {
"calleeMatching": "^(classnames|clsx|ctl|cva|cv|classVariant|styled(?:\.\w+)?)"
}
}

classMatching

Specify the attribute/property to check classes.

{
"settings": {
"classMatching": "^class(Name)?$"
}
}

ignoredKeys

Specifies object keys to ignore checking.

{
"settings": {
"ignoredKeys": ["compoundVariants","defaultVariants"]
}
}

config

Specify a custom Master CSS configuration or path.

{
"settings": {
"config": "master.css"
}
}
API Reference
Master CSS Core

The core syntax parsing of Master CSS.

API Reference
Master CSS Extractor

Master CSS static extractor for various raw text extraction.

© Aoyue Design LLC.