From be49c65c0666969aab1702063e3b4b89289c6bbb Mon Sep 17 00:00:00 2001 From: Yuhei Yasuda Date: Tue, 18 Jul 2023 08:30:06 +0900 Subject: [PATCH] add `classNames` to the default value of callees --- README.md | 2 +- docs/rules/classnames-order.md | 2 +- docs/rules/enforces-negative-arbitrary-values.md | 2 +- docs/rules/enforces-shorthand.md | 2 +- docs/rules/migration-from-tailwind-2.md | 2 +- docs/rules/no-arbitrary-value.md | 2 +- docs/rules/no-contradicting-classname.md | 2 +- docs/rules/no-custom-classname.md | 2 +- lib/util/settings.js | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9a9639a..39c8930 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ FYI, here are the `default` values: settings: { tailwindcss: { // These are the default values but feel free to customize - callees: ["classnames", "clsx", "ctl"], + callees: ["classNames", "classnames", "clsx", "ctl"], config: "tailwind.config.js", // returned from `loadConfig()` utility if not provided cssFiles: [ "**/*.css", diff --git a/docs/rules/classnames-order.md b/docs/rules/classnames-order.md index 5fb6f92..135a01b 100644 --- a/docs/rules/classnames-order.md +++ b/docs/rules/classnames-order.md @@ -32,7 +32,7 @@ Examples of **correct** code for this rule: ... ``` -### `callees` (default: `["classnames", "clsx", "ctl", "cva", "tv"]`) +### `callees` (default: `["classNames", "classnames", "clsx", "ctl", "cva", "tv"]`) If you use some utility library like [@netlify/classnames-template-literals](https://github.com/netlify/classnames-template-literals), you can add its name to the list to make sure it gets parsed by this rule. diff --git a/docs/rules/enforces-negative-arbitrary-values.md b/docs/rules/enforces-negative-arbitrary-values.md index 48f4632..3695c3c 100644 --- a/docs/rules/enforces-negative-arbitrary-values.md +++ b/docs/rules/enforces-negative-arbitrary-values.md @@ -50,7 +50,7 @@ Examples of **correct** code for this rule: ... ``` -### `callees` (default: `["classnames", "clsx", "ctl", "cva", "tv"]`) +### `callees` (default: `["classNames", "classnames", "clsx", "ctl", "cva", "tv"]`) If you use some utility library like [@netlify/classnames-template-literals](https://github.com/netlify/classnames-template-literals), you can add its name to the list to make sure it gets parsed by this rule. diff --git a/docs/rules/enforces-shorthand.md b/docs/rules/enforces-shorthand.md index 6b694fb..7a5e830 100644 --- a/docs/rules/enforces-shorthand.md +++ b/docs/rules/enforces-shorthand.md @@ -42,7 +42,7 @@ If indeed, you are using the `classnames-order` rule, then it'll be automaticall ... ``` -### `callees` (default: `["classnames", "clsx", "ctl", "cva", "tv"]`) +### `callees` (default: `["classNames", "classnames", "clsx", "ctl", "cva", "tv"]`) If you use some utility library like [@netlify/classnames-template-literals](https://github.com/netlify/classnames-template-literals), you can add its name to the list to make sure it gets parsed by this rule. diff --git a/docs/rules/migration-from-tailwind-2.md b/docs/rules/migration-from-tailwind-2.md index c84cb64..5e83ff0 100644 --- a/docs/rules/migration-from-tailwind-2.md +++ b/docs/rules/migration-from-tailwind-2.md @@ -87,7 +87,7 @@ This rule will report the issue but **it will not fix it for you**... ... ``` -### `callees` (default: `["classnames", "clsx", "ctl", "cva", "tv"]`) +### `callees` (default: `["classNames", "classnames", "clsx", "ctl", "cva", "tv"]`) If you use some utility library like [@netlify/classnames-template-literals](https://github.com/netlify/classnames-template-literals), you can add its name to the list to make sure it gets parsed by this rule. diff --git a/docs/rules/no-arbitrary-value.md b/docs/rules/no-arbitrary-value.md index 84f1e86..549449c 100644 --- a/docs/rules/no-arbitrary-value.md +++ b/docs/rules/no-arbitrary-value.md @@ -32,7 +32,7 @@ Examples of **correct** code for this rule: ... ``` -### `callees` (default: `["classnames", "clsx", "ctl", "cva", "tv"]`) +### `callees` (default: `["classNames", "classnames", "clsx", "ctl", "cva", "tv"]`) If you use some utility library like [@netlify/classnames-template-literals](https://github.com/netlify/classnames-template-literals), you can add its name to the list to make sure it gets parsed by this rule. diff --git a/docs/rules/no-contradicting-classname.md b/docs/rules/no-contradicting-classname.md index b96ad32..6fe1c6b 100644 --- a/docs/rules/no-contradicting-classname.md +++ b/docs/rules/no-contradicting-classname.md @@ -32,7 +32,7 @@ Examples of **correct** code for this rule: ... ``` -### `callees` (default: `["classnames", "clsx", "ctl", "cva", "tv"]`) +### `callees` (default: `["classNames", "classnames", "clsx", "ctl", "cva", "tv"]`) If you use some utility library like [@netlify/classnames-template-literals](https://github.com/netlify/classnames-template-literals), you can add its name to the list to make sure it gets parsed by this rule. diff --git a/docs/rules/no-custom-classname.md b/docs/rules/no-custom-classname.md index ef63432..a85a23b 100644 --- a/docs/rules/no-custom-classname.md +++ b/docs/rules/no-custom-classname.md @@ -34,7 +34,7 @@ Examples of **correct** code for this rule: ... ``` -### `callees` (default: `["classnames", "clsx", "ctl", "cva", "tv"]`) +### `callees` (default: `["classNames", "classnames", "clsx", "ctl", "cva", "tv"]`) If you use some utility library like [@netlify/classnames-template-literals](https://github.com/netlify/classnames-template-literals), you can add its name to the list to make sure it gets parsed by this rule. diff --git a/lib/util/settings.js b/lib/util/settings.js index 6674463..8b5f6f6 100644 --- a/lib/util/settings.js +++ b/lib/util/settings.js @@ -1,5 +1,5 @@ 'use strict'; -const { resolveDefaultConfigPath } = require('tailwindcss/lib/util/resolveConfigPath') +const { resolveDefaultConfigPath } = require('tailwindcss/lib/util/resolveConfigPath'); function getOption(context, name) { // Options (defined at rule level) @@ -14,7 +14,7 @@ function getOption(context, name) { // Fallback to defaults switch (name) { case 'callees': - return ['classnames', 'clsx', 'ctl', 'cva', 'tv']; + return ['classNames', 'classnames', 'clsx', 'ctl', 'cva', 'tv']; case 'ignoredKeys': return ['compoundVariants', 'defaultVariants']; case 'classRegex':