js-style-kit 0.2.11 → 0.2.12

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 (113) hide show
  1. package/dist/index.d.ts +126 -9
  2. package/package.json +11 -11
  3. package/dist/eslint/base/config.d.ts +0 -17
  4. package/dist/eslint/base/config.js +0 -457
  5. package/dist/eslint/base/config.js.map +0 -1
  6. package/dist/eslint/base/rules.d.ts +0 -18
  7. package/dist/eslint/base/rules.js +0 -425
  8. package/dist/eslint/base/rules.js.map +0 -1
  9. package/dist/eslint/base/types.d.ts +0 -21
  10. package/dist/eslint/base/types.js +0 -1
  11. package/dist/eslint/base/types.js.map +0 -1
  12. package/dist/eslint/constants.d.ts +0 -28
  13. package/dist/eslint/constants.js +0 -25
  14. package/dist/eslint/constants.js.map +0 -1
  15. package/dist/eslint/ignores.d.ts +0 -19
  16. package/dist/eslint/ignores.js +0 -42
  17. package/dist/eslint/ignores.js.map +0 -1
  18. package/dist/eslint/index.d.ts +0 -55
  19. package/dist/eslint/index.js +0 -1410
  20. package/dist/eslint/index.js.map +0 -1
  21. package/dist/eslint/jsdoc/config.d.ts +0 -14
  22. package/dist/eslint/jsdoc/config.js +0 -109
  23. package/dist/eslint/jsdoc/config.js.map +0 -1
  24. package/dist/eslint/jsdoc/rules.d.ts +0 -15
  25. package/dist/eslint/jsdoc/rules.js +0 -73
  26. package/dist/eslint/jsdoc/rules.js.map +0 -1
  27. package/dist/eslint/jsdoc/types.d.ts +0 -52
  28. package/dist/eslint/jsdoc/types.js +0 -1
  29. package/dist/eslint/jsdoc/types.js.map +0 -1
  30. package/dist/eslint/nextjs/config.d.ts +0 -12
  31. package/dist/eslint/nextjs/config.js +0 -62
  32. package/dist/eslint/nextjs/config.js.map +0 -1
  33. package/dist/eslint/nextjs/rules.d.ts +0 -8
  34. package/dist/eslint/nextjs/rules.js +0 -28
  35. package/dist/eslint/nextjs/rules.js.map +0 -1
  36. package/dist/eslint/nextjs/types.d.ts +0 -29
  37. package/dist/eslint/nextjs/types.js +0 -1
  38. package/dist/eslint/nextjs/types.js.map +0 -1
  39. package/dist/eslint/perfectionist/config.d.ts +0 -7
  40. package/dist/eslint/perfectionist/config.js +0 -65
  41. package/dist/eslint/perfectionist/config.js.map +0 -1
  42. package/dist/eslint/perfectionist/rules.d.ts +0 -12
  43. package/dist/eslint/perfectionist/rules.js +0 -31
  44. package/dist/eslint/perfectionist/rules.js.map +0 -1
  45. package/dist/eslint/prefer-arrow-function/config.d.ts +0 -12
  46. package/dist/eslint/prefer-arrow-function/config.js +0 -45
  47. package/dist/eslint/prefer-arrow-function/config.js.map +0 -1
  48. package/dist/eslint/prefer-arrow-function/types.d.ts +0 -17
  49. package/dist/eslint/prefer-arrow-function/types.js +0 -1
  50. package/dist/eslint/prefer-arrow-function/types.js.map +0 -1
  51. package/dist/eslint/react/config.d.ts +0 -18
  52. package/dist/eslint/react/config.js +0 -186
  53. package/dist/eslint/react/config.js.map +0 -1
  54. package/dist/eslint/react/rules.d.ts +0 -26
  55. package/dist/eslint/react/rules.js +0 -132
  56. package/dist/eslint/react/rules.js.map +0 -1
  57. package/dist/eslint/react-compiler/config.d.ts +0 -12
  58. package/dist/eslint/react-compiler/config.js +0 -39
  59. package/dist/eslint/react-compiler/config.js.map +0 -1
  60. package/dist/eslint/react-refresh/config.d.ts +0 -16
  61. package/dist/eslint/react-refresh/config.js +0 -55
  62. package/dist/eslint/react-refresh/config.js.map +0 -1
  63. package/dist/eslint/react-refresh/rules.d.ts +0 -38
  64. package/dist/eslint/react-refresh/rules.js +0 -19
  65. package/dist/eslint/react-refresh/rules.js.map +0 -1
  66. package/dist/eslint/storybook/config.d.ts +0 -13
  67. package/dist/eslint/storybook/config.js +0 -67
  68. package/dist/eslint/storybook/config.js.map +0 -1
  69. package/dist/eslint/testing/config.d.ts +0 -25
  70. package/dist/eslint/testing/config.js +0 -169
  71. package/dist/eslint/testing/config.js.map +0 -1
  72. package/dist/eslint/testing/jest-rules.d.ts +0 -14
  73. package/dist/eslint/testing/jest-rules.js +0 -44
  74. package/dist/eslint/testing/jest-rules.js.map +0 -1
  75. package/dist/eslint/testing/vitest-rules.d.ts +0 -14
  76. package/dist/eslint/testing/vitest-rules.js +0 -50
  77. package/dist/eslint/testing/vitest-rules.js.map +0 -1
  78. package/dist/eslint/turbo/config.d.ts +0 -12
  79. package/dist/eslint/turbo/config.js +0 -39
  80. package/dist/eslint/turbo/config.js.map +0 -1
  81. package/dist/eslint/turbo/types.d.ts +0 -11
  82. package/dist/eslint/turbo/types.js +0 -1
  83. package/dist/eslint/turbo/types.js.map +0 -1
  84. package/dist/eslint/types.d.ts +0 -11
  85. package/dist/eslint/types.js +0 -1
  86. package/dist/eslint/types.js.map +0 -1
  87. package/dist/eslint/typescript/config.d.ts +0 -11
  88. package/dist/eslint/typescript/config.js +0 -186
  89. package/dist/eslint/typescript/config.js.map +0 -1
  90. package/dist/eslint/typescript/rules.d.ts +0 -8
  91. package/dist/eslint/typescript/rules.js +0 -135
  92. package/dist/eslint/typescript/rules.js.map +0 -1
  93. package/dist/eslint/typescript/types.d.ts +0 -7
  94. package/dist/eslint/typescript/types.js +0 -1
  95. package/dist/eslint/typescript/types.js.map +0 -1
  96. package/dist/eslint/unicorn/config.d.ts +0 -11
  97. package/dist/eslint/unicorn/config.js +0 -113
  98. package/dist/eslint/unicorn/config.js.map +0 -1
  99. package/dist/eslint/unicorn/rules.d.ts +0 -8
  100. package/dist/eslint/unicorn/rules.js +0 -79
  101. package/dist/eslint/unicorn/rules.js.map +0 -1
  102. package/dist/modules.d.d.ts +0 -3
  103. package/dist/modules.d.js +0 -1
  104. package/dist/modules.d.js.map +0 -1
  105. package/dist/prettier/index.d.ts +0 -34
  106. package/dist/prettier/index.js +0 -132
  107. package/dist/prettier/index.js.map +0 -1
  108. package/dist/prettier/patch-tailwind-plugin.d.ts +0 -9
  109. package/dist/prettier/patch-tailwind-plugin.js +0 -72
  110. package/dist/prettier/patch-tailwind-plugin.js.map +0 -1
  111. package/dist/utils/is-type.d.ts +0 -44
  112. package/dist/utils/is-type.js +0 -28
  113. package/dist/utils/is-type.js.map +0 -1
