js-style-kit 0.2.9 → 0.2.11

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 (124) hide show
  1. package/LICENSE +1 -1
  2. package/dist/eslint/base/config.js +453 -5
  3. package/dist/eslint/base/config.js.map +1 -1
  4. package/dist/eslint/base/rules.js +421 -3
  5. package/dist/eslint/base/rules.js.map +1 -1
  6. package/dist/eslint/constants.d.ts +15 -14
  7. package/dist/eslint/constants.js +21 -3
  8. package/dist/eslint/constants.js.map +1 -1
  9. package/dist/eslint/ignores.js +38 -4
  10. package/dist/eslint/ignores.js.map +1 -1
  11. package/dist/eslint/index.d.ts +5 -0
  12. package/dist/eslint/index.js +1406 -27
  13. package/dist/eslint/index.js.map +1 -1
  14. package/dist/eslint/jsdoc/config.js +105 -5
  15. package/dist/eslint/jsdoc/config.js.map +1 -1
  16. package/dist/eslint/jsdoc/rules.js +69 -3
  17. package/dist/eslint/jsdoc/rules.js.map +1 -1
  18. package/dist/eslint/nextjs/config.d.ts +12 -0
  19. package/dist/eslint/nextjs/config.js +62 -0
  20. package/dist/eslint/nextjs/config.js.map +1 -0
  21. package/dist/eslint/nextjs/rules.d.ts +8 -0
  22. package/dist/eslint/nextjs/rules.js +28 -0
  23. package/dist/eslint/nextjs/rules.js.map +1 -0
  24. package/dist/eslint/nextjs/types.d.ts +29 -0
  25. package/dist/eslint/nextjs/types.js +1 -0
  26. package/dist/eslint/nextjs/types.js.map +1 -0
  27. package/dist/eslint/perfectionist/config.js +61 -5
  28. package/dist/eslint/perfectionist/config.js.map +1 -1
  29. package/dist/eslint/perfectionist/rules.js +27 -3
  30. package/dist/eslint/perfectionist/rules.js.map +1 -1
  31. package/dist/eslint/prefer-arrow-function/config.js +41 -4
  32. package/dist/eslint/prefer-arrow-function/config.js.map +1 -1
  33. package/dist/eslint/react/config.js +182 -5
  34. package/dist/eslint/react/config.js.map +1 -1
  35. package/dist/eslint/react/rules.js +128 -3
  36. package/dist/eslint/react/rules.js.map +1 -1
  37. package/dist/eslint/react-compiler/config.js +35 -4
  38. package/dist/eslint/react-compiler/config.js.map +1 -1
  39. package/dist/eslint/react-refresh/config.js +51 -5
  40. package/dist/eslint/react-refresh/config.js.map +1 -1
  41. package/dist/eslint/react-refresh/rules.js +15 -3
  42. package/dist/eslint/react-refresh/rules.js.map +1 -1
  43. package/dist/eslint/storybook/config.js +63 -4
  44. package/dist/eslint/storybook/config.js.map +1 -1
  45. package/dist/eslint/testing/config.js +165 -6
  46. package/dist/eslint/testing/config.js.map +1 -1
  47. package/dist/eslint/testing/jest-rules.js +40 -3
  48. package/dist/eslint/testing/jest-rules.js.map +1 -1
  49. package/dist/eslint/testing/vitest-rules.js +46 -3
  50. package/dist/eslint/testing/vitest-rules.js.map +1 -1
  51. package/dist/eslint/turbo/config.js +35 -4
  52. package/dist/eslint/turbo/config.js.map +1 -1
  53. package/dist/eslint/types.d.ts +1 -1
  54. package/dist/eslint/typescript/config.js +182 -5
  55. package/dist/eslint/typescript/config.js.map +1 -1
  56. package/dist/eslint/typescript/rules.js +131 -3
  57. package/dist/eslint/typescript/rules.js.map +1 -1
  58. package/dist/eslint/unicorn/config.js +109 -5
  59. package/dist/eslint/unicorn/config.js.map +1 -1
  60. package/dist/eslint/unicorn/rules.js +75 -3
  61. package/dist/eslint/unicorn/rules.js.map +1 -1
  62. package/dist/index.js +1527 -31
  63. package/dist/index.js.map +1 -1
  64. package/dist/prettier/index.js +128 -5
  65. package/dist/prettier/index.js.map +1 -1
  66. package/dist/prettier/patch-tailwind-plugin.js +68 -3
  67. package/dist/prettier/patch-tailwind-plugin.js.map +1 -1
  68. package/dist/utils/is-type.js +19 -8
  69. package/dist/utils/is-type.js.map +1 -1
  70. package/package.json +2 -2
  71. package/dist/chunk-26SVGV32.js +0 -133
  72. package/dist/chunk-26SVGV32.js.map +0 -1
  73. package/dist/chunk-2PDDRRZG.js +0 -21
  74. package/dist/chunk-2PDDRRZG.js.map +0 -1
  75. package/dist/chunk-3SHRYTUT.js +0 -32
  76. package/dist/chunk-3SHRYTUT.js.map +0 -1
  77. package/dist/chunk-6L7EDNAG.js +0 -20
  78. package/dist/chunk-6L7EDNAG.js.map +0 -1
  79. package/dist/chunk-76XASR6Z.js +0 -25
  80. package/dist/chunk-76XASR6Z.js.map +0 -1
  81. package/dist/chunk-7FTTMVPP.js +0 -20
  82. package/dist/chunk-7FTTMVPP.js.map +0 -1
  83. package/dist/chunk-7OLD3L3V.js +0 -64
  84. package/dist/chunk-7OLD3L3V.js.map +0 -1
  85. package/dist/chunk-7ZDM3TOO.js +0 -141
  86. package/dist/chunk-7ZDM3TOO.js.map +0 -1
  87. package/dist/chunk-A6AJGHPQ.js +0 -20
  88. package/dist/chunk-A6AJGHPQ.js.map +0 -1
  89. package/dist/chunk-CNYUGKH5.js +0 -38
  90. package/dist/chunk-CNYUGKH5.js.map +0 -1
  91. package/dist/chunk-HLIJN23S.js +0 -23
  92. package/dist/chunk-HLIJN23S.js.map +0 -1
  93. package/dist/chunk-HMC2O35U.js +0 -25
  94. package/dist/chunk-HMC2O35U.js.map +0 -1
  95. package/dist/chunk-HOZDQJWG.js +0 -51
  96. package/dist/chunk-HOZDQJWG.js.map +0 -1
  97. package/dist/chunk-LITSWCYQ.js +0 -135
  98. package/dist/chunk-LITSWCYQ.js.map +0 -1
  99. package/dist/chunk-N7AG2EKX.js +0 -48
  100. package/dist/chunk-N7AG2EKX.js.map +0 -1
  101. package/dist/chunk-PSSB4TGO.js +0 -29
  102. package/dist/chunk-PSSB4TGO.js.map +0 -1
  103. package/dist/chunk-SWT2QOL3.js +0 -21
  104. package/dist/chunk-SWT2QOL3.js.map +0 -1
  105. package/dist/chunk-U7AFEGMK.js +0 -23
  106. package/dist/chunk-U7AFEGMK.js.map +0 -1
  107. package/dist/chunk-UHCQX54J.js +0 -68
  108. package/dist/chunk-UHCQX54J.js.map +0 -1
  109. package/dist/chunk-UV6CA4PE.js +0 -45
  110. package/dist/chunk-UV6CA4PE.js.map +0 -1
  111. package/dist/chunk-X7JRY6MS.js +0 -41
  112. package/dist/chunk-X7JRY6MS.js.map +0 -1
  113. package/dist/chunk-XBITZIAZ.js +0 -21
  114. package/dist/chunk-XBITZIAZ.js.map +0 -1
  115. package/dist/chunk-XCPOAYGQ.js +0 -80
  116. package/dist/chunk-XCPOAYGQ.js.map +0 -1
  117. package/dist/chunk-XICOWKSV.js +0 -426
  118. package/dist/chunk-XICOWKSV.js.map +0 -1
  119. package/dist/chunk-YFJ363HR.js +0 -26
  120. package/dist/chunk-YFJ363HR.js.map +0 -1
  121. package/dist/chunk-YZG34ZNI.js +0 -80
  122. package/dist/chunk-YZG34ZNI.js.map +0 -1
  123. package/dist/chunk-ZED5DLW7.js +0 -73
  124. package/dist/chunk-ZED5DLW7.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/unicorn/rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ntype UnicornRules = Record<`unicorn/${string}`, EslintRuleConfig>;\n\nexport const rules: UnicornRules = {\n /**\n * Enforce better string content.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md\n */\n \"unicorn/better-regex\": \"warn\",\n /**\n * Enforce passing a message value when creating a built-in error.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md\n */\n \"unicorn/error-message\": \"warn\",\n /**\n * Require consistent filename case for all linted files.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md\n */\n \"unicorn/filename-case\": [\n \"warn\",\n {\n case: \"kebabCase\",\n },\n ],\n /**\n * Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md\n */\n \"unicorn/new-for-builtins\": \"warn\",\n \"unicorn/no-console-spaces\": \"warn\",\n /**\n * Enforce using for-loop instead of while-loop.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md\n */\n \"unicorn/no-for-loop\": \"warn\",\n /**\n * Enforce the use of addEventListener and removeEventListener over on-functions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md\n */\n \"unicorn/prefer-add-event-listener\": \"warn\",\n /**\n * Require using the `node:` protocol when importing Node.js built-in modules.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md\n */\n \"unicorn/prefer-node-protocol\": \"warn\",\n /**\n * Prefer String#replaceAll() over String#replace() with a global regExp.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md\n */\n \"unicorn/prefer-string-replace-all\": \"warn\",\n /**\n * Enforce throwing TypeError in type checking conditions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md\n */\n \"unicorn/prefer-type-error\": \"warn\",\n /**\n * Enforce consistent brace style for case clauses.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md\n */\n \"unicorn/switch-case-braces\": [\"warn\", \"always\"],\n /**\n * Enforce consistent case for text encoding identifiers.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md\n */\n \"unicorn/text-encoding-identifier-case\": \"warn\",\n};\n"],"mappings":";AAIO,IAAM,QAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjC,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxB,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzB,yBAAyB;AAAA,IACvB;AAAA,IACA;AAAA,MACE,MAAM;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,4BAA4B;AAAA,EAC5B,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7B,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvB,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMhC,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7B,8BAA8B,CAAC,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM/C,yCAAyC;AAC3C;","names":[]}
