Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 2.31 KB

File metadata and controls

70 lines (47 loc) · 2.31 KB

Settings

Table of Contents



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": [/* ... */]
    }
  }
}


classAttributes

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"


callees

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"


variables

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: None

    Note: 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.