@fullstacksjs/eslint-config 11.3.3 → 11.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,7 +62,7 @@ interface Options {
62
62
  cypress?: boolean; // controls cypress plugin
63
63
  playwright?: boolean // controls playwright plugin
64
64
  storybook?: boolean; // controls storybook plugin
65
- tailwind?: boolean; // controls tailwindcss plugin
65
+ tailwind?: boolean | { callee?: string[] }; // controls tailwindcss plugin
66
66
  next?: boolean; // controls next plugin
67
67
  prettier?: boolean; // controls prettier plugin
68
68
  disableExpensiveRules?: boolean; // controls expensive rules
package/cjs/index.js CHANGED
@@ -62,6 +62,9 @@ const defaultOptions = {
62
62
  */
63
63
  function init(initOptions = {}, ...extend) {
64
64
  const options = (0, _deepmerge.default)(defaultOptions, initOptions);
65
+ if (options.tailwind === true) {
66
+ options.tailwind = {};
67
+ }
65
68
  if (options.typescript === true) {
66
69
  options.typescript = {};
67
70
  }
@@ -4,13 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- /** @return { Promise<import('eslint').Linter.Config> } */
8
- async function tailwind() {
7
+ /**
8
+ * @param { import('../option').Options } options
9
+ * @return { Promise<import('eslint').Linter.Config> }
10
+ */
11
+ async function tailwind(options = {}) {
9
12
  const plugin = await Promise.resolve().then(() => require('eslint-plugin-tailwindcss'));
10
13
  return {
11
14
  plugins: {
12
15
  tailwindcss: plugin.default ?? plugin
13
16
  },
17
+ settings: {
18
+ tailwindcss: {
19
+ callees: options.callees ?? ['cva', 'classnames', 'classNames', 'class', 'clsx', 'cn', 'cns', 'cx']
20
+ }
21
+ },
14
22
  rules: {
15
23
  'tailwindcss/classnames-order': 'warn',
16
24
  'tailwindcss/enforces-negative-arbitrary-values': 'warn',
package/cjs/option.d.ts CHANGED
@@ -4,7 +4,7 @@ export interface Options extends Linter.Config {
4
4
  react?: boolean;
5
5
  sort?: boolean;
6
6
  next?: boolean;
7
- tailwind?: boolean;
7
+ tailwind?: boolean | { callees: string[] };
8
8
  node?: boolean;
9
9
  strict?: boolean;
10
10
  import?: { internalRegExp?: string; lifetime?: number; projects?: string | string[] } | boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "11.3.3",
3
+ "version": "11.4.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
package/src/index.mjs CHANGED
@@ -55,6 +55,10 @@ const defaultOptions = {
55
55
  */
56
56
  export function init(initOptions = {}, ...extend) {
57
57
  const options = merge(defaultOptions, initOptions);
58
+
59
+ if (options.tailwind === true) {
60
+ options.tailwind = {};
61
+ }
58
62
  if (options.typescript === true) {
59
63
  options.typescript = {};
60
64
  }
@@ -1,8 +1,16 @@
1
- /** @return { Promise<import('eslint').Linter.Config> } */
2
- async function tailwind() {
1
+ /**
2
+ * @param { import('../option').Options } options
3
+ * @return { Promise<import('eslint').Linter.Config> }
4
+ */
5
+ async function tailwind(options = {}) {
3
6
  const plugin = await import('eslint-plugin-tailwindcss');
4
7
  return {
5
8
  plugins: { tailwindcss: plugin.default ?? plugin },
9
+ settings: {
10
+ tailwindcss: {
11
+ callees: options.callees ?? ['cva', 'classnames', 'classNames', 'class', 'clsx', 'cn', 'cns', 'cx'],
12
+ },
13
+ },
6
14
  rules: {
7
15
  'tailwindcss/classnames-order': 'warn',
8
16
  'tailwindcss/enforces-negative-arbitrary-values': 'warn',
package/src/option.d.ts CHANGED
@@ -4,7 +4,7 @@ export interface Options extends Linter.Config {
4
4
  react?: boolean;
5
5
  sort?: boolean;
6
6
  next?: boolean;
7
- tailwind?: boolean;
7
+ tailwind?: boolean | { callees: string[] };
8
8
  node?: boolean;
9
9
  strict?: boolean;
10
10
  import?: { internalRegExp?: string; lifetime?: number; projects?: string | string[] } | boolean;