@@ -1,73 +0,0 @@
1
- // src/prettier/patch-tailwind-plugin.ts
2
- import * as fs from "node:fs";
3
- import * as path from "node:path";
4
- var DECLARE_BLOCK = `declare module 'prettier' {
5
- interface RequiredOptions extends PluginOptions {
6
- }
7
- interface ParserOptions extends PluginOptions {
8
- }
9
- }`;
10
- var patchTailwindPlugin = () => {
11
- try {
12
- console.info(
13
- "js-style-kit: Patching prettier-plugin-tailwindcss declaration file..."
14
- );
15
- let pluginPath;
16
- const rootPath = path.join(
17
- "node_modules",
18
- "prettier-plugin-tailwindcss",
19
- "dist",
20
- "index.d.ts"
21
- );
22
- const packagePath = path.join(
23
- process.cwd(),
24
- "node_modules",
25
- "prettier-plugin-tailwindcss",
26
- "dist",
27
- "index.d.ts"
28
- );
29
- if (fs.existsSync(rootPath)) {
30
- pluginPath = rootPath;
31
- } else if (fs.existsSync(packagePath)) {
32
- pluginPath = packagePath;
33
- } else {
34
- console.warn(
35
- "js-style-kit: prettier-plugin-tailwindcss not found, skipping patch"
36
- );
37
- return false;
38
- }
39
- console.info(`js-style-kit: Found plugin at ${pluginPath}`);
40
- const backupPath = `${pluginPath}.backup`;
41
- if (!fs.existsSync(backupPath)) {
42
- fs.writeFileSync(backupPath, fs.readFileSync(pluginPath, "utf8"));
43
- console.info("js-style-kit: Created backup of original declaration file");
44
- }
45
- const content = fs.readFileSync(pluginPath, "utf8");
46
- if (!content.includes(DECLARE_BLOCK)) {
47
- console.info(
48
- "js-style-kit: No patching needed, declaration block not found or already patched"
49
- );
50
- return true;
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;
61
- } catch (error) {
62
- console.error(
63
- "js-style-kit: Error patching prettier-plugin-tailwindcss:",
64
- error
65
- );
66
- return false;
67
- }
68
- };
69
-
70
- export {
71
- patchTailwindPlugin
72
- };
73
- //# sourceMappingURL=chunk-ZED5DLW7.js.map
@@ -1 +0,0 @@
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":[]}