js-style-kit 0.2.4 → 0.2.6

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.
Files changed (70) hide show
  1. package/README.md +16 -0
  2. package/dist/{chunk-FJNJWCYG.js → chunk-5HWRM6F6.js} +3 -3
  3. package/dist/{chunk-DR4DHSO2.js → chunk-5XUVB2ZB.js} +4 -2
  4. package/dist/{chunk-DR4DHSO2.js.map → chunk-5XUVB2ZB.js.map} +1 -1
  5. package/dist/{chunk-PB5PHG6U.js → chunk-7WAIXW4V.js} +4 -2
  6. package/dist/chunk-7WAIXW4V.js.map +1 -0
  7. package/dist/{chunk-LYJZ2BXK.js → chunk-HWZVK7LV.js} +2 -2
  8. package/dist/{chunk-NPTVKFZO.js → chunk-LUPJ4SWW.js} +3 -3
  9. package/dist/{chunk-NPTVKFZO.js.map → chunk-LUPJ4SWW.js.map} +1 -1
  10. package/dist/{chunk-HUTRDRS3.js → chunk-MB4477NP.js} +5 -1
  11. package/dist/chunk-MB4477NP.js.map +1 -0
  12. package/dist/{chunk-V3QNQKET.js → chunk-NAQPNARH.js} +2 -2
  13. package/dist/{chunk-BDTLNELO.js → chunk-PHDHPPH2.js} +4 -1
  14. package/dist/chunk-PHDHPPH2.js.map +1 -0
  15. package/dist/{chunk-2EXCSH5L.js → chunk-PIU5PRNJ.js} +2 -2
  16. package/dist/{chunk-IKA5P3EP.js → chunk-QZHQTJ56.js} +20 -12
  17. package/dist/chunk-QZHQTJ56.js.map +1 -0
  18. package/dist/{chunk-ZOCL6XIB.js → chunk-XICOWKSV.js} +1 -7
  19. package/dist/chunk-XICOWKSV.js.map +1 -0
  20. package/dist/{chunk-HN2CEVC4.js → chunk-YG7GTCRE.js} +2 -2
  21. package/dist/{chunk-XHFTPVHK.js → chunk-YGS6KBZK.js} +3 -2
  22. package/dist/chunk-YGS6KBZK.js.map +1 -0
  23. package/dist/chunk-YR7FD722.js +45 -0
  24. package/dist/chunk-YR7FD722.js.map +1 -0
  25. package/dist/{scripts/postinstall.js → chunk-ZED5DLW7.js} +31 -25
  26. package/dist/chunk-ZED5DLW7.js.map +1 -0
  27. package/dist/{chunk-I4GUWATW.js → chunk-ZKVGTPGV.js} +2 -2
  28. package/dist/{chunk-TA2KEF22.js → chunk-ZTAPCYRD.js} +2 -2
  29. package/dist/eslint/base/config.js +3 -3
  30. package/dist/eslint/base/rules.js +1 -1
  31. package/dist/eslint/constants.d.ts +3 -0
  32. package/dist/eslint/constants.js +1 -1
  33. package/dist/eslint/ignores.d.ts +3 -1
  34. package/dist/eslint/ignores.js +2 -2
  35. package/dist/eslint/index.d.ts +3 -1
  36. package/dist/eslint/index.js +15 -14
  37. package/dist/eslint/jsdoc/config.js +2 -2
  38. package/dist/eslint/perfectionist/config.js +2 -2
  39. package/dist/eslint/prefer-arrow-function/config.js +2 -2
  40. package/dist/eslint/react/config.js +2 -2
  41. package/dist/eslint/react-compiler/config.js +2 -2
  42. package/dist/eslint/storybook/config.d.ts +13 -0
  43. package/dist/eslint/storybook/config.js +8 -0
  44. package/dist/eslint/storybook/config.js.map +1 -0
  45. package/dist/eslint/testing/config.js +2 -2
  46. package/dist/eslint/turbo/config.js +2 -2
  47. package/dist/eslint/typescript/config.js +2 -2
  48. package/dist/eslint/unicorn/config.js +2 -2
  49. package/dist/index.js +17 -15
  50. package/dist/prettier/index.js +2 -1
  51. package/dist/prettier/patch-tailwind-plugin.d.ts +9 -0
  52. package/dist/prettier/patch-tailwind-plugin.js +7 -0
  53. package/dist/prettier/patch-tailwind-plugin.js.map +1 -0
  54. package/package.json +5 -4
  55. package/dist/chunk-BDTLNELO.js.map +0 -1
  56. package/dist/chunk-HUTRDRS3.js.map +0 -1
  57. package/dist/chunk-IKA5P3EP.js.map +0 -1
  58. package/dist/chunk-PB5PHG6U.js.map +0 -1
  59. package/dist/chunk-XHFTPVHK.js.map +0 -1
  60. package/dist/chunk-ZOCL6XIB.js.map +0 -1
  61. package/dist/scripts/postinstall.cjs +0 -91
  62. package/dist/scripts/postinstall.cjs.map +0 -1
  63. package/dist/scripts/postinstall.js.map +0 -1
  64. /package/dist/{chunk-FJNJWCYG.js.map → chunk-5HWRM6F6.js.map} +0 -0
  65. /package/dist/{chunk-LYJZ2BXK.js.map → chunk-HWZVK7LV.js.map} +0 -0
  66. /package/dist/{chunk-V3QNQKET.js.map → chunk-NAQPNARH.js.map} +0 -0
  67. /package/dist/{chunk-2EXCSH5L.js.map → chunk-PIU5PRNJ.js.map} +0 -0
  68. /package/dist/{chunk-HN2CEVC4.js.map → chunk-YG7GTCRE.js.map} +0 -0
  69. /package/dist/{chunk-I4GUWATW.js.map → chunk-ZKVGTPGV.js.map} +0 -0
  70. /package/dist/{chunk-TA2KEF22.js.map → chunk-ZTAPCYRD.js.map} +0 -0
package/README.md CHANGED
@@ -82,6 +82,7 @@ export default eslintConfig({
82
82
  jsdoc: { requireJsdoc: false }, // JSDoc configuration or false to disable
83
83
  react: false, // Whether to include React rules, see below for options
84
84
  sorting: true, // Whether to include sorting rules from Perfectionist
85
+ storybook: false, // Whether to include Storybook rules
85
86
  typescript: true, // Boolean or string path to tsconfig.json
86
87
  });
87
88
  ```
@@ -176,6 +177,21 @@ Sorting/organization rules from the Perfectionist plugin are enabled by default:
176
177
  sorting: false;
177
178
  ```
178
179
 
180
+ #### Storybook Configuration
181
+
182
+ Storybook support is disabled by default, but can be enabled to provide linting rules specifically for Storybook files:
183
+
184
+ ```js
185
+ // Enable Storybook rules
186
+ storybook: true;
187
+ ```
188
+
189
+ When enabled, this configuration:
190
+
191
+ - Applies best practices for Storybook files (_.stories._ and _.story._)
192
+ - Includes rules for Storybook configuration files (.storybook/main.\*)
193
+ - Ensures the .storybook directory is not ignored by ESLint (adds a negation pattern to ignores)
194
+
179
195
  ### Adding Custom ESLint Configurations
180
196
 
181
197
  You can extend the base configuration by providing additional ESLint config objects as rest parameters:
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  baseEslintRules
3
- } from "./chunk-ZOCL6XIB.js";
3
+ } from "./chunk-XICOWKSV.js";
4
4
  import {
5
5
  configNames
6
- } from "./chunk-BDTLNELO.js";
6
+ } from "./chunk-PHDHPPH2.js";
7
7
 
8
8
  // src/eslint/base/config.ts
