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,8 +1,54 @@
1
- import {
2
- reactRefreshEslintConfig
3
- } from "../../chunk-U7AFEGMK.js";
4
- import "../../chunk-6L7EDNAG.js";
5
- import "../../chunk-76XASR6Z.js";
1
+ // src/eslint/react-refresh/config.ts
2
+ import reactRefresh from "eslint-plugin-react-refresh";
3
+
4
+ // src/eslint/constants.ts
5
+ var configNames = {
6
+ base: "base",
7
+ disableTypeChecked: "typescript-eslint/disable-type-checked",
8
+ ignores: "ignores",
9
+ jsdoc: "jsdoc",
10
+ markdown: "markdown",
11
+ nextjs: "nextjs",
12
+ perfectionist: "perfectionist",
13
+ preferArrowFunction: "prefer-arrow-function",
14
+ react: "react",
15
+ reactCompiler: "react-compiler",
16
+ reactRefresh: "react-refresh",
17
+ storybook: "storybook:stories",
18
+ storybookConfig: "storybook:config",
19
+ testing: "testing",
20
+ turbo: "turbo",
21
+ typescript: "tseslint",
22
+ typescriptTesting: "tseslint-testing",
23
+ unicorn: "unicorn"
24
+ };
25
+
26
+ // src/eslint/react-refresh/rules.ts
27
+ var reactRefreshRules = {
28
+ /**
29
+ * Validate that your components can safely be updated with Fast Refresh.
30
+ *
31
+ * This rule enforces that components are structured in a way that integrations
32
+ * like react-refresh expect.
33
+ *
34
+ * 🚫 Not fixable - https://github.com/ArnaudBarre/eslint-plugin-react-refresh
35
+ */
36
+ "react-refresh/only-export-components": [
37
+ "warn",
38
+ { allowConstantExport: true }
39
+ ]
40
+ };
41
+
42
+ // src/eslint/react-refresh/config.ts
43
+ var reactRefreshEslintConfig = () => {
44
+ return {
45
+ name: configNames.reactRefresh,
46
+ plugins: {
47
+ "react-refresh": reactRefresh
48
+ },
49
+ rules: reactRefreshRules
50
+ };
51
+ };
6
52
  export {
7
53
  reactRefreshEslintConfig
8
54
  };
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/eslint/react-refresh/config.ts","../../../src/eslint/constants.ts","../../../src/eslint/react-refresh/rules.ts"],"sourcesContent":["import reactRefresh from \"eslint-plugin-react-refresh\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { reactRefreshRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for React Refresh.\n *\n * This plugin validates that components can safely be updated with Fast Refresh.\n * It enforces that components are structured in a way that integrations like\n * react-refresh expect.\n *\n * @returns An ESLint configuration object for React Refresh.\n */\nexport const reactRefreshEslintConfig = (): EslintConfigObject => {\n return {\n name: configNames.reactRefresh,\n plugins: {\n \"react-refresh\": reactRefresh,\n },\n rules: reactRefreshRules,\n };\n};\n","/**\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\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n","import type { EslintRuleConfig } from \"../types.js\";\n\nexport type ReactRefreshRules = Record<string, EslintRuleConfig> & {\n \"react-refresh/only-export-components\"?: EslintRuleConfig<{\n /**\n * Don't warn when a constant (string, number, boolean, templateLiteral)\n * is exported aside one or more components.\n */\n allowConstantExport?: boolean;\n /**\n * If you use a framework that handles HMR of some specific exports,\n * you can use this option to avoid warning for them.\n */\n allowExportNames?: string[];\n /**\n * If you're using JSX inside .js files, you can enable this option.\n * To reduce false positives, only files importing 'react' are checked.\n */\n checkJS?: boolean;\n /**\n * If you're exporting a component wrapped in a custom HOC,\n * you can use this option to avoid false positives.\n */\n customHOCs?: string[];\n }>;\n};\n\n/**\n * Generates ESLint rules configuration for React Refresh.\n *\n * This plugin validates that components can safely be updated with Fast Refresh.\n *\n * @returns Configuration object containing ESLint rules for React Refresh\n */\nexport const reactRefreshRules: ReactRefreshRules = {\n /**\n * Validate that your components can safely be updated with Fast Refresh.\n *\n * This rule enforces that components are structured in a way that integrations\n * like react-refresh expect.\n *\n * 🚫 Not fixable - https://github.com/ArnaudBarre/eslint-plugin-react-refresh\n */\n \"react-refresh/only-export-components\": [\n \"warn\",\n { allowConstantExport: true },\n ],\n};\n"],"mappings":";AAAA,OAAO,kBAAkB;;;ACKlB,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;;;ACUO,IAAM,oBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,wCAAwC;AAAA,IACtC;AAAA,IACA,EAAE,qBAAqB,KAAK;AAAA,EAC9B;AACF;;;AF/BO,IAAM,2BAA2B,MAA0B;AAChE,SAAO;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS;AAAA,MACP,iBAAiB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,EACT;AACF;","names":[]}
@@ -1,6 +1,18 @@
1
- import {
2
- reactRefreshRules
3
- } from "../../chunk-6L7EDNAG.js";
1
+ // src/eslint/react-refresh/rules.ts
2
+ var reactRefreshRules = {
3
+ /**
4
+ * Validate that your components can safely be updated with Fast Refresh.
5
+ *
6
+ * This rule enforces that components are structured in a way that integrations
7
+ * like react-refresh expect.
8
+ *
9
+ * 🚫 Not fixable - https://github.com/ArnaudBarre/eslint-plugin-react-refresh
10
+ */
11
+ "react-refresh/only-export-components": [
12
+ "warn",
13
+ { allowConstantExport: true }
14
+ ]
15
+ };
4
16
  export {
5
17
  reactRefreshRules
6
18
  };
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/eslint/react-refresh/rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\nexport type ReactRefreshRules = Record<string, EslintRuleConfig> & {\n \"react-refresh/only-export-components\"?: EslintRuleConfig<{\n /**\n * Don't warn when a constant (string, number, boolean, templateLiteral)\n * is exported aside one or more components.\n */\n allowConstantExport?: boolean;\n /**\n * If you use a framework that handles HMR of some specific exports,\n * you can use this option to avoid warning for them.\n */\n allowExportNames?: string[];\n /**\n * If you're using JSX inside .js files, you can enable this option.\n * To reduce false positives, only files importing 'react' are checked.\n */\n checkJS?: boolean;\n /**\n * If you're exporting a component wrapped in a custom HOC,\n * you can use this option to avoid false positives.\n */\n customHOCs?: string[];\n }>;\n};\n\n/**\n * Generates ESLint rules configuration for React Refresh.\n *\n * This plugin validates that components can safely be updated with Fast Refresh.\n *\n * @returns Configuration object containing ESLint rules for React Refresh\n */\nexport const reactRefreshRules: ReactRefreshRules = {\n /**\n * Validate that your components can safely be updated with Fast Refresh.\n *\n * This rule enforces that components are structured in a way that integrations\n * like react-refresh expect.\n *\n * 🚫 Not fixable - https://github.com/ArnaudBarre/eslint-plugin-react-refresh\n */\n \"react-refresh/only-export-components\": [\n \"warn\",\n { allowConstantExport: true },\n ],\n};\n"],"mappings":";AAkCO,IAAM,oBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,wCAAwC;AAAA,IACtC;AAAA,IACA,EAAE,qBAAqB,KAAK;AAAA,EAC9B;AACF;","names":[]}
@@ -1,7 +1,66 @@
1
- import {
2
- storybookConfig
3
- } from "../../chunk-N7AG2EKX.js";
4
- import "../../chunk-76XASR6Z.js";
1
+ // src/eslint/storybook/config.ts
2
+ import storybookPlugin from "eslint-plugin-storybook";
3
+
4
+ // src/eslint/constants.ts
5
+ var configNames = {
6
+ base: "base",
7
+ disableTypeChecked: "typescript-eslint/disable-type-checked",
8
+ ignores: "ignores",
9
+ jsdoc: "jsdoc",
10
+ markdown: "markdown",
11
+ nextjs: "nextjs",
12
+ perfectionist: "perfectionist",
13
+ preferArrowFunction: "prefer-arrow-function",
14
+ react: "react",
15
+ reactCompiler: "react-compiler",
16
+ reactRefresh: "react-refresh",
17
+ storybook: "storybook:stories",
18
+ storybookConfig: "storybook:config",
19
+ testing: "testing",
20
+ turbo: "turbo",
21
+ typescript: "tseslint",
22
+ typescriptTesting: "tseslint-testing",
23
+ unicorn: "unicorn"
24
+ };
25
+
26
+ // src/eslint/storybook/config.ts
27
+ var storybookConfig = [
28
+ {
29
+ files: [
30
+ "**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)",
31
+ "**/*.story.@(ts|tsx|js|jsx|mjs|cjs)"
32
+ ],
33
+ name: configNames.storybook,
34
+ plugins: {
35
+ storybook: storybookPlugin
36
+ },
37
+ rules: {
38
+ "import/no-anonymous-default-export": "off",
39
+ "react-hooks/rules-of-hooks": "off",
40
+ "storybook/await-interactions": "warn",
41
+ "storybook/context-in-play-function": "warn",
42
+ "storybook/csf-component": "warn",
43
+ "storybook/default-exports": "warn",
44
+ "storybook/hierarchy-separator": "warn",
45
+ "storybook/meta-inline-properties": "warn",
46
+ "storybook/no-redundant-story-name": "warn",
47
+ "storybook/prefer-pascal-case": "warn",
48
+ "storybook/story-exports": "warn",
49
+ "storybook/use-storybook-expect": "warn",
50
+ "storybook/use-storybook-testing-library": "warn"
51
+ }
52
+ },
53
+ {
54
+ files: [".storybook/main.@(js|cjs|mjs|ts)"],
55
+ name: configNames.storybookConfig,
56
+ plugins: {
57
+ storybook: storybookPlugin
58
+ },
59
+ rules: {
60
+ "storybook/no-uninstalled-addons": "warn"
61
+ }
62
+ }
63
+ ];
5
64
  export {
6
65
  storybookConfig
7
66
  };
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/eslint/storybook/config.ts","../../../src/eslint/constants.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 plugins: {\n storybook: storybookPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n },\n },\n];\n","/**\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\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAEA,OAAO,qBAAqB;;;ACGrB,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;;;ADVO,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,SAAS;AAAA,MACP,WAAW;AAAA,IACb;AAAA,IACA,OAAO;AAAA,MACL,mCAAmC;AAAA,IACrC;AAAA,EACF;AACF;","names":[]}
@@ -1,9 +1,168 @@
1
- import {
2
- testingConfig
3
- } from "../../chunk-UHCQX54J.js";
4
- import "../../chunk-UV6CA4PE.js";
5
- import "../../chunk-HOZDQJWG.js";
6
- import "../../chunk-76XASR6Z.js";
1
+ // src/eslint/testing/config.ts
2
+ import jest from "eslint-plugin-jest";
3
+ import vitest from "eslint-plugin-vitest";
4
+
5
+ // src/eslint/constants.ts
6
+ var configNames = {
7
+ base: "base",
8
+ disableTypeChecked: "typescript-eslint/disable-type-checked",
9
+ ignores: "ignores",
10
+ jsdoc: "jsdoc",
11
+ markdown: "markdown",
12
+ nextjs: "nextjs",
13
+ perfectionist: "perfectionist",
14
+ preferArrowFunction: "prefer-arrow-function",
15
+ react: "react",
16
+ reactCompiler: "react-compiler",
17
+ reactRefresh: "react-refresh",
18
+ storybook: "storybook:stories",
19
+ storybookConfig: "storybook:config",
20
+ testing: "testing",
21
+ turbo: "turbo",
22
+ typescript: "tseslint",
23
+ typescriptTesting: "tseslint-testing",
24
+ unicorn: "unicorn"
25
+ };
26
+
27
+ // src/eslint/testing/jest-rules.ts
28
+ var jestRules = (itOrTest = "test") => ({
29
+ "jest/consistent-test-it": [
30
+ "warn",
31
+ { fn: itOrTest, withinDescribe: itOrTest }
32
+ ],
33
+ "jest/expect-expect": "warn",
34
+ "jest/no-commented-out-tests": "warn",
35
+ "jest/no-conditional-expect": "warn",
36
+ "jest/no-conditional-in-test": "warn",
37
+ "jest/no-disabled-tests": "warn",
38
+ "jest/no-duplicate-hooks": "warn",
39
+ "jest/no-focused-tests": "warn",
40
+ "jest/no-identical-title": "warn",
41
+ "jest/no-interpolation-in-snapshots": "warn",
42
+ "jest/no-large-snapshots": ["warn", { inlineMaxSize: 50, maxSize: 100 }],
43
+ "jest/no-mocks-import": "warn",
44
+ // Discourage manually importing from __mocks__
45
+ "jest/no-standalone-expect": "warn",
46
+ "jest/no-test-prefixes": "warn",
47
+ // Prefer .only and .skip over f and x
48
+ "jest/no-test-return-statement": "warn",
49
+ "jest/prefer-comparison-matcher": "warn",
50
+ "jest/prefer-equality-matcher": "warn",
51
+ "jest/prefer-expect-resolves": "warn",
52
+ "jest/prefer-hooks-in-order": "warn",
53
+ "jest/prefer-hooks-on-top": "warn",
54
+ "jest/prefer-lowercase-title": ["warn", { ignoreTopLevelDescribe: true }],
55
+ "jest/prefer-snapshot-hint": "warn",
56
+ "jest/prefer-spy-on": "warn",
57
+ "jest/prefer-strict-equal": "warn",
58
+ "jest/prefer-to-be": "warn",
59
+ "jest/prefer-to-contain": "warn",
60
+ "jest/prefer-to-have-length": "warn",
61
+ "jest/require-top-level-describe": "warn",
62
+ "jest/valid-describe-callback": "warn",
63
+ "jest/valid-expect": "warn",
64
+ "jest/valid-expect-in-promise": "warn",
65
+ "jest/valid-title": "warn"
66
+ });
67
+
68
+ // src/eslint/testing/vitest-rules.ts
69
+ var vitestRules = (itOrTest = "test") => ({
70
+ "vitest/consistent-test-it": [
71
+ "warn",
72
+ { fn: itOrTest, withinDescribe: itOrTest }
73
+ ],
74
+ "vitest/expect-expect": "warn",
75
+ "vitest/no-commented-out-tests": "warn",
76
+ "vitest/no-conditional-in-test": "warn",
77
+ "vitest/no-disabled-tests": "warn",
78
+ "vitest/no-duplicate-hooks": "warn",
79
+ "vitest/no-focused-tests": "warn",
80
+ "vitest/no-identical-title": "warn",
81
+ "vitest/no-import-node-test": "warn",
82
+ "vitest/no-interpolation-in-snapshots": "warn",
83
+ // Avoid dynamic snapshots
84
+ "vitest/no-large-snapshots": ["warn", { inlineMaxSize: 50, maxSize: 100 }],
85
+ // Keep snapshots manageable
86
+ "vitest/no-standalone-expect": "warn",
87
+ "vitest/no-test-return-statement": "warn",
88
+ // Tests shouldn't return values
89
+ "vitest/prefer-comparison-matcher": "warn",
90
+ // Use comparison matchers
91
+ "vitest/prefer-equality-matcher": "warn",
92
+ // Use equality matchers
93
+ "vitest/prefer-hooks-in-order": "warn",
94
+ // Keep hooks in a predictable order
95
+ "vitest/prefer-hooks-on-top": "warn",
96
+ // Keep hooks organized
97
+ "vitest/prefer-lowercase-title": ["warn", { ignoreTopLevelDescribe: true }],
98
+ // Consistent casing
99
+ "vitest/prefer-strict-equal": "warn",
100
+ // Prefer .toStrictEqual() over .toEqual()
101
+ "vitest/prefer-to-be": "warn",
102
+ // Use .toBe() for primitives
103
+ "vitest/prefer-to-contain": "warn",
104
+ // Use .toContain() for array/string includes
105
+ "vitest/prefer-to-have-length": "warn",
106
+ // Use .toHaveLength() for checking length
107
+ "vitest/require-local-test-context-for-concurrent-snapshots": "warn",
108
+ "vitest/require-top-level-describe": "warn",
109
+ // Group tests in describe blocks
110
+ "vitest/valid-describe-callback": "warn",
111
+ "vitest/valid-expect": "warn",
112
+ "vitest/valid-title": "warn"
113
+ });
114
+
115
+ // src/eslint/testing/config.ts
116
+ var testingConfig = ({
117
+ filenamePattern,
118
+ files,
119
+ formattingRules,
120
+ framework,
121
+ itOrTest
122
+ } = {
123
+ filenamePattern: "test",
124
+ formattingRules: true,
125
+ framework: "vitest",
126
+ itOrTest: "test"
127
+ }) => ({
128
+ files: files ?? ["**/*.{test,spec}.{ts,tsx,js,jsx}"],
129
+ languageOptions: {
130
+ globals: framework === "vitest" ? { ...vitest.environments.env.globals } : jest.environments.globals.globals
131
+ },
132
+ name: configNames.testing,
133
+ plugins: {
134
+ jest,
135
+ vitest
136
+ },
137
+ rules: {
138
+ // jest doesn't have a file name rule, so we'll use this one for both
139
+ "@typescript-eslint/unbound-method": "off",
140
+ "vitest/consistent-test-filename": [
141
+ "warn",
142
+ {
143
+ allTestPattern: ".*\\.(test|spec)\\.[tj]sx?$",
144
+ pattern: `.*\\.${filenamePattern}\\.[tj]sx?$`
145
+ }
146
+ ],
147
+ ...framework === "vitest" ? vitestRules(itOrTest) : jestRules(itOrTest),
148
+ ...formattingRules ? {
149
+ "jest/padding-around-after-all-blocks": "warn",
150
+ "jest/padding-around-after-each-blocks": "warn",
151
+ "jest/padding-around-before-all-blocks": "warn",
152
+ "jest/padding-around-before-each-blocks": "warn",
153
+ "jest/padding-around-describe-blocks": "warn",
154
+ "jest/padding-around-expect-groups": "warn",
155
+ "jest/padding-around-test-blocks": "warn"
156
+ } : {}
157
+ },
158
+ ...framework !== "jest" && framework !== "vitest" ? {
159
+ settings: {
160
+ jest: {
161
+ globalPackage: framework === "node" ? "node:test" : "bun:test"
162
+ }
163
+ }
164
+ } : {}
165
+ });
7
166
  export {
8
167
  testingConfig
9
168
  };
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/eslint/testing/config.ts","../../../src/eslint/constants.ts","../../../src/eslint/testing/jest-rules.ts","../../../src/eslint/testing/vitest-rules.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","/**\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\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n","import type { EslintRuleConfig } from \"../types.js\";\n\ntype JestRules = Record<`jest/${string}`, EslintRuleConfig>;\n\n/**\n * Creates an object containing the ESLint rules for jest.\n *\n * @param itOrTest - \"it\" or \"test\"\n * @returns An object containing the ESLint rules for jest.\n */\nexport const jestRules = (itOrTest: \"it\" | \"test\" = \"test\"): JestRules => ({\n \"jest/consistent-test-it\": [\n \"warn\",\n { fn: itOrTest, withinDescribe: itOrTest },\n ],\n \"jest/expect-expect\": \"warn\",\n \"jest/no-commented-out-tests\": \"warn\",\n \"jest/no-conditional-expect\": \"warn\",\n \"jest/no-conditional-in-test\": \"warn\",\n \"jest/no-disabled-tests\": \"warn\",\n \"jest/no-duplicate-hooks\": \"warn\",\n \"jest/no-focused-tests\": \"warn\",\n \"jest/no-identical-title\": \"warn\",\n \"jest/no-interpolation-in-snapshots\": \"warn\",\n \"jest/no-large-snapshots\": [\"warn\", { inlineMaxSize: 50, maxSize: 100 }],\n \"jest/no-mocks-import\": \"warn\", // Discourage manually importing from __mocks__\n \"jest/no-standalone-expect\": \"warn\",\n \"jest/no-test-prefixes\": \"warn\", // Prefer .only and .skip over f and x\n \"jest/no-test-return-statement\": \"warn\",\n \"jest/prefer-comparison-matcher\": \"warn\",\n \"jest/prefer-equality-matcher\": \"warn\",\n \"jest/prefer-expect-resolves\": \"warn\",\n \"jest/prefer-hooks-in-order\": \"warn\",\n \"jest/prefer-hooks-on-top\": \"warn\",\n \"jest/prefer-lowercase-title\": [\"warn\", { ignoreTopLevelDescribe: true }],\n \"jest/prefer-snapshot-hint\": \"warn\",\n \"jest/prefer-spy-on\": \"warn\",\n \"jest/prefer-strict-equal\": \"warn\",\n \"jest/prefer-to-be\": \"warn\",\n \"jest/prefer-to-contain\": \"warn\",\n \"jest/prefer-to-have-length\": \"warn\",\n \"jest/require-top-level-describe\": \"warn\",\n \"jest/valid-describe-callback\": \"warn\",\n \"jest/valid-expect\": \"warn\",\n \"jest/valid-expect-in-promise\": \"warn\",\n \"jest/valid-title\": \"warn\",\n});\n","import type { EslintRuleConfig } from \"../types.js\";\n\ntype VitestRules = Record<`vitest/${string}`, EslintRuleConfig>;\n\n/**\n * Creates an object containing the ESLint rules for vitest.\n *\n * @param itOrTest - \"it\" or \"test\"\n * @returns An object containing the ESLint rules for vitest.\n */\nexport const vitestRules = (itOrTest: \"it\" | \"test\" = \"test\"): VitestRules => ({\n \"vitest/consistent-test-it\": [\n \"warn\",\n { fn: itOrTest, withinDescribe: itOrTest },\n ],\n \"vitest/expect-expect\": \"warn\",\n \"vitest/no-commented-out-tests\": \"warn\",\n \"vitest/no-conditional-in-test\": \"warn\",\n \"vitest/no-disabled-tests\": \"warn\",\n \"vitest/no-duplicate-hooks\": \"warn\",\n \"vitest/no-focused-tests\": \"warn\",\n \"vitest/no-identical-title\": \"warn\",\n \"vitest/no-import-node-test\": \"warn\",\n \"vitest/no-interpolation-in-snapshots\": \"warn\", // Avoid dynamic snapshots\n \"vitest/no-large-snapshots\": [\"warn\", { inlineMaxSize: 50, maxSize: 100 }], // Keep snapshots manageable\n \"vitest/no-standalone-expect\": \"warn\",\n \"vitest/no-test-return-statement\": \"warn\", // Tests shouldn't return values\n \"vitest/prefer-comparison-matcher\": \"warn\", // Use comparison matchers\n \"vitest/prefer-equality-matcher\": \"warn\", // Use equality matchers\n \"vitest/prefer-hooks-in-order\": \"warn\", // Keep hooks in a predictable order\n \"vitest/prefer-hooks-on-top\": \"warn\", // Keep hooks organized\n \"vitest/prefer-lowercase-title\": [\"warn\", { ignoreTopLevelDescribe: true }], // Consistent casing\n \"vitest/prefer-strict-equal\": \"warn\", // Prefer .toStrictEqual() over .toEqual()\n \"vitest/prefer-to-be\": \"warn\", // Use .toBe() for primitives\n \"vitest/prefer-to-contain\": \"warn\", // Use .toContain() for array/string includes\n \"vitest/prefer-to-have-length\": \"warn\", // Use .toHaveLength() for checking length\n \"vitest/require-local-test-context-for-concurrent-snapshots\": \"warn\",\n \"vitest/require-top-level-describe\": \"warn\", // Group tests in describe blocks\n \"vitest/valid-describe-callback\": \"warn\",\n \"vitest/valid-expect\": \"warn\",\n \"vitest/valid-title\": \"warn\",\n});\n"],"mappings":"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","names":[]}
@@ -1,6 +1,43 @@
1
- import {
2
- jestRules
3
- } from "../../chunk-UV6CA4PE.js";
1
+ // src/eslint/testing/jest-rules.ts
2
+ var jestRules = (itOrTest = "test") => ({
3
+ "jest/consistent-test-it": [
4
+ "warn",
5
+ { fn: itOrTest, withinDescribe: itOrTest }
6
+ ],
7
+ "jest/expect-expect": "warn",
8
+ "jest/no-commented-out-tests": "warn",
9
+ "jest/no-conditional-expect": "warn",
10
+ "jest/no-conditional-in-test": "warn",
11
+ "jest/no-disabled-tests": "warn",
12
+ "jest/no-duplicate-hooks": "warn",
13
+ "jest/no-focused-tests": "warn",
14
+ "jest/no-identical-title": "warn",
15
+ "jest/no-interpolation-in-snapshots": "warn",
16
+ "jest/no-large-snapshots": ["warn", { inlineMaxSize: 50, maxSize: 100 }],
17
+ "jest/no-mocks-import": "warn",
18
+ // Discourage manually importing from __mocks__
19
+ "jest/no-standalone-expect": "warn",
20
+ "jest/no-test-prefixes": "warn",
21
+ // Prefer .only and .skip over f and x
22
+ "jest/no-test-return-statement": "warn",
23
+ "jest/prefer-comparison-matcher": "warn",
24
+ "jest/prefer-equality-matcher": "warn",
25
+ "jest/prefer-expect-resolves": "warn",
26
+ "jest/prefer-hooks-in-order": "warn",
27
+ "jest/prefer-hooks-on-top": "warn",
28
+ "jest/prefer-lowercase-title": ["warn", { ignoreTopLevelDescribe: true }],
29
+ "jest/prefer-snapshot-hint": "warn",
30
+ "jest/prefer-spy-on": "warn",
31
+ "jest/prefer-strict-equal": "warn",
32
+ "jest/prefer-to-be": "warn",
33
+ "jest/prefer-to-contain": "warn",
34
+ "jest/prefer-to-have-length": "warn",
35
+ "jest/require-top-level-describe": "warn",
36
+ "jest/valid-describe-callback": "warn",
37
+ "jest/valid-expect": "warn",
38
+ "jest/valid-expect-in-promise": "warn",
39
+ "jest/valid-title": "warn"
40
+ });
4
41
  export {
5
42
  jestRules
6
43
  };
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/eslint/testing/jest-rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ntype JestRules = Record<`jest/${string}`, EslintRuleConfig>;\n\n/**\n * Creates an object containing the ESLint rules for jest.\n *\n * @param itOrTest - \"it\" or \"test\"\n * @returns An object containing the ESLint rules for jest.\n */\nexport const jestRules = (itOrTest: \"it\" | \"test\" = \"test\"): JestRules => ({\n \"jest/consistent-test-it\": [\n \"warn\",\n { fn: itOrTest, withinDescribe: itOrTest },\n ],\n \"jest/expect-expect\": \"warn\",\n \"jest/no-commented-out-tests\": \"warn\",\n \"jest/no-conditional-expect\": \"warn\",\n \"jest/no-conditional-in-test\": \"warn\",\n \"jest/no-disabled-tests\": \"warn\",\n \"jest/no-duplicate-hooks\": \"warn\",\n \"jest/no-focused-tests\": \"warn\",\n \"jest/no-identical-title\": \"warn\",\n \"jest/no-interpolation-in-snapshots\": \"warn\",\n \"jest/no-large-snapshots\": [\"warn\", { inlineMaxSize: 50, maxSize: 100 }],\n \"jest/no-mocks-import\": \"warn\", // Discourage manually importing from __mocks__\n \"jest/no-standalone-expect\": \"warn\",\n \"jest/no-test-prefixes\": \"warn\", // Prefer .only and .skip over f and x\n \"jest/no-test-return-statement\": \"warn\",\n \"jest/prefer-comparison-matcher\": \"warn\",\n \"jest/prefer-equality-matcher\": \"warn\",\n \"jest/prefer-expect-resolves\": \"warn\",\n \"jest/prefer-hooks-in-order\": \"warn\",\n \"jest/prefer-hooks-on-top\": \"warn\",\n \"jest/prefer-lowercase-title\": [\"warn\", { ignoreTopLevelDescribe: true }],\n \"jest/prefer-snapshot-hint\": \"warn\",\n \"jest/prefer-spy-on\": \"warn\",\n \"jest/prefer-strict-equal\": \"warn\",\n \"jest/prefer-to-be\": \"warn\",\n \"jest/prefer-to-contain\": \"warn\",\n \"jest/prefer-to-have-length\": \"warn\",\n \"jest/require-top-level-describe\": \"warn\",\n \"jest/valid-describe-callback\": \"warn\",\n \"jest/valid-expect\": \"warn\",\n \"jest/valid-expect-in-promise\": \"warn\",\n \"jest/valid-title\": \"warn\",\n});\n"],"mappings":";AAUO,IAAM,YAAY,CAAC,WAA0B,YAAuB;AAAA,EACzE,2BAA2B;AAAA,IACzB;AAAA,IACA,EAAE,IAAI,UAAU,gBAAgB,SAAS;AAAA,EAC3C;AAAA,EACA,sBAAsB;AAAA,EACtB,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,sCAAsC;AAAA,EACtC,2BAA2B,CAAC,QAAQ,EAAE,eAAe,IAAI,SAAS,IAAI,CAAC;AAAA,EACvE,wBAAwB;AAAA;AAAA,EACxB,6BAA6B;AAAA,EAC7B,yBAAyB;AAAA;AAAA,EACzB,iCAAiC;AAAA,EACjC,kCAAkC;AAAA,EAClC,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,4BAA4B;AAAA,EAC5B,+BAA+B,CAAC,QAAQ,EAAE,wBAAwB,KAAK,CAAC;AAAA,EACxE,6BAA6B;AAAA,EAC7B,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,8BAA8B;AAAA,EAC9B,mCAAmC;AAAA,EACnC,gCAAgC;AAAA,EAChC,qBAAqB;AAAA,EACrB,gCAAgC;AAAA,EAChC,oBAAoB;AACtB;","names":[]}
@@ -1,6 +1,49 @@
1
- import {
2
- vitestRules
3
- } from "../../chunk-HOZDQJWG.js";
1
+ // src/eslint/testing/vitest-rules.ts
2
+ var vitestRules = (itOrTest = "test") => ({
3
+ "vitest/consistent-test-it": [
4
+ "warn",
5
+ { fn: itOrTest, withinDescribe: itOrTest }
6
+ ],
7
+ "vitest/expect-expect": "warn",
8
+ "vitest/no-commented-out-tests": "warn",
9
+ "vitest/no-conditional-in-test": "warn",
10
+ "vitest/no-disabled-tests": "warn",
11
+ "vitest/no-duplicate-hooks": "warn",
12
+ "vitest/no-focused-tests": "warn",
13
+ "vitest/no-identical-title": "warn",
14
+ "vitest/no-import-node-test": "warn",
15
+ "vitest/no-interpolation-in-snapshots": "warn",
16
+ // Avoid dynamic snapshots
17
+ "vitest/no-large-snapshots": ["warn", { inlineMaxSize: 50, maxSize: 100 }],
18
+ // Keep snapshots manageable
19
+ "vitest/no-standalone-expect": "warn",
20
+ "vitest/no-test-return-statement": "warn",
21
+ // Tests shouldn't return values
22
+ "vitest/prefer-comparison-matcher": "warn",
23
+ // Use comparison matchers
24
+ "vitest/prefer-equality-matcher": "warn",
25
+ // Use equality matchers
26
+ "vitest/prefer-hooks-in-order": "warn",
27
+ // Keep hooks in a predictable order
28
+ "vitest/prefer-hooks-on-top": "warn",
29
+ // Keep hooks organized
30
+ "vitest/prefer-lowercase-title": ["warn", { ignoreTopLevelDescribe: true }],
31
+ // Consistent casing
32
+ "vitest/prefer-strict-equal": "warn",
33
+ // Prefer .toStrictEqual() over .toEqual()
34
+ "vitest/prefer-to-be": "warn",
35
+ // Use .toBe() for primitives
36
+ "vitest/prefer-to-contain": "warn",
37
+ // Use .toContain() for array/string includes
38
+ "vitest/prefer-to-have-length": "warn",
39
+ // Use .toHaveLength() for checking length
40
+ "vitest/require-local-test-context-for-concurrent-snapshots": "warn",
41
+ "vitest/require-top-level-describe": "warn",
42
+ // Group tests in describe blocks
43
+ "vitest/valid-describe-callback": "warn",
44
+ "vitest/valid-expect": "warn",
45
+ "vitest/valid-title": "warn"
46
+ });
4
47
  export {
5
48
  vitestRules
6
49
  };
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/eslint/testing/vitest-rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ntype VitestRules = Record<`vitest/${string}`, EslintRuleConfig>;\n\n/**\n * Creates an object containing the ESLint rules for vitest.\n *\n * @param itOrTest - \"it\" or \"test\"\n * @returns An object containing the ESLint rules for vitest.\n */\nexport const vitestRules = (itOrTest: \"it\" | \"test\" = \"test\"): VitestRules => ({\n \"vitest/consistent-test-it\": [\n \"warn\",\n { fn: itOrTest, withinDescribe: itOrTest },\n ],\n \"vitest/expect-expect\": \"warn\",\n \"vitest/no-commented-out-tests\": \"warn\",\n \"vitest/no-conditional-in-test\": \"warn\",\n \"vitest/no-disabled-tests\": \"warn\",\n \"vitest/no-duplicate-hooks\": \"warn\",\n \"vitest/no-focused-tests\": \"warn\",\n \"vitest/no-identical-title\": \"warn\",\n \"vitest/no-import-node-test\": \"warn\",\n \"vitest/no-interpolation-in-snapshots\": \"warn\", // Avoid dynamic snapshots\n \"vitest/no-large-snapshots\": [\"warn\", { inlineMaxSize: 50, maxSize: 100 }], // Keep snapshots manageable\n \"vitest/no-standalone-expect\": \"warn\",\n \"vitest/no-test-return-statement\": \"warn\", // Tests shouldn't return values\n \"vitest/prefer-comparison-matcher\": \"warn\", // Use comparison matchers\n \"vitest/prefer-equality-matcher\": \"warn\", // Use equality matchers\n \"vitest/prefer-hooks-in-order\": \"warn\", // Keep hooks in a predictable order\n \"vitest/prefer-hooks-on-top\": \"warn\", // Keep hooks organized\n \"vitest/prefer-lowercase-title\": [\"warn\", { ignoreTopLevelDescribe: true }], // Consistent casing\n \"vitest/prefer-strict-equal\": \"warn\", // Prefer .toStrictEqual() over .toEqual()\n \"vitest/prefer-to-be\": \"warn\", // Use .toBe() for primitives\n \"vitest/prefer-to-contain\": \"warn\", // Use .toContain() for array/string includes\n \"vitest/prefer-to-have-length\": \"warn\", // Use .toHaveLength() for checking length\n \"vitest/require-local-test-context-for-concurrent-snapshots\": \"warn\",\n \"vitest/require-top-level-describe\": \"warn\", // Group tests in describe blocks\n \"vitest/valid-describe-callback\": \"warn\",\n \"vitest/valid-expect\": \"warn\",\n \"vitest/valid-title\": \"warn\",\n});\n"],"mappings":";AAUO,IAAM,cAAc,CAAC,WAA0B,YAAyB;AAAA,EAC7E,6BAA6B;AAAA,IAC3B;AAAA,IACA,EAAE,IAAI,UAAU,gBAAgB,SAAS;AAAA,EAC3C;AAAA,EACA,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,iCAAiC;AAAA,EACjC,4BAA4B;AAAA,EAC5B,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,wCAAwC;AAAA;AAAA,EACxC,6BAA6B,CAAC,QAAQ,EAAE,eAAe,IAAI,SAAS,IAAI,CAAC;AAAA;AAAA,EACzE,+BAA+B;AAAA,EAC/B,mCAAmC;AAAA;AAAA,EACnC,oCAAoC;AAAA;AAAA,EACpC,kCAAkC;AAAA;AAAA,EAClC,gCAAgC;AAAA;AAAA,EAChC,8BAA8B;AAAA;AAAA,EAC9B,iCAAiC,CAAC,QAAQ,EAAE,wBAAwB,KAAK,CAAC;AAAA;AAAA,EAC1E,8BAA8B;AAAA;AAAA,EAC9B,uBAAuB;AAAA;AAAA,EACvB,4BAA4B;AAAA;AAAA,EAC5B,gCAAgC;AAAA;AAAA,EAChC,8DAA8D;AAAA,EAC9D,qCAAqC;AAAA;AAAA,EACrC,kCAAkC;AAAA,EAClC,uBAAuB;AAAA,EACvB,sBAAsB;AACxB;","names":[]}
@@ -1,7 +1,38 @@
1
- import {
2
- turboConfig
3
- } from "../../chunk-7FTTMVPP.js";
4
- import "../../chunk-76XASR6Z.js";
1
+ // src/eslint/turbo/config.ts
2
+ import turbo from "eslint-plugin-turbo";
3
+
4
+ // src/eslint/constants.ts
5
+ var configNames = {
6
+ base: "base",
7
+ disableTypeChecked: "typescript-eslint/disable-type-checked",
8
+ ignores: "ignores",
9
+ jsdoc: "jsdoc",
10
+ markdown: "markdown",
11
+ nextjs: "nextjs",
12
+ perfectionist: "perfectionist",
13
+ preferArrowFunction: "prefer-arrow-function",
14
+ react: "react",
15
+ reactCompiler: "react-compiler",
16
+ reactRefresh: "react-refresh",
17
+ storybook: "storybook:stories",
18
+ storybookConfig: "storybook:config",
19
+ testing: "testing",
20
+ turbo: "turbo",
21
+ typescript: "tseslint",
22
+ typescriptTesting: "tseslint-testing",
23
+ unicorn: "unicorn"
24
+ };
25
+
26
+ // src/eslint/turbo/config.ts
27
+ var turboConfig = () => ({
28
+ name: configNames.turbo,
29
+ plugins: {
30
+ turbo
31
+ },
32
+ rules: {
33
+ "turbo/no-undeclared-env-vars": "warn"
34
+ }
35
+ });
5
36
  export {
6
37
  turboConfig
7
38
  };
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/eslint/turbo/config.ts","../../../src/eslint/constants.ts"],"sourcesContent":["import turbo from \"eslint-plugin-turbo\";\n\nimport type { EslintConfigObject } from \"../types.js\";\nimport type { TurboRules } from \"./types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for Turbo.\n *\n * @returns ESLint configuration object for Turbo\n */\nexport const turboConfig = (): EslintConfigObject => ({\n name: configNames.turbo,\n plugins: {\n turbo,\n },\n rules: {\n \"turbo/no-undeclared-env-vars\": \"warn\",\n } satisfies TurboRules,\n});\n","/**\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\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAAA,OAAO,WAAW;;;ACKX,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;;;ADZO,IAAM,cAAc,OAA2B;AAAA,EACpD,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,gCAAgC;AAAA,EAClC;AACF;","names":[]}
@@ -4,7 +4,7 @@ import { ConfigName } from './constants.js';
4
4
  type EslintSeverity = 0 | 1 | 2 | "error" | "off" | "warn";
5
5
  type EslintRuleConfig<TOptions = Record<string, unknown>, TOptions2 = Record<string, unknown>> = [EslintSeverity, string | TOptions | undefined] | [EslintSeverity, string | undefined, TOptions2 | undefined] | [EslintSeverity, TOptions | undefined, TOptions2 | undefined] | [EslintSeverity] | EslintSeverity;
6
6
  type FunctionStyle = "arrow" | "declaration" | "expression";
7
- interface EslintConfigObject extends Linter.Config {
7
+ interface EslintConfigObject<Rules extends Linter.RulesRecord = Linter.RulesRecord> extends Linter.Config<Rules> {
8
8
  name: ConfigName;
9
9
  }
10
10