@@ -1,132 +0,0 @@
1
- // src/eslint/react/rules.ts
2
- var reactRules = (functionStyle, typescript) => {
3
- const functionStyleMap = {
4
- arrow: "arrow-function",
5
- declaration: "function-declaration",
6
- expression: "function-expression"
7
- };
8
- return {
9
- /**
10
- * Disabled in favor of TypeScript for type checking
11
- */
12
- ...typescript ? {} : { "react/prop-types": "warn" },
13
- "react-hooks/exhaustive-deps": "warn",
14
- "react-hooks/rules-of-hooks": "warn",
15
- /**
16
- * Require an explicit type when using button elements.
17
- *
18
- * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
19
- */
20
- "react/button-has-type": "warn",
21
- "react/destructuring-assignment": ["warn", "always"],
22
- "react/display-name": "warn",
23
- /**
24
- * Require consistent function type for function components.
25
- *
26
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md
27
- */
28
- "react/function-component-definition": functionStyle === "off" ? "off" : [
29
- "warn",
30
- {
31
- namedComponents: functionStyleMap[functionStyle],
32
- unnamedComponents: functionStyle === "arrow" ? "arrow-function" : "function-expression"
33
- }
34
- ],
35
- /**
36
- * Require destructuring and symmetric naming of `useState` hook value and setter variables.
37
- *
38
- * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
39
- */
40
- "react/hook-use-state": "warn",
41
- /**
42
- * Require consistent boolean attributes notation in JSX.
43
- *
44
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
45
- */
46
- "react/jsx-boolean-value": "warn",
47
- /**
48
- * Disallow unnecessary curly braces in JSX props and children.
49
- *
50
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
51
- */
52
- "react/jsx-curly-brace-presence": "warn",
53
- /**
54
- * Require using shorthand form for React fragments, unless required.
55
- *
56
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
57
- */
58
- "react/jsx-fragments": "warn",
59
- "react/jsx-key": "warn",
60
- "react/jsx-no-comment-textnodes": "warn",
61
- "react/jsx-no-duplicate-props": "warn",
62
- /**
63
- * Prevent problematic leaked values from being rendered.
64
- *
65
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
66
- */
67
- "react/jsx-no-leaked-render": "warn",
68
- /**
69
- * Prevents usage of unsafe `target='_blank'`.
70
- *
71
- * This rule is a part of `react/recommended`, but we've modified it to
72
- * allow referrer.
73
- *
74
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
75
- */
76
- "react/jsx-no-target-blank": [
77
- "warn",
78
- {
79
- allowReferrer: true
80
- }
81
- ],
82
- "react/jsx-no-undef": "warn",
83
- /**
84
- * Disallow empty React fragments.
85
- *
86
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
87
- */
88
- "react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
89
- /**
90
- * Require the use of PascalCase for user-defined JSX components.
91
- *
92
- * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
93
- */
94
- "react/jsx-pascal-case": "warn",
95
- "react/jsx-uses-react": "warn",
96
- "react/jsx-uses-vars": "warn",
97
- /**
98
- * Disallow usage of Array index in keys.
99
- *
100
- * � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
101
- */
102
- "react/no-array-index-key": "warn",
103
- "react/no-children-prop": "warn",
104
- "react/no-danger-with-children": "warn",
105
- "react/no-deprecated": "warn",
106
- "react/no-direct-mutation-state": "warn",
107
- "react/no-find-dom-node": "warn",
108
- "react/no-is-mounted": "warn",
109
- "react/no-render-return-value": "warn",
110
- "react/no-string-refs": "warn",
111
- "react/no-unescaped-entities": "warn",
112
- "react/no-unknown-property": "warn",
113
- "react/no-unsafe": "warn",
114
- /**
115
- * Disallow creating unstable components inside components.
116
- *
117
- * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
118
- */
119
- "react/no-unstable-nested-components": "warn",
120
- "react/require-render-return": "warn",
121
- /**
122
- * Disallow closing tags for components without children.
123
- *
124
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
125
- */
126
- "react/self-closing-comp": "warn"
127
- };
128
- };
129
- export {
130
- reactRules
131
- };
132
- //# sourceMappingURL=rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/eslint/react/rules.ts"],"sourcesContent":["import type { EslintRuleConfig, FunctionStyle } from \"../types.js\";\n\ntype ReactFunctionDefinitions =\n | \"arrow-function\"\n | \"function-declaration\"\n | \"function-expression\";\n\ntype ReactRules = Record<\n `${\"react\" | \"react-hooks\"}/${string}`,\n EslintRuleConfig\n> & {\n \"react/destructuring-assignment\"?: EslintRuleConfig<\n \"always\" | \"never\",\n {\n destructureInSignature?: \"always\" | \"ignore\";\n ignoreClassFields?: boolean;\n }\n >;\n \"react/function-component-definition\"?: EslintRuleConfig<{\n namedComponents?: ReactFunctionDefinitions | ReactFunctionDefinitions[];\n unnamedComponents?:\n | \"arrow-function\"\n | \"function-expression\"\n | (\"arrow-function\" | \"function-expression\")[];\n }>;\n};\n\n/**\n * Generates ESLint rules configuration for React and React Hooks.\n * Includes settings for function component style enforcement and TypeScript-specific rules.\n *\n * @param functionStyle - The preferred style for React function components: 'arrow' for arrow functions, 'declaration' for function declarations, 'expression' for function expressions, or 'off' to disable style enforcement\n * @param typescript - Whether TypeScript-specific React rules should be enabled\n * @returns Configuration object containing ESLint rules for React and React Hooks\n */\nexport const reactRules = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n): ReactRules => {\n const functionStyleMap: Record<FunctionStyle, ReactFunctionDefinitions> = {\n arrow: \"arrow-function\",\n declaration: \"function-declaration\",\n expression: \"function-expression\",\n };\n\n return {\n /**\n * Disabled in favor of TypeScript for type checking\n */\n ...(typescript ? {} : { \"react/prop-types\": \"warn\" }),\n \"react-hooks/exhaustive-deps\": \"warn\",\n \"react-hooks/rules-of-hooks\": \"warn\",\n /**\n * Require an explicit type when using button elements.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md\n */\n \"react/button-has-type\": \"warn\",\n \"react/destructuring-assignment\": [\"warn\", \"always\"],\n \"react/display-name\": \"warn\",\n /**\n * Require consistent function type for function components.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md\n */\n \"react/function-component-definition\":\n functionStyle === \"off\" ? \"off\" : (\n [\n \"warn\",\n {\n namedComponents: functionStyleMap[functionStyle],\n unnamedComponents:\n functionStyle === \"arrow\" ? \"arrow-function\" : (\n \"function-expression\"\n ),\n },\n ]\n ),\n /**\n * Require destructuring and symmetric naming of `useState` hook value and setter variables.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md\n */\n \"react/hook-use-state\": \"warn\",\n /**\n * Require consistent boolean attributes notation in JSX.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n */\n \"react/jsx-boolean-value\": \"warn\",\n /**\n * Disallow unnecessary curly braces in JSX props and children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n */\n \"react/jsx-curly-brace-presence\": \"warn\",\n /**\n * Require using shorthand form for React fragments, unless required.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md\n */\n \"react/jsx-fragments\": \"warn\",\n \"react/jsx-key\": \"warn\",\n \"react/jsx-no-comment-textnodes\": \"warn\",\n \"react/jsx-no-duplicate-props\": \"warn\",\n /**\n * Prevent problematic leaked values from being rendered.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md\n */\n \"react/jsx-no-leaked-render\": \"warn\",\n /**\n * Prevents usage of unsafe `target='_blank'`.\n *\n * This rule is a part of `react/recommended`, but we've modified it to\n * allow referrer.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md\n */\n \"react/jsx-no-target-blank\": [\n \"warn\",\n {\n allowReferrer: true,\n },\n ],\n \"react/jsx-no-undef\": \"warn\",\n /**\n * Disallow empty React fragments.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n */\n \"react/jsx-no-useless-fragment\": [\"warn\", { allowExpressions: true }],\n /**\n * Require the use of PascalCase for user-defined JSX components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n */\n \"react/jsx-pascal-case\": \"warn\",\n \"react/jsx-uses-react\": \"warn\",\n \"react/jsx-uses-vars\": \"warn\",\n /**\n * Disallow usage of Array index in keys.\n *\n * � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n */\n \"react/no-array-index-key\": \"warn\",\n \"react/no-children-prop\": \"warn\",\n \"react/no-danger-with-children\": \"warn\",\n \"react/no-deprecated\": \"warn\",\n \"react/no-direct-mutation-state\": \"warn\",\n \"react/no-find-dom-node\": \"warn\",\n \"react/no-is-mounted\": \"warn\",\n \"react/no-render-return-value\": \"warn\",\n \"react/no-string-refs\": \"warn\",\n \"react/no-unescaped-entities\": \"warn\",\n \"react/no-unknown-property\": \"warn\",\n \"react/no-unsafe\": \"warn\",\n /**\n * Disallow creating unstable components inside components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md\n */\n \"react/no-unstable-nested-components\": \"warn\",\n \"react/require-render-return\": \"warn\",\n /**\n * Disallow closing tags for components without children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n */\n \"react/self-closing-comp\": \"warn\",\n };\n};\n"],"mappings":";AAmCO,IAAM,aAAa,CACxB,eACA,eACe;AACf,QAAM,mBAAoE;AAAA,IACxE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,YAAY;AAAA,EACd;AAEA,SAAO;AAAA;AAAA;AAAA;AAAA,IAIL,GAAI,aAAa,CAAC,IAAI,EAAE,oBAAoB,OAAO;AAAA,IACnD,+BAA+B;AAAA,IAC/B,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM9B,yBAAyB;AAAA,IACzB,kCAAkC,CAAC,QAAQ,QAAQ;AAAA,IACnD,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMtB,uCACE,kBAAkB,QAAQ,QACxB;AAAA,MACE;AAAA,MACA;AAAA,QACE,iBAAiB,iBAAiB,aAAa;AAAA,QAC/C,mBACE,kBAAkB,UAAU,mBAC1B;AAAA,MAEN;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOJ,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMxB,2BAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM3B,kCAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlC,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,kCAAkC;AAAA,IAClC,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMhC,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS9B,6BAA6B;AAAA,MAC3B;AAAA,MACA;AAAA,QACE,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMtB,iCAAiC,CAAC,QAAQ,EAAE,kBAAkB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMpE,yBAAyB;AAAA,IACzB,wBAAwB;AAAA,IACxB,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMvB,4BAA4B;AAAA,IAC5B,0BAA0B;AAAA,IAC1B,iCAAiC;AAAA,IACjC,uBAAuB;AAAA,IACvB,kCAAkC;AAAA,IAClC,0BAA0B;AAAA,IAC1B,uBAAuB;AAAA,IACvB,gCAAgC;AAAA,IAChC,wBAAwB;AAAA,IACxB,+BAA+B;AAAA,IAC/B,6BAA6B;AAAA,IAC7B,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnB,uCAAuC;AAAA,IACvC,+BAA+B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B,2BAA2B;AAAA,EAC7B;AACF;","names":[]}
@@ -1,12 +0,0 @@
1
- import { EslintConfigObject } from '../types.js';
2
- import 'eslint';
3
- import '../constants.js';
4
-
5
- /**
6
- * Creates an ESLint configuration for React Compiler.
7
- *
8
- * @returns ESLint configuration object for React Compiler
9
- */
10
- declare const reactCompilerEslintConfig: EslintConfigObject;
11
-
12
- export { reactCompilerEslintConfig };
@@ -1,39 +0,0 @@
1
- // src/eslint/react-compiler/config.ts
2
- import reactCompiler from "eslint-plugin-react-compiler";
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-compiler/config.ts
27
- var reactCompilerEslintConfig = {
28
- name: configNames.reactCompiler,
29
- plugins: {
30
- "react-compiler": reactCompiler
31
- },
32
- rules: {
33
- "react-compiler/react-compiler": "warn"
34
- }
35
- };
36
- export {
37
- reactCompilerEslintConfig
38
- };
39
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/eslint/react-compiler/config.ts","../../../src/eslint/constants.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","/**\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,mBAAmB;;;ACKnB,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;;;ADbO,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,16 +0,0 @@
1
- import { EslintConfigObject } from '../types.js';
2
- import 'eslint';
3
- import '../constants.js';
4
-
5
- /**
6
- * Generates ESLint configuration for React Refresh.
7
- *
8
- * This plugin validates that components can safely be updated with Fast Refresh.
9
- * It enforces that components are structured in a way that integrations like
10
- * react-refresh expect.
11
- *
12
- * @returns An ESLint configuration object for React Refresh.
13
- */
14
- declare const reactRefreshEslintConfig: () => EslintConfigObject;
15
-
16
- export { reactRefreshEslintConfig };
@@ -1,55 +0,0 @@
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
- };
52
- export {
53
- reactRefreshEslintConfig
54
- };
55
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
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,38 +0,0 @@
1
- import { EslintRuleConfig } from '../types.js';
2
- import 'eslint';
3
- import '../constants.js';
4
-
5
- type ReactRefreshRules = Record<string, EslintRuleConfig> & {
6
- "react-refresh/only-export-components"?: EslintRuleConfig<{
7
- /**
8
- * Don't warn when a constant (string, number, boolean, templateLiteral)
9
- * is exported aside one or more components.
10
- */
11
- allowConstantExport?: boolean;
12
- /**
13
- * If you use a framework that handles HMR of some specific exports,
14
- * you can use this option to avoid warning for them.
15
- */
16
- allowExportNames?: string[];
17
- /**
18
- * If you're using JSX inside .js files, you can enable this option.
19
- * To reduce false positives, only files importing 'react' are checked.
20
- */
21
- checkJS?: boolean;
22
- /**
23
- * If you're exporting a component wrapped in a custom HOC,
24
- * you can use this option to avoid false positives.
25
- */
26
- customHOCs?: string[];
27
- }>;
28
- };
29
- /**
30
- * Generates ESLint rules configuration for React Refresh.
31
- *
32
- * This plugin validates that components can safely be updated with Fast Refresh.
33
- *
34
- * @returns Configuration object containing ESLint rules for React Refresh
35
- */
36
- declare const reactRefreshRules: ReactRefreshRules;
37
-
38
- export { type ReactRefreshRules, reactRefreshRules };
@@ -1,19 +0,0 @@
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
- };
16
- export {
17
- reactRefreshRules
18
- };
19
- //# sourceMappingURL=rules.js.map
@@ -1 +0,0 @@
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,13 +0,0 @@
1
- import { EslintConfigObject } from '../types.js';
2
- import 'eslint';
3
- import '../constants.js';
4
-
5
- /**
6
- * ESLint configuration for Storybook.
7
- * Contains rules for best practices when working with Storybook.
8
- *
9
- * @returns Storybook ESLint config
10
- */
11
- declare const storybookConfig: EslintConfigObject[];
12
-
13
- export { storybookConfig };
@@ -1,67 +0,0 @@
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
- ];
64
- export {
65
- storybookConfig
66
- };
67
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
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,25 +0,0 @@
1
- import { EslintConfigObject } from '../types.js';
2
- import 'eslint';
3
- import '../constants.js';
4
-
5
- interface TestingConfig {
6
- filenamePattern?: "spec" | "test";
7
- files?: string[];
8
- formattingRules?: boolean;
9
- framework?: "bun" | "jest" | "node" | "vitest";
10
- itOrTest?: "it" | "test";
11
- }
12
- /**
13
- * Creates an ESLint configuration object for testing.
14
- *
15
- * @param options - Configuration options
16
- * @param options.files - Files to include in the configuration
17
- * @param options.filenamePattern - ".test" or ".spec" filename pattern
18
- * @param options.itOrTest - "it" or "test"
19
- * @param options.framework - "jest" or "vitest"
20
- * @param options.formattingRules - Whether to include formatting rules like padding around blocks
21
- * @returns ESLint configuration object
22
- */
23
- declare const testingConfig: ({ filenamePattern, files, formattingRules, framework, itOrTest, }?: TestingConfig) => EslintConfigObject;
24
-
25
- export { type TestingConfig, testingConfig };
@@ -1,169 +0,0 @@
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
- });
166
- export {
167
- testingConfig
168
- };
169
- //# sourceMappingURL=config.js.map