9
9
  var baseEslintConfig = (functionStyle) => ({
@@ -18,4 +18,4 @@ var baseEslintConfig = (functionStyle) => ({
18
18
  export {
19
19
  baseEslintConfig
20
20
  };
21
- //# sourceMappingURL=chunk-FJNJWCYG.js.map
21
+ //# sourceMappingURL=chunk-5HWRM6F6.js.map
@@ -3,11 +3,13 @@ import {
3
3
  } from "./chunk-XCPOAYGQ.js";
4
4
  import {
5
5
  configNames
6
- } from "./chunk-BDTLNELO.js";
6
+ } from "./chunk-PHDHPPH2.js";
7
7
 
8
8
  // src/eslint/jsdoc/config.ts
9
9
  import jsdoc from "eslint-plugin-jsdoc";
10
10
  var jsdocConfig = (requireJsdoc = false, typescript = true) => ({
11
+ files: ["**/*.{js,jsx,ts,tsx,cjs,mjs}"],
12
+ ignores: ["**/*.{test,spec}.{js,jsx,ts,tsx,cjs,mjs}"],
11
13
  name: configNames.jsdoc,
12
14
  plugins: {
13
15
  jsdoc
@@ -18,4 +20,4 @@ var jsdocConfig = (requireJsdoc = false, typescript = true) => ({
18
20
  export {
19
21
  jsdocConfig
20
22
  };
21
- //# sourceMappingURL=chunk-DR4DHSO2.js.map
23
+ //# sourceMappingURL=chunk-5XUVB2ZB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/eslint/jsdoc/config.ts"],"sourcesContent":["import jsdoc from \"eslint-plugin-jsdoc\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { jsdocRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for JSDoc comments.\n *\n * @param requireJsdoc - Whether to enforce JSDoc comments on functions and classes. Defaults to false.\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly. Defaults to true.\n * @returns An ESLint configuration object for JSDoc comments.\n */\nexport const jsdocConfig = (\n requireJsdoc = false,\n typescript = true,\n): EslintConfigObject => ({\n name: configNames.jsdoc,\n plugins: {\n jsdoc,\n },\n rules: jsdocRules(requireJsdoc, typescript),\n});\n"],"mappings":";;;;;;;;AAAA,OAAO,WAAW;AAcX,IAAM,cAAc,CACzB,eAAe,OACf,aAAa,UACW;AAAA,EACxB,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,OAAO,WAAW,cAAc,UAAU;AAC5C;","names":[]}
1
+ {"version":3,"sources":["../src/eslint/jsdoc/config.ts"],"sourcesContent":["import jsdoc from \"eslint-plugin-jsdoc\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { jsdocRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for JSDoc comments.\n *\n * @param requireJsdoc - Whether to enforce JSDoc comments on functions and classes. Defaults to false.\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly. Defaults to true.\n * @returns An ESLint configuration object for JSDoc comments.\n */\nexport const jsdocConfig = (\n requireJsdoc = false,\n typescript = true,\n): EslintConfigObject => ({\n files: [\"**/*.{js,jsx,ts,tsx,cjs,mjs}\"],\n ignores: [\"**/*.{test,spec}.{js,jsx,ts,tsx,cjs,mjs}\"],\n name: configNames.jsdoc,\n plugins: {\n jsdoc,\n },\n rules: jsdocRules(requireJsdoc, typescript),\n});\n"],"mappings":";;;;;;;;AAAA,OAAO,WAAW;AAcX,IAAM,cAAc,CACzB,eAAe,OACf,aAAa,UACW;AAAA,EACxB,OAAO,CAAC,8BAA8B;AAAA,EACtC,SAAS,CAAC,0CAA0C;AAAA,EACpD,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,OAAO,WAAW,cAAc,UAAU;AAC5C;","names":[]}
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  configNames
3
- } from "./chunk-BDTLNELO.js";
3
+ } from "./chunk-PHDHPPH2.js";
4
4
 
5
5
  // src/eslint/ignores.ts
6
6
  var ignoresConfig = ({
7
7
  next = false,
8
+ storybook = false,
8
9
  userIgnores = []
9
10
  } = {}) => ({
10
11
  ignores: [
@@ -12,6 +13,7 @@ var ignoresConfig = ({
12
13
  "**/dist/",
13
14
  ".git/",
14
15
  ...next ? [".next"] : [],
16
+ ...storybook ? ["!.storybook"] : [],
15
17
  ...userIgnores
16
18
  ],
17
19
  name: configNames.ignores
@@ -20,4 +22,4 @@ var ignoresConfig = ({
20
22
  export {
21
23
  ignoresConfig
22
24
  };
23
- //# sourceMappingURL=chunk-PB5PHG6U.js.map
25
+ //# sourceMappingURL=chunk-7WAIXW4V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/ignores.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport { configNames } from \"./constants.js\";\n\n/**\n * Creates an ESLint configuration for file and directory ignores.\n * By default, ignores node_modules, dist directories, and .git directories.\n *\n * @param options - Object with options to control the ignores configuration\n * @param options.userIgnores - Additional glob patterns to ignore in ESLint checks\n * @param options.next - Whether to include .next directory in ignores\n * @param options.storybook - Whether to include .storybook directory in ignores\n * @returns ESLint configuration object with ignore patterns\n */\nexport const ignoresConfig = ({\n next = false,\n storybook = false,\n userIgnores = [],\n}: {\n next?: boolean;\n storybook?: boolean;\n userIgnores?: string[];\n} = {}): Linter.Config => ({\n ignores: [\n \"**/node_modules/\",\n \"**/dist/\",\n \".git/\",\n ...(next ? [\".next\"] : []),\n ...(storybook ? [\"!.storybook\"] : []),\n ...userIgnores,\n ],\n name: configNames.ignores,\n});\n"],"mappings":";;;;;AAcO,IAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,cAAc,CAAC;AACjB,IAII,CAAC,OAAsB;AAAA,EACzB,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,OAAO,CAAC,OAAO,IAAI,CAAC;AAAA,IACxB,GAAI,YAAY,CAAC,aAAa,IAAI,CAAC;AAAA,IACnC,GAAG;AAAA,EACL;AAAA,EACA,MAAM,YAAY;AACpB;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-26SVGV32.js";
4
4
  import {
5
5
  configNames
6
- } from "./chunk-BDTLNELO.js";
6
+ } from "./chunk-PHDHPPH2.js";
7
7
 
8
8
  // src/eslint/react/config.ts
9
9
  import react from "eslint-plugin-react";
@@ -38,4 +38,4 @@ var reactEslintConfig = (functionStyle, typescript) => {
38
38
  export {
39
39
  reactEslintConfig
40
40
  };
41
- //# sourceMappingURL=chunk-LYJZ2BXK.js.map
41
+ //# sourceMappingURL=chunk-HWZVK7LV.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  configNames
3
- } from "./chunk-BDTLNELO.js";
3
+ } from "./chunk-PHDHPPH2.js";
4
4
 
5
5
  // src/eslint/react-compiler/config.ts
6
6
  import reactCompiler from "eslint-plugin-react-compiler";
@@ -10,11 +10,11 @@ var reactCompilerEslintConfig = {
10
10
  "react-compiler": reactCompiler
11
11
  },
12
12
  rules: {
13
- "react-compiler/react-compiler": "error"
13
+ "react-compiler/react-compiler": "warn"
14
14
  }
15
15
  };
16
16
 
17
17
  export {
18
18
  reactCompilerEslintConfig
19
19
  };
20
- //# sourceMappingURL=chunk-NPTVKFZO.js.map
20
+ //# sourceMappingURL=chunk-LUPJ4SWW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/eslint/react-compiler/config.ts"],"sourcesContent":["import reactCompiler from \"eslint-plugin-react-compiler\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for React Compiler.\n *\n * @returns ESLint configuration object for React Compiler\n */\nexport const reactCompilerEslintConfig: EslintConfigObject = {\n name: configNames.reactCompiler,\n plugins: {\n \"react-compiler\": reactCompiler,\n },\n rules: {\n \"react-compiler/react-compiler\": \"error\",\n },\n};\n"],"mappings":";;;;;AAAA,OAAO,mBAAmB;AAWnB,IAAM,4BAAgD;AAAA,EAC3D,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP,kBAAkB;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,IACL,iCAAiC;AAAA,EACnC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/eslint/react-compiler/config.ts"],"sourcesContent":["import reactCompiler from \"eslint-plugin-react-compiler\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for React Compiler.\n *\n * @returns ESLint configuration object for React Compiler\n */\nexport const reactCompilerEslintConfig: EslintConfigObject = {\n name: configNames.reactCompiler,\n plugins: {\n \"react-compiler\": reactCompiler,\n },\n rules: {\n \"react-compiler/react-compiler\": \"warn\",\n },\n};\n"],"mappings":";;;;;AAAA,OAAO,mBAAmB;AAWnB,IAAM,4BAAgD;AAAA,EAC3D,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP,kBAAkB;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,IACL,iCAAiC;AAAA,EACnC;AACF;","names":[]}
@@ -1,3 +1,6 @@
1
+ import {
2
+ patchTailwindPlugin
3
+ } from "./chunk-ZED5DLW7.js";
1
4
  import {
2
5
  isObject,
3
6
  isString
@@ -49,6 +52,7 @@ var prettierConfig = (options = {}) => {
49
52
  } else {
50
53
  config.tailwindFunctions = defaultTailwindFunctions;
51
54
  }
55
+ patchTailwindPlugin();
52
56
  }
53
57
  config.plugins = plugins;
54
58
  return config;
@@ -57,4 +61,4 @@ var prettierConfig = (options = {}) => {
57
61
  export {
58
62
  prettierConfig
59
63
  };
60
- //# sourceMappingURL=chunk-HUTRDRS3.js.map
64
+ //# sourceMappingURL=chunk-MB4477NP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/prettier/index.ts"],"sourcesContent":["import type { Config as PrettierConfig } from \"prettier\";\nimport type { SortJsonOptions as SortJsonPluginOptions } from \"prettier-plugin-sort-json\";\nimport type { PluginOptions as TailwindPluginOptions } from \"prettier-plugin-tailwindcss\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { patchTailwindPlugin } from \"./patch-tailwind-plugin.js\";\n\nexport interface PrettierConfigOptions extends PrettierConfig {\n cssOrderPlugin?: boolean;\n curlyPlugin?: boolean;\n jsonSortPlugin?: boolean | SortJsonPluginOptions;\n packageJsonPlugin?: boolean;\n tailwindPlugin?: boolean | string | TailwindPluginOptions;\n}\n\nexport interface PrettierConfigWithPlugins\n extends PrettierConfig,\n SortJsonPluginOptions,\n TailwindPluginOptions {}\n\n/**\n * Creates a Prettier configuration object with optional Tailwind support\n *\n * @param options - Configuration options for Prettier\n * @param options.cssOrderPlugin CSS order sorting support\n * @param options.curlyPlugin Enforce curly braces for all control statements\n * @param options.jsonSortPlugin JSON sorting support\n * @param options.packageJsonPlugin Package.json sorting support\n * @param options.tailwindPlugin Tailwind CSS formatting support\n * @returns Prettier configuration object with:\n * - Default Prettier configuration\n * - Experimental ternaries enabled\n * - CSS order plugin\n * - Curly braces plugin\n * - JSON sorting plugin\n * - Package.json sorting plugin\n * - Optional Tailwind plugin and functions\n */\nexport const prettierConfig = (\n options: PrettierConfigOptions = {},\n): PrettierConfigWithPlugins => {\n const {\n cssOrderPlugin = true,\n curlyPlugin = true,\n jsonSortPlugin = true,\n packageJsonPlugin = true,\n tailwindPlugin = false,\n ...rest\n } = options;\n\n const plugins: string[] = [];\n const config: PrettierConfigWithPlugins = {\n experimentalTernaries: true,\n ...rest,\n };\n\n if (cssOrderPlugin) {\n plugins.push(\"prettier-plugin-css-order\");\n }\n\n if (curlyPlugin) {\n plugins.push(\"prettier-plugin-curly\");\n }\n\n if (jsonSortPlugin) {\n plugins.push(\"prettier-plugin-sort-json\");\n\n if (isObject(jsonSortPlugin)) {\n Object.assign(config, jsonSortPlugin);\n } else {\n config.jsonRecursiveSort = true;\n }\n }\n\n if (packageJsonPlugin) {\n plugins.push(\"prettier-plugin-packagejson\");\n }\n\n if (tailwindPlugin) {\n plugins.push(\"prettier-plugin-tailwindcss\");\n const defaultTailwindFunctions = [\"clsx\", \"cva\", \"cn\"];\n\n if (isString(tailwindPlugin)) {\n // then it's the path to the stylesheet\n config.tailwindStylesheet = tailwindPlugin;\n config.tailwindFunctions = defaultTailwindFunctions;\n } else if (isObject(tailwindPlugin)) {\n Object.assign(config, tailwindPlugin);\n\n // Ensure defaultTailwindFunctions is applied if tailwindFunctions wasn't specified\n if (!tailwindPlugin.tailwindFunctions) {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n } else {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n\n // Patch the Tailwind plugin declaration file to remove unsafe declare statement\n patchTailwindPlugin();\n }\n\n // Set plugins after all configurations are done\n config.plugins = plugins;\n\n return config;\n};\n"],"mappings":";;;;;;;;;AAsCO,IAAM,iBAAiB,CAC5B,UAAiC,CAAC,MACJ;AAC9B,QAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,IACjB,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,UAAoB,CAAC;AAC3B,QAAM,SAAoC;AAAA,IACxC,uBAAuB;AAAA,IACvB,GAAG;AAAA,EACL;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,2BAA2B;AAAA,EAC1C;AAEA,MAAI,aAAa;AACf,YAAQ,KAAK,uBAAuB;AAAA,EACtC;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,2BAA2B;AAExC,QAAI,SAAS,cAAc,GAAG;AAC5B,aAAO,OAAO,QAAQ,cAAc;AAAA,IACtC,OAAO;AACL,aAAO,oBAAoB;AAAA,IAC7B;AAAA,EACF;AAEA,MAAI,mBAAmB;AACrB,YAAQ,KAAK,6BAA6B;AAAA,EAC5C;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,6BAA6B;AAC1C,UAAM,2BAA2B,CAAC,QAAQ,OAAO,IAAI;AAErD,QAAI,SAAS,cAAc,GAAG;AAE5B,aAAO,qBAAqB;AAC5B,aAAO,oBAAoB;AAAA,IAC7B,WAAW,SAAS,cAAc,GAAG;AACnC,aAAO,OAAO,QAAQ,cAAc;AAGpC,UAAI,CAAC,eAAe,mBAAmB;AACrC,eAAO,oBAAoB;AAAA,MAC7B;AAAA,IACF,OAAO;AACL,aAAO,oBAAoB;AAAA,IAC7B;AAGA,wBAAoB;AAAA,EACtB;AAGA,SAAO,UAAU;AAEjB,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  configNames
3
- } from "./chunk-BDTLNELO.js";
3
+ } from "./chunk-PHDHPPH2.js";
4
4
 
5
5
  // src/eslint/turbo/config.ts
6
6
  import turbo from "eslint-plugin-turbo";
@@ -17,4 +17,4 @@ var turboConfig = () => ({
17
17
  export {
18
18
  turboConfig
19
19
  };
20
- //# sourceMappingURL=chunk-V3QNQKET.js.map
20
+ //# sourceMappingURL=chunk-NAQPNARH.js.map
@@ -9,13 +9,16 @@ var configNames = {
9
9
  preferArrowFunction: "prefer-arrow-function-config",
10
10
  react: "react-config",
11
11
  reactCompiler: "react-compiler-config",
12
+ storybook: "storybook:stories",
13
+ storybookConfig: "storybook:config",
12
14
  testing: "testing-config",
13
15
  turbo: "turbo-config",
14
16
  typescript: "tseslint-config",
17
+ typescriptTesting: "tseslint-testing-config",
15
18
  unicorn: "unicorn-config"
16
19
  };
17
20
 
18
21
  export {
19
22
  configNames
20
23
  };
21
- //# sourceMappingURL=chunk-BDTLNELO.js.map
24
+ //# sourceMappingURL=chunk-PHDHPPH2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/constants.ts"],"sourcesContent":["/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base-config\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores-config\",\n jsdoc: \"jsdoc-config\",\n markdown: \"markdown-config\",\n perfectionist: \"perfectionist-config\",\n preferArrowFunction: \"prefer-arrow-function-config\",\n react: \"react-config\",\n reactCompiler: \"react-compiler-config\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing-config\",\n turbo: \"turbo-config\",\n typescript: \"tseslint-config\",\n typescriptTesting: \"tseslint-testing-config\",\n unicorn: \"unicorn-config\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAKO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YZG34ZNI.js";
4
4
  import {
5
5
  configNames
6
- } from "./chunk-BDTLNELO.js";
6
+ } from "./chunk-PHDHPPH2.js";
7
7
 
8
8
  // src/eslint/unicorn/config.ts
9
9
  import unicorn from "eslint-plugin-unicorn";
@@ -18,4 +18,4 @@ var unicornConfig = {
18
18
  export {
19
19
  unicornConfig
20
20
  };
21
- //# sourceMappingURL=chunk-2EXCSH5L.js.map
21
+ //# sourceMappingURL=chunk-PIU5PRNJ.js.map
@@ -1,36 +1,39 @@
1
1
  import {
2
2
  turboConfig
3
- } from "./chunk-V3QNQKET.js";
3
+ } from "./chunk-NAQPNARH.js";
4
4
  import {
5
5
  tseslintConfig
6
- } from "./chunk-I4GUWATW.js";
6
+ } from "./chunk-ZKVGTPGV.js";
7
7
  import {
8
8
  unicornConfig
9
- } from "./chunk-2EXCSH5L.js";
9
+ } from "./chunk-PIU5PRNJ.js";
10
10
  import {
11
11
  preferArrowFunctionConfig
12
- } from "./chunk-HN2CEVC4.js";
12
+ } from "./chunk-YG7GTCRE.js";
13
13
  import {
14
14
  reactEslintConfig
15
- } from "./chunk-LYJZ2BXK.js";
15
+ } from "./chunk-HWZVK7LV.js";
16
16
  import {
17
17
  reactCompilerEslintConfig
18
- } from "./chunk-NPTVKFZO.js";
18
+ } from "./chunk-LUPJ4SWW.js";
19
+ import {
20
+ storybookConfig
21
+ } from "./chunk-YR7FD722.js";
19
22
  import {
20
23
  testingConfig
21
- } from "./chunk-XHFTPVHK.js";
24
+ } from "./chunk-YGS6KBZK.js";
22
25
  import {
23
26
  baseEslintConfig
24
- } from "./chunk-FJNJWCYG.js";
27
+ } from "./chunk-5HWRM6F6.js";
25
28
  import {
26
29
  jsdocConfig
27
- } from "./chunk-DR4DHSO2.js";
30
+ } from "./chunk-5XUVB2ZB.js";
28
31
  import {
29
32
  perfectionistConfig
30
- } from "./chunk-TA2KEF22.js";
33
+ } from "./chunk-ZTAPCYRD.js";
31
34
  import {
32
35
  ignoresConfig
33
- } from "./chunk-PB5PHG6U.js";
36
+ } from "./chunk-7WAIXW4V.js";
34
37
  import {
35
38
  isObject,
36
39
  isString
@@ -43,6 +46,7 @@ var eslintConfig = ({
43
46
  jsdoc = { requireJsdoc: false },
44
47
  react = false,
45
48
  sorting = true,
49
+ storybook = false,
46
50
  testing,
47
51
  /**
48
52
  * Some preceding documentation...
@@ -58,6 +62,7 @@ var eslintConfig = ({
58
62
  const configs = [
59
63
  ignoresConfig({
60
64
  next: isObject(react) && react.next,
65
+ storybook,
61
66
  userIgnores: ignores
62
67
  }),
63
68
  baseEslintConfig(functionStyle)
@@ -111,6 +116,9 @@ var eslintConfig = ({
111
116
  if (functionStyle === "arrow") {
112
117
  configs.push(preferArrowFunctionConfig());
113
118
  }
119
+ if (storybook) {
120
+ configs.push(...storybookConfig);
121
+ }
114
122
  if (turbo) {
115
123
  configs.push(turboConfig());
116
124
  }
@@ -123,4 +131,4 @@ var eslintConfig = ({
123
131
  export {
124
132
  eslintConfig
125
133
  };
126
- //# sourceMappingURL=chunk-IKA5P3EP.js.map
134
+ //# sourceMappingURL=chunk-QZHQTJ56.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/index.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport type { FunctionStyle } from \"./types.js\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { baseEslintConfig } from \"./base/config.js\";\nimport { ignoresConfig } from \"./ignores.js\";\nimport { jsdocConfig } from \"./jsdoc/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { preferArrowFunctionConfig } from \"./prefer-arrow-function/config.js\";\nimport { reactCompilerEslintConfig } from \"./react-compiler/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { storybookConfig } from \"./storybook/config.js\";\nimport { testingConfig, type TestingConfig } from \"./testing/config.js\";\nimport { turboConfig } from \"./turbo/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\nimport { unicornConfig } from \"./unicorn/config.js\";\n\nexport interface EslintConfigOptions {\n functionStyle?: \"off\" | FunctionStyle;\n ignores?: string[];\n jsdoc?:\n | false\n | {\n requireJsdoc?: boolean;\n };\n react?:\n | boolean\n | {\n next?: boolean | undefined;\n reactCompiler?: boolean | undefined;\n };\n sorting?: boolean;\n storybook?: boolean;\n testing?: false | TestingConfig;\n turbo?: boolean;\n typescript?: boolean | string;\n unicorn?: boolean;\n}\n\n/**\n * Configures ESLint based on provided options.\n *\n * @param options - The optional configuration object.\n * @param options.functionStyle - The function style to enforce. Defaults to \"arrow\".\n * @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `dist`.\n * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.\n * @param options.react - Whether to include React rules. When true, reactCompiler is enabled by default.\n * Can be configured with an object to control next.js support and reactCompiler.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.storybook - Whether to include Storybook rules. Defaults to false.\n * @param options.testing - An object with the following properties:\n * - `filenamePattern`: One of \"spec\" or \"test\" to determine which filename pattern to use.\n * - `files`: Array of file patterns to include in the configuration.\n * - `framework`: One of \"vitest\" or \"jest\" to determine which testing library to use.\n * - `formattingRules`: Whether to include formatting rules like padding around blocks.\n * - `itOrTest`: One of \"it\" or \"test\" to determine which test function to use.\n * @param options.typescript - Whether to include TypeScript rules. Can be a boolean or a string with path to tsconfig.\n * @param options.turbo - Whether to include Turborepo rules. Defaults to true.\n * @param options.unicorn - Whether to include Unicorn rules. Defaults to true.\n * @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.\n * @returns An array of ESLint configuration objects.\n */\nexport const eslintConfig = (\n {\n functionStyle = \"arrow\",\n ignores = [],\n jsdoc = { requireJsdoc: false },\n react = false,\n sorting = true,\n storybook = false,\n testing,\n /**\n * Some preceding documentation...\n *\n * @param options.turbo - Whether to include Turborepo rules. Defaults to false.\n *\n * Some following documentation...\n */\n turbo = false,\n typescript = true,\n unicorn = true,\n }: EslintConfigOptions = {},\n ...additionalConfigs: Linter.Config[]\n): Linter.Config[] => {\n const configs: Linter.Config[] = [\n ignoresConfig({\n next: isObject(react) && react.next,\n storybook,\n userIgnores: ignores,\n }),\n baseEslintConfig(functionStyle),\n ];\n\n if (jsdoc !== false) {\n configs.push(jsdocConfig(jsdoc.requireJsdoc ?? false));\n }\n\n if (typescript) {\n configs.push(\n ...(tseslintConfig(\n isString(typescript) ? typescript : undefined,\n ) as Linter.Config[]),\n );\n }\n\n if (react) {\n configs.push(reactEslintConfig(functionStyle, Boolean(typescript)));\n\n // Apply reactCompiler by default if react is true or if react.reactCompiler isn't explicitly false\n const shouldUseReactCompiler =\n react === true || (isObject(react) && react.reactCompiler !== false);\n\n if (shouldUseReactCompiler) {\n configs.push(reactCompilerEslintConfig);\n }\n }\n\n if (testing !== false) {\n const defaultTestingConfig: TestingConfig = {\n filenamePattern: \"test\",\n files: [\"**/*.{test,spec}.{ts,tsx,js,jsx}\"],\n formattingRules: true,\n framework: \"vitest\",\n itOrTest: \"it\",\n };\n\n // Merge the user's testing config with defaults\n const mergedTestingConfig: TestingConfig = {\n ...defaultTestingConfig,\n ...(isObject(testing) ? testing : {}),\n };\n\n // Destructure from the merged config\n const { filenamePattern, files, formattingRules, framework, itOrTest } =\n mergedTestingConfig;\n\n configs.push(\n testingConfig({\n filenamePattern,\n files,\n formattingRules,\n framework,\n itOrTest,\n }),\n );\n }\n\n if (sorting) {\n configs.push(perfectionistConfig);\n }\n\n if (unicorn) {\n configs.push(unicornConfig);\n }\n\n if (functionStyle === \"arrow\") {\n configs.push(preferArrowFunctionConfig());\n }\n\n if (storybook) {\n configs.push(...storybookConfig);\n }\n\n if (turbo) {\n configs.push(turboConfig());\n }\n\n // Add any additional config objects provided by the user\n if (additionalConfigs.length > 0) {\n configs.push(...additionalConfigs);\n }\n\n return configs;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DO,IAAM,eAAe,CAC1B;AAAA,EACE,gBAAgB;AAAA,EAChB,UAAU,CAAC;AAAA,EACX,QAAQ,EAAE,cAAc,MAAM;AAAA,EAC9B,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AACZ,IAAyB,CAAC,MACvB,sBACiB;AACpB,QAAM,UAA2B;AAAA,IAC/B,cAAc;AAAA,MACZ,MAAM,SAAS,KAAK,KAAK,MAAM;AAAA,MAC/B;AAAA,MACA,aAAa;AAAA,IACf,CAAC;AAAA,IACD,iBAAiB,aAAa;AAAA,EAChC;AAEA,MAAI,UAAU,OAAO;AACnB,YAAQ,KAAK,YAAY,MAA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 +200,6 @@ var baseEslintRules = (functionStyle) => ({
200
200
  * 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign
201
201
  */
202
202
  "no-multi-assign": ["warn"],
203
- /**
204
- * Disallow nested ternary expressions.
205
- *
206
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-nested-ternary
207
- */
208
- "no-nested-ternary": "warn",
209
203
  /**
210
204
  * Disallow `new` for side effects.
211
205
  *
@@ -429,4 +423,4 @@ var baseEslintRules = (functionStyle) => ({
429
423
  export {
430
424
  baseEslintRules
431
425
  };
432
- //# sourceMappingURL=chunk-ZOCL6XIB.js.map
426
+ //# sourceMappingURL=chunk-XICOWKSV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/base/rules.ts"],"sourcesContent":["import type { FunctionStyle } from \"../types.js\";\nimport type { BaseRules } from \"./types.js\";\n\n/**\n * Generates the base set of ESLint rules with configurable function style enforcement.\n *\n * @param functionStyle - Controls how functions should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @returns An object containing ESLint rule configurations\n */\nexport const baseEslintRules = (\n functionStyle: \"off\" | FunctionStyle,\n): BaseRules => ({\n /**\n * Require return statements in array methods callbacks.\n *\n * 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return\n */\n \"array-callback-return\": [\n \"warn\",\n { allowImplicit: true, checkForEach: true },\n ],\n /**\n * Treat `var` statements as if they were block scoped.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var\n */\n \"block-scoped-var\": \"warn\",\n /**\n * Require camel case names.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/camelcase\n */\n camelcase: [\n \"warn\",\n {\n allow: [\"^UNSAFE_\"],\n ignoreDestructuring: false,\n ignoreImports: true,\n properties: \"never\",\n },\n ],\n /**\n * Require curly braces for multiline blocks.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/curly\n */\n curly: [\"warn\", \"multi-line\"],\n /**\n * Require default clauses in switch statements to be last (if used).\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last\n */\n \"default-case-last\": \"warn\",\n /**\n * Require triple equals (`===` and `!==`).\n *å\n * 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq\n */\n eqeqeq: \"warn\",\n \"for-direction\": \"warn\",\n /**\n * Require function expressions to have a name.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/func-names\n */\n \"func-names\": [\"warn\", \"as-needed\"],\n \"func-style\":\n // if arrow function, we use the prefer-arrow-functions plugin\n functionStyle === \"off\" || functionStyle === \"arrow\" ?\n \"off\"\n : [\"warn\", functionStyle, { allowArrowFunctions: true }],\n /**\n * Require grouped accessor pairs in object literals and classes.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs\n */\n \"grouped-accessor-pairs\": \"warn\",\n /**\n * Require a capital letter for constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/new-cap\n */\n \"new-cap\": [\"warn\", { capIsNew: false }],\n /**\n * Disallow use of `alert()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-alert\n */\n \"no-alert\": \"warn\",\n \"no-async-promise-executor\": \"warn\",\n /**\n * Disallow use of bitwise operators.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-bitwise\n */\n \"no-bitwise\": \"warn\",\n /**\n * Disallow use of `caller`/`callee`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-caller\n */\n \"no-caller\": \"warn\",\n \"no-case-declarations\": \"warn\",\n \"no-compare-neg-zero\": \"warn\",\n \"no-cond-assign\": \"warn\",\n /**\n * Disallow the use of console.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-console\": [\"warn\", { allow: [\"info\", \"warn\", \"error\"] }],\n /**\n * Disallow expressions where the operation doesn't affect the value.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-constant-binary-expression\": \"warn\",\n \"no-constant-condition\": \"warn\",\n /**\n * Disallow returning value in constructor.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return\n */\n \"no-constructor-return\": \"warn\",\n \"no-control-regex\": \"warn\",\n \"no-debugger\": \"warn\",\n \"no-delete-var\": \"warn\",\n \"no-dupe-else-if\": \"warn\",\n \"no-duplicate-case\": \"warn\",\n /**\n * Disallow using an `else` if the `if` block contains a return.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-else-return\n */\n \"no-else-return\": \"warn\",\n \"no-empty\": \"warn\",\n \"no-empty-character-class\": \"warn\",\n \"no-empty-pattern\": \"warn\",\n \"no-empty-static-block\": \"warn\",\n /**\n * Disallow `eval()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-eval\n */\n \"no-eval\": \"warn\",\n \"no-ex-assign\": \"warn\",\n /**\n * Disallow extending native objects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native\n */\n \"no-extend-native\": \"warn\",\n /**\n * Disallow unnecessary function binding.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind\n */\n \"no-extra-bind\": \"warn\",\n \"no-extra-boolean-cast\": \"warn\",\n /**\n * Disallow unnecessary labels.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label\n */\n \"no-extra-label\": \"warn\",\n \"no-fallthrough\": \"warn\",\n \"no-global-assign\": \"warn\",\n /**\n * Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.\n *\n * 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion\n */\n \"no-implicit-coercion\": \"warn\",\n \"no-invalid-regexp\": \"warn\",\n \"no-irregular-whitespace\": \"warn\",\n /**\n * Disallow usage of `__iterator__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator\n */\n \"no-iterator\": \"warn\",\n /**\n * Disallow labels that share a name with a variable.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var\n */\n \"no-label-var\": \"warn\",\n /**\n * Disallow use of labels for anything other than loops and switches.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-labels\n */\n \"no-labels\": [\"warn\"],\n /**\n * Disallow unnecessary nested blocks.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks\n */\n \"no-lone-blocks\": \"warn\",\n /**\n * Disallow if as the only statement in an else block.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-lonely-if\n */\n \"no-lonely-if\": \"warn\",\n \"no-loss-of-precision\": \"warn\",\n \"no-misleading-character-class\": \"warn\",\n /**\n * Disallow use of chained assignment expressions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign\n */\n \"no-multi-assign\": [\"warn\"],\n /**\n * Disallow `new` for side effects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new\n */\n \"no-new\": \"warn\",\n /**\n * Disallow function constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func\n */\n \"no-new-func\": \"warn\",\n /**\n * Disallow primitive wrapper instances, such as `new String('foo')`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers\n */\n \"no-new-wrappers\": \"warn\",\n \"no-nonoctal-decimal-escape\": \"warn\",\n \"no-octal\": \"warn\",\n /**\n * Disallow use of octal escape sequences in string literals.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape\n */\n \"no-octal-escape\": \"warn\",\n /**\n * Disallow reassignment of function parameters.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign\n */\n \"no-param-reassign\": \"warn\",\n /**\n * Disallow returning values from Promise executor functions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-promise-executor-return\n */\n \"no-promise-executor-return\": \"warn\",\n /**\n * Disallow usage of the deprecated `__proto__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-proto\n */\n \"no-proto\": \"warn\",\n \"no-prototype-builtins\": \"warn\",\n \"no-regex-spaces\": \"warn\",\n /**\n * Disallow assignment in `return` statement.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign\n */\n \"no-return-assign\": \"warn\",\n /**\n * Disallow use of `javascript:` urls.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url\n */\n \"no-script-url\": \"warn\",\n \"no-self-assign\": \"warn\",\n /**\n * Disallow comparisons where both sides are exactly the same.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare\n */\n \"no-self-compare\": \"warn\",\n /**\n * Disallow use of comma operator.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences\n */\n \"no-sequences\": \"warn\",\n \"no-shadow-restricted-names\": \"warn\",\n \"no-sparse-arrays\": \"warn\",\n /**\n * Disallow template literal placeholder syntax in regular strings, as\n * these are likely errors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-template-curly-in-string\n */\n \"no-template-curly-in-string\": \"warn\",\n /**\n * Disallow initializing variables to `undefined`.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init\n */\n \"no-undef-init\": \"warn\",\n \"no-unexpected-multiline\": \"warn\",\n /**\n * Disallow ternary operators when simpler alternatives exist.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unneeded-ternary\n */\n \"no-unneeded-ternary\": \"warn\",\n /**\n * Disallow loops with a body that allows only one iteration.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unreachable-loop\n */\n \"no-unreachable-loop\": \"warn\",\n \"no-unsafe-finally\": \"warn\",\n \"no-unsafe-optional-chaining\": \"warn\",\n \"no-unused-labels\": \"warn\",\n \"no-unused-private-class-members\": \"warn\",\n \"no-useless-backreference\": \"warn\",\n /**\n * Disallow unnecessary `.call()` and `.apply()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call\n */\n \"no-useless-call\": \"warn\",\n \"no-useless-catch\": \"warn\",\n /**\n * Disallow useless computed property keys.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-computed-key\n */\n \"no-useless-computed-key\": \"warn\",\n /**\n * Disallow unnecessary concatenation of strings.\n *\n * � Not fixable - https://eslint.org/docs/rules/no-useless-concat\n */\n \"no-useless-concat\": \"warn\",\n \"no-useless-escape\": \"warn\",\n /**\n * Disallow renaming import, export, and destructured assignments to the\n * same name.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-rename\n */\n \"no-useless-rename\": \"warn\",\n /**\n * Disallow redundant return statements.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-return\n */\n \"no-useless-return\": \"warn\",\n /**\n * Require `let` or `const` instead of `var`.\n * ts transpiles let/const to var, so no need for vars any more\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-var\n */\n \"no-var\": \"warn\",\n \"no-with\": \"warn\",\n /**\n * Require object literal shorthand syntax.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/object-shorthand\n */\n \"object-shorthand\": \"warn\",\n /**\n * Require default to `const` instead of `let`.\n * ts provides better types with const\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-const\n */\n \"prefer-const\": \"warn\",\n /**\n * Require using named capture groups in regular expressions.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group\n */\n \"prefer-named-capture-group\": \"warn\",\n /**\n * Disallow parseInt() in favor of binary, octal, and hexadecimal literals.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-numeric-literals\n */\n \"prefer-numeric-literals\": \"warn\",\n /**\n * Require use of an object spread over Object.assign.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-object-spread\n */\n \"prefer-object-spread\": \"warn\",\n /**\n * Disallow use of the RegExp constructor in favor of regular expression\n * literals.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-regex-literals\n */\n \"prefer-regex-literals\": \"warn\",\n /**\n * Require using rest parameters instead of `arguments`.\n * ts provides better types with rest args over arguments\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-rest-params\n */\n \"prefer-rest-params\": \"warn\",\n /**\n * Require using spread syntax instead of `.apply()`.\n * ts transpiles spread to apply, so no need for manual apply\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-spread\n */\n \"prefer-spread\": \"warn\",\n /**\n * Require using template literals instead of string concatenation.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-template\n */\n \"prefer-template\": \"warn\",\n \"require-yield\": \"warn\",\n /**\n * Require a `Symbol` description.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/symbol-description\n */\n \"symbol-description\": \"warn\",\n \"use-isnan\": \"warn\",\n \"valid-typeof\": \"warn\",\n /**\n * Disallow \"Yoda conditions\", ensuring the comparison.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/yoda\n */\n yoda: \"warn\",\n});\n"],"mappings":";AAaO,IAAM,kBAAkB,CAC7B,mBACe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMf,yBAAyB;AAAA,IACvB;AAAA,IACA,EAAE,eAAe,MAAM,cAAc,KAAK;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpB,WAAW;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO,CAAC,UAAU;AAAA,MAClB,qBAAqB;AAAA,MACrB,eAAe;AAAA,MACf,YAAY;AAAA,IACd;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,CAAC,QAAQ,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5B,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrB,QAAQ;AAAA,EACR,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,cAAc,CAAC,QAAQ,WAAW;AAAA,EAClC;AAAA;AAAA,IAEE,kBAAkB,SAAS,kBAAkB,UAC3C,Q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AAM;AACR;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  configNames
3
- } from "./chunk-BDTLNELO.js";
3
+ } from "./chunk-PHDHPPH2.js";
4
4
 
5
5
  // src/eslint/prefer-arrow-function/config.ts
6
6
  import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
@@ -23,4 +23,4 @@ var preferArrowFunctionConfig = () => ({
23
23
  export {
24
24
  preferArrowFunctionConfig
25
25
  };
26
- //# sourceMappingURL=chunk-HN2CEVC4.js.map
26
+ //# sourceMappingURL=chunk-YG7GTCRE.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-HOZDQJWG.js";
7
7
  import {
8
8
  configNames
9
- } from "./chunk-BDTLNELO.js";
9
+ } from "./chunk-PHDHPPH2.js";
10
10
 
11
11
  // src/eslint/testing/config.ts
12
12
  import jest from "eslint-plugin-jest";
@@ -34,6 +34,7 @@ var testingConfig = ({
34
34
  },
35
35
  rules: {
36
36
  // jest doesn't have a file name rule, so we'll use this one for both
37
+ "@typescript-eslint/unbound-method": "off",
37
38
  "vitest/consistent-test-filename": [
38
39
  "warn",
39
40
  {
@@ -64,4 +65,4 @@ var testingConfig = ({
64
65
  export {
65
66
  testingConfig
66
67
  };
67
- //# sourceMappingURL=chunk-XHFTPVHK.js.map
68
+ //# sourceMappingURL=chunk-YGS6KBZK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/testing/config.ts"],"sourcesContent":["import jest from \"eslint-plugin-jest\";\nimport vitest from \"eslint-plugin-vitest\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { jestRules } from \"./jest-rules.js\";\nimport { vitestRules } from \"./vitest-rules.js\";\n\nexport interface TestingConfig {\n filenamePattern?: \"spec\" | \"test\";\n files?: string[];\n formattingRules?: boolean;\n framework?: \"bun\" | \"jest\" | \"node\" | \"vitest\";\n itOrTest?: \"it\" | \"test\";\n}\n\n/**\n * Creates an ESLint configuration object for testing.\n *\n * @param options - Configuration options\n * @param options.files - Files to include in the configuration\n * @param options.filenamePattern - \".test\" or \".spec\" filename pattern\n * @param options.itOrTest - \"it\" or \"test\"\n * @param options.framework - \"jest\" or \"vitest\"\n * @param options.formattingRules - Whether to include formatting rules like padding around blocks\n * @returns ESLint configuration object\n */\nexport const testingConfig = (\n {\n filenamePattern,\n files,\n formattingRules,\n framework,\n itOrTest,\n }: TestingConfig = {\n filenamePattern: \"test\",\n formattingRules: true,\n framework: \"vitest\",\n itOrTest: \"test\",\n },\n): EslintConfigObject => ({\n files: files ?? [\"**/*.{test,spec}.{ts,tsx,js,jsx}\"],\n languageOptions: {\n globals:\n framework === \"vitest\" ?\n { ...vitest.environments.env.globals }\n : jest.environments.globals.globals,\n },\n name: configNames.testing,\n plugins: {\n jest,\n vitest,\n },\n rules: {\n // jest doesn't have a file name rule, so we'll use this one for both\n \"@typescript-eslint/unbound-method\": \"off\",\n \"vitest/consistent-test-filename\": [\n \"warn\",\n {\n allTestPattern: \".*\\\\.(test|spec)\\\\.[tj]sx?$\",\n pattern: `.*\\\\.${filenamePattern}\\\\.[tj]sx?$`,\n },\n ],\n ...(framework === \"vitest\" ? vitestRules(itOrTest) : jestRules(itOrTest)),\n ...(formattingRules ?\n {\n \"jest/padding-around-after-all-blocks\": \"warn\",\n \"jest/padding-around-after-each-blocks\": \"warn\",\n \"jest/padding-around-before-all-blocks\": \"warn\",\n \"jest/padding-around-before-each-blocks\": \"warn\",\n \"jest/padding-around-describe-blocks\": \"warn\",\n \"jest/padding-around-expect-groups\": \"warn\",\n \"jest/padding-around-test-blocks\": \"warn\",\n }\n : {}),\n },\n ...(framework !== \"jest\" && framework !== \"vitest\" ?\n {\n settings: {\n jest: {\n globalPackage: framework === \"node\" ? \"node:test\" : \"bun:test\",\n },\n },\n }\n : {}),\n});\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,UAAU;AACjB,OAAO,YAAY;AA2BZ,IAAM,gBAAgB,CAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAmB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,UAAU;AACZ,OACwB;AAAA,EACxB,OAAO,SAAS,CAAC,kCAAkC;AAAA,EACnD,iBAAiB;AAAA,IACf,SACE,cAAc,WACZ,EAAE,GAAG,OAAO,aAAa,IAAI,QAAQ,IACrC,KAAK,aAAa,QAAQ;AAAA,EAChC;AAAA,EACA,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO;AAAA;AAAA,IAEL,qCAAqC;AAAA,IACrC,mCAAmC;AAAA,MACjC;AAAA,MACA;AAAA,QACE,gBAAgB;AAAA,QAChB,SAAS,QAAQ,eAAe;AAAA,MAClC;AAAA,IACF;AAAA,IACA,GAAI,cAAc,WAAW,YAAY,QAAQ,IAAI,UAAU,QAAQ;AAAA,IACvE,GAAI,kBACF;AAAA,MACE,wCAAwC;AAAA,MACxC,yCAAyC;AAAA,MACzC,yCAAyC;AAAA,MACzC,0CAA0C;AAAA,MAC1C,uCAAuC;AAAA,MACvC,qCAAqC;AAAA,MACrC,mCAAmC;AAAA,IACrC,IACA,CAAC;AAAA,EACL;AAAA,EACA,GAAI,cAAc,UAAU,cAAc,WACxC;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,eAAe,cAAc,SAAS,cAAc;AAAA,MACtD;AAAA,IACF;AAAA,EACF,IACA,CAAC;AACL;","names":[]}
@@ -0,0 +1,45 @@
1
+ import {
2
+ configNames
3
+ } from "./chunk-PHDHPPH2.js";
4
+
5
+ // src/eslint/storybook/config.ts
6
+ import storybookPlugin from "eslint-plugin-storybook";
7
+ var storybookConfig = [
8
+ {
9
+ files: [
10
+ "**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)",
11
+ "**/*.story.@(ts|tsx|js|jsx|mjs|cjs)"
12
+ ],
13
+ name: configNames.storybook,
14
+ plugins: {
15
+ storybook: storybookPlugin
16
+ },
17
+ rules: {
18
+ "import/no-anonymous-default-export": "off",
19
+ "react-hooks/rules-of-hooks": "off",
20
+ "storybook/await-interactions": "warn",
21
+ "storybook/context-in-play-function": "warn",
22
+ "storybook/csf-component": "warn",
23
+ "storybook/default-exports": "warn",
24
+ "storybook/hierarchy-separator": "warn",
25
+ "storybook/meta-inline-properties": "warn",
26
+ "storybook/no-redundant-story-name": "warn",
27
+ "storybook/prefer-pascal-case": "warn",
28
+ "storybook/story-exports": "warn",
29
+ "storybook/use-storybook-expect": "warn",
30
+ "storybook/use-storybook-testing-library": "warn"
31
+ }
32
+ },
33
+ {
34
+ files: [".storybook/main.@(js|cjs|mjs|ts)"],
35
+ name: configNames.storybookConfig,
36
+ rules: {
37
+ "storybook/no-uninstalled-addons": "warn"
38
+ }
39
+ }
40
+ ];
41
+
42
+ export {
43
+ storybookConfig
44
+ };
45
+ //# sourceMappingURL=chunk-YR7FD722.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/storybook/config.ts"],"sourcesContent":["import type { ESLint } from \"eslint\";\n\nimport storybookPlugin from \"eslint-plugin-storybook\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * ESLint configuration for Storybook.\n * Contains rules for best practices when working with Storybook.\n *\n * @returns Storybook ESLint config\n */\nexport const storybookConfig: EslintConfigObject[] = [\n {\n files: [\n \"**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)\",\n \"**/*.story.@(ts|tsx|js|jsx|mjs|cjs)\",\n ],\n name: configNames.storybook,\n plugins: {\n storybook: storybookPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n \"import/no-anonymous-default-export\": \"off\",\n \"react-hooks/rules-of-hooks\": \"off\",\n \"storybook/await-interactions\": \"warn\",\n \"storybook/context-in-play-function\": \"warn\",\n \"storybook/csf-component\": \"warn\",\n \"storybook/default-exports\": \"warn\",\n \"storybook/hierarchy-separator\": \"warn\",\n \"storybook/meta-inline-properties\": \"warn\",\n \"storybook/no-redundant-story-name\": \"warn\",\n \"storybook/prefer-pascal-case\": \"warn\",\n \"storybook/story-exports\": \"warn\",\n \"storybook/use-storybook-expect\": \"warn\",\n \"storybook/use-storybook-testing-library\": \"warn\",\n },\n },\n {\n files: [\".storybook/main.@(js|cjs|mjs|ts)\"],\n name: configNames.storybookConfig,\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n },\n },\n];\n"],"mappings":";;;;;AAEA,OAAO,qBAAqB;AAYrB,IAAM,kBAAwC;AAAA,EACnD;AAAA,IACE,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,MAAM,YAAY;AAAA,IAClB,SAAS;AAAA,MACP,WAAW;AAAA,IACb;AAAA,IACA,OAAO;AAAA,MACL,sCAAsC;AAAA,MACtC,8BAA8B;AAAA,MAC9B,gCAAgC;AAAA,MAChC,sCAAsC;AAAA,MACtC,2BAA2B;AAAA,MAC3B,6BAA6B;AAAA,MAC7B,iCAAiC;AAAA,MACjC,oCAAoC;AAAA,MACpC,qCAAqC;AAAA,MACrC,gCAAgC;AAAA,MAChC,2BAA2B;AAAA,MAC3B,kCAAkC;AAAA,MAClC,2CAA2C;AAAA,IAC7C;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,kCAAkC;AAAA,IAC1C,MAAM,YAAY;AAAA,IAClB,OAAO;AAAA,MACL,mCAAmC;AAAA,IACrC;AAAA,EACF;AACF;","names":[]}
@@ -1,9 +1,17 @@
1
- // scripts/postinstall.js
1
+ // src/prettier/patch-tailwind-plugin.ts
2
2
  import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
- var patchPrettierPluginTailwindcss = () => {
4
+ var DECLARE_BLOCK = `declare module 'prettier' {
5
+ interface RequiredOptions extends PluginOptions {
6
+ }
7
+ interface ParserOptions extends PluginOptions {
8
+ }
9
+ }`;
10
+ var patchTailwindPlugin = () => {
5
11
  try {
6
- console.info("js-style-kit: Starting postinstall patch...");
12
+ console.info(
13
+ "js-style-kit: Patching prettier-plugin-tailwindcss declaration file..."
14
+ );
7
15
  let pluginPath;
8
16
  const rootPath = path.join(
9
17
  "node_modules",
@@ -12,9 +20,8 @@ var patchPrettierPluginTailwindcss = () => {
12
20
  "index.d.ts"
13
21
  );
14
22
  const packagePath = path.join(
15
- __dirname,
16
- "..",
17
- "..",
23
+ process.cwd(),
24
+ "node_modules",
18
25
  "prettier-plugin-tailwindcss",
19
26
  "dist",
20
27
  "index.d.ts"
@@ -27,7 +34,7 @@ var patchPrettierPluginTailwindcss = () => {
27
34
  console.warn(
28
35
  "js-style-kit: prettier-plugin-tailwindcss not found, skipping patch"
29
36
  );
30
- return;
37
+ return false;
31
38
  }
32
39
  console.info(`js-style-kit: Found plugin at ${pluginPath}`);
33
40
  const backupPath = `${pluginPath}.backup`;
@@ -36,32 +43,31 @@ var patchPrettierPluginTailwindcss = () => {
36
43
  console.info("js-style-kit: Created backup of original declaration file");
37
44
  }
38
45
  const content = fs.readFileSync(pluginPath, "utf8");
39
- const declareBlock = `declare module 'prettier' {
40
- interface RequiredOptions extends PluginOptions {
41
- }
42
- interface ParserOptions extends PluginOptions {
43
- }
44
- }`;
45
- const patchedContent = content.replace(
46
- declareBlock,
47
- "// Removed unsafe declare module statement"
48
- );
49
- if (content !== patchedContent) {
50
- fs.writeFileSync(pluginPath, patchedContent);
51
- console.info(
52
- "js-style-kit: Successfully patched prettier-plugin-tailwindcss declaration file"
53
- );
54
- } else {
46
+ if (!content.includes(DECLARE_BLOCK)) {
55
47
  console.info(
56
48
  "js-style-kit: No patching needed, declaration block not found or already patched"
57
49
  );
50
+ return true;
58
51
  }
52
+ const patchedContent = content.replace(
53
+ DECLARE_BLOCK,
54
+ "// Removed unsafe declare module statement"
55
+ );
56
+ fs.writeFileSync(pluginPath, patchedContent);
57
+ console.info(
58
+ "js-style-kit: Successfully patched prettier-plugin-tailwindcss declaration file"
59
+ );
60
+ return true;
59
61
  } catch (error) {
60
62
  console.error(
61
63
  "js-style-kit: Error patching prettier-plugin-tailwindcss:",
62
64
  error
63
65
  );
66
+ return false;
64
67
  }
65
68
  };
66
- patchPrettierPluginTailwindcss();
67
- //# sourceMappingURL=postinstall.js.map
69
+
70
+ export {
71
+ patchTailwindPlugin
72
+ };
73
+ //# sourceMappingURL=chunk-ZED5DLW7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/prettier/patch-tailwind-plugin.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\n/**\n * The exact declare statement to remove from the prettier-plugin-tailwindcss declaration file\n * This statement causes conflicts with other Prettier plugins\n */\nconst DECLARE_BLOCK = `declare module 'prettier' {\n interface RequiredOptions extends PluginOptions {\n }\n interface ParserOptions extends PluginOptions {\n }\n}`;\n\n/**\n * Patches the declaration file of prettier-plugin-tailwindcss to remove the unsafe declare statement\n * that can cause conflicts with other Prettier plugins.\n *\n * @returns True if the patch was applied or already in place, false if plugin was not found or error occurred\n */\nexport const patchTailwindPlugin = (): boolean => {\n try {\n console.info(\n \"js-style-kit: Patching prettier-plugin-tailwindcss declaration file...\",\n );\n\n // Find the location of prettier-plugin-tailwindcss\n // This will work regardless of where js-style-kit is installed\n let pluginPath: string | undefined;\n\n // First try from the project root\n const rootPath = path.join(\n \"node_modules\",\n \"prettier-plugin-tailwindcss\",\n \"dist\",\n \"index.d.ts\",\n );\n\n // Then try from js-style-kit's directory\n const packagePath = path.join(\n process.cwd(),\n \"node_modules\",\n \"prettier-plugin-tailwindcss\",\n \"dist\",\n \"index.d.ts\",\n );\n\n // Choose the path that exists\n if (fs.existsSync(rootPath)) {\n pluginPath = rootPath;\n } else if (fs.existsSync(packagePath)) {\n pluginPath = packagePath;\n } else {\n console.warn(\n \"js-style-kit: prettier-plugin-tailwindcss not found, skipping patch\",\n );\n return false;\n }\n\n console.info(`js-style-kit: Found plugin at ${pluginPath}`);\n\n // Create backup of original file if it doesn't exist already\n const backupPath = `${pluginPath}.backup`;\n if (!fs.existsSync(backupPath)) {\n fs.writeFileSync(backupPath, fs.readFileSync(pluginPath, \"utf8\"));\n console.info(\"js-style-kit: Created backup of original declaration file\");\n }\n\n // Read the file\n const content = fs.readFileSync(pluginPath, \"utf8\");\n\n // Check if already patched\n if (!content.includes(DECLARE_BLOCK)) {\n console.info(\n \"js-style-kit: No patching needed, declaration block not found or already patched\",\n );\n return true;\n }\n\n // Replace the declare block with a comment\n const patchedContent = content.replace(\n DECLARE_BLOCK,\n \"// Removed unsafe declare module statement\",\n );\n\n // Write the patched file back\n fs.writeFileSync(pluginPath, patchedContent);\n console.info(\n \"js-style-kit: Successfully patched prettier-plugin-tailwindcss declaration file\",\n );\n\n return true;\n } catch (error) {\n console.error(\n \"js-style-kit: Error patching prettier-plugin-tailwindcss:\",\n error,\n );\n return false;\n }\n};\n"],"mappings":";AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AAMtB,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAaf,IAAM,sBAAsB,MAAe;AAChD,MAAI;AACF,YAAQ;AAAA,MACN;AAAA,IACF;AAIA,QAAI;AAGJ,UAAM,WAAgB;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAGA,UAAM,cAAmB;AAAA,MACvB,QAAQ,IAAI;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAGA,QAAO,cAAW,QAAQ,GAAG;AAC3B,mBAAa;AAAA,IACf,WAAc,cAAW,WAAW,GAAG;AACrC,mBAAa;AAAA,IACf,OAAO;AACL,cAAQ;AAAA,QACN;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAEA,YAAQ,KAAK,iCAAiC,UAAU,EAAE;AAG1D,UAAM,aAAa,GAAG,UAAU;AAChC,QAAI,CAAI,cAAW,UAAU,GAAG;AAC9B,MAAG,iBAAc,YAAe,gBAAa,YAAY,MAAM,CAAC;AAChE,cAAQ,KAAK,2DAA2D;AAAA,IAC1E;AAGA,UAAM,UAAa,gBAAa,YAAY,MAAM;AAGlD,QAAI,CAAC,QAAQ,SAAS,aAAa,GAAG;AACpC,cAAQ;AAAA,QACN;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAGA,UAAM,iBAAiB,QAAQ;AAAA,MAC7B;AAAA,MACA;AAAA,IACF;AAGA,IAAG,iBAAc,YAAY,cAAc;AAC3C,YAAQ;AAAA,MACN;AAAA,IACF;AAEA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ;AAAA,MACN;AAAA,MACA;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-LITSWCYQ.js";
4
4
  import {
5
5
  configNames
6
- } from "./chunk-BDTLNELO.js";
6
+ } from "./chunk-PHDHPPH2.js";
7
7
 
8
8
  // src/eslint/typescript/config.ts
9
9
  import tseslint from "typescript-eslint";
@@ -35,4 +35,4 @@ var tseslintConfig = (tsconfigPath) => {
35
35
  export {
36
36
  tseslintConfig
37
37
  };
38
- //# sourceMappingURL=chunk-I4GUWATW.js.map
38
+ //# sourceMappingURL=chunk-ZKVGTPGV.js.map