The settings object can be used to globally configure shared options across all rules. Global options will always be overridden by rule-specific options.
To set the settings object, add a settings
key to the eslint config.
{
"plugins": { /* ... */ },
"rules": { /* ... */ },
"settings": {
"readable-tailwind": {
"classAttributes": [/* ... */],
"callees": [/* ... */],
"variables": [/* ... */],
"tags": [/* ... */]
}
}
}
The name of the attribute that contains the tailwind classes.
Type: Array of Name, Regex or Matchers
Default: Name for "class"
and strings Matcher for "class", "className"
List of function names which arguments should also get linted.
Type: Array of Name, Regex or Matchers
Default: Matchers for "cc", "clb", "clsx", "cn", "cnb", "ctl", "cva", "cx", "dcnb", "objstr", "tv", "twJoin", "twMerge"
List of variable names whose initializer should also get linted.
Type: Array of Name, Regex or Matchers
Default: strings Matcher for "className", "classNames", "classes", "style", "styles"
-
tags
List of template literal tag names whose content should get linted.
Type: Array of Name, Regex or Matchers
Default: NoneNote: When using the
tags
option, it is recommended to use the strings Matcher for your tag names. This will ensure that nested expressions get linted correctly.