js-style-kit 0.2.9 → 0.2.10

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,133 +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
-
130
- export {
131
- reactRules
132
- };
133
- //# sourceMappingURL=chunk-26SVGV32.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,21 +0,0 @@
1
- import {
2
- baseEslintRules
3
- } from "./chunk-XICOWKSV.js";
4
- import {
5
- configNames
6
- } from "./chunk-76XASR6Z.js";
7
-
8
- // src/eslint/base/config.ts
9
- var baseEslintConfig = (functionStyle) => ({
10
- languageOptions: {
11
- ecmaVersion: 2022
12
- },
13
- linterOptions: { reportUnusedDisableDirectives: true },
14
- name: configNames.base,
15
- rules: baseEslintRules(functionStyle)
16
- });
17
-
18
- export {
19
- baseEslintConfig
20
- };
21
- //# sourceMappingURL=chunk-2PDDRRZG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/base/config.ts"],"sourcesContent":["import type { EslintConfigObject, FunctionStyle } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { baseEslintRules } from \"./rules.js\";\n\n/**\n * Creates a base ESLint configuration object with specified function style rules.\n *\n * @param functionStyle - Controls how functions should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @returns ESLint configuration object\n */\nexport const baseEslintConfig = (\n functionStyle: \"off\" | FunctionStyle,\n): EslintConfigObject => ({\n languageOptions: {\n ecmaVersion: 2022,\n },\n linterOptions: { reportUnusedDisableDirectives: true },\n name: configNames.base,\n rules: baseEslintRules(functionStyle),\n});\n"],"mappings":";;;;;;;;AAeO,IAAM,mBAAmB,CAC9B,mBACwB;AAAA,EACxB,iBAAiB;AAAA,IACf,aAAa;AAAA,EACf;AAAA,EACA,eAAe,EAAE,+BAA+B,KAAK;AAAA,EACrD,MAAM,YAAY;AAAA,EAClB,OAAO,gBAAgB,aAAa;AACtC;","names":[]}
@@ -1,32 +0,0 @@
1
- // src/eslint/perfectionist/rules.ts
2
- var defaultOptions = {
3
- order: "asc",
4
- type: "natural"
5
- };
6
- var perfectionistRules = {
7
- "perfectionist/sort-array-includes": ["warn", defaultOptions],
8
- "perfectionist/sort-classes": ["warn", defaultOptions],
9
- "perfectionist/sort-decorators": ["warn", defaultOptions],
10
- "perfectionist/sort-enums": ["warn", defaultOptions],
11
- "perfectionist/sort-exports": ["warn", defaultOptions],
12
- "perfectionist/sort-heritage-clauses": ["warn", defaultOptions],
13
- "perfectionist/sort-imports": ["warn", defaultOptions],
14
- "perfectionist/sort-interfaces": ["warn", defaultOptions],
15
- "perfectionist/sort-intersection-types": ["warn", defaultOptions],
16
- "perfectionist/sort-jsx-props": ["warn", defaultOptions],
17
- "perfectionist/sort-maps": ["warn", defaultOptions],
18
- "perfectionist/sort-modules": ["off", defaultOptions],
19
- "perfectionist/sort-named-exports": ["warn", defaultOptions],
20
- "perfectionist/sort-named-imports": ["warn", defaultOptions],
21
- "perfectionist/sort-object-types": ["warn", defaultOptions],
22
- "perfectionist/sort-objects": ["warn", defaultOptions],
23
- "perfectionist/sort-sets": ["warn", defaultOptions],
24
- "perfectionist/sort-switch-case": ["warn", defaultOptions],
25
- "perfectionist/sort-union-types": ["warn", defaultOptions],
26
- "perfectionist/sort-variable-declarations": ["warn", defaultOptions]
27
- };
28
-
29
- export {
30
- perfectionistRules
31
- };
32
- //# sourceMappingURL=chunk-3SHRYTUT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/perfectionist/rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ninterface PerfectionistRuleOptions {\n order: \"asc\" | \"desc\";\n type: \"alphabetical\" | \"custom\" | \"line-length\" | \"natural\";\n}\n\nconst defaultOptions: PerfectionistRuleOptions = {\n order: \"asc\",\n type: \"natural\",\n};\n\ntype PerfectionRules = Record<\n `perfectionist/${string}`,\n EslintRuleConfig<PerfectionistRuleOptions>\n>;\n\nexport const perfectionistRules: PerfectionRules = {\n \"perfectionist/sort-array-includes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-classes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-decorators\": [\"warn\", defaultOptions],\n \"perfectionist/sort-enums\": [\"warn\", defaultOptions],\n \"perfectionist/sort-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-heritage-clauses\": [\"warn\", defaultOptions],\n \"perfectionist/sort-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-interfaces\": [\"warn\", defaultOptions],\n \"perfectionist/sort-intersection-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-jsx-props\": [\"warn\", defaultOptions],\n \"perfectionist/sort-maps\": [\"warn\", defaultOptions],\n \"perfectionist/sort-modules\": [\"off\", defaultOptions],\n \"perfectionist/sort-named-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-named-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-object-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-objects\": [\"warn\", defaultOptions],\n \"perfectionist/sort-sets\": [\"warn\", defaultOptions],\n \"perfectionist/sort-switch-case\": [\"warn\", defaultOptions],\n \"perfectionist/sort-union-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-variable-declarations\": [\"warn\", defaultOptions],\n};\n"],"mappings":";AAOA,IAAM,iBAA2C;AAAA,EAC/C,OAAO;AAAA,EACP,MAAM;AACR;AAOO,IAAM,qBAAsC;AAAA,EACjD,qCAAqC,CAAC,QAAQ,cAAc;AAAA,EAC5D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,4BAA4B,CAAC,QAAQ,cAAc;AAAA,EACnD,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,uCAAuC,CAAC,QAAQ,cAAc;AAAA,EAC9D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,yCAAyC,CAAC,QAAQ,cAAc;AAAA,EAChE,gCAAgC,CAAC,QAAQ,cAAc;AAAA,EACvD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,8BAA8B,CAAC,OAAO,cAAc;AAAA,EACpD,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,mCAAmC,CAAC,QAAQ,cAAc;AAAA,EAC1D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,4CAA4C,CAAC,QAAQ,cAAc;AACrE;","names":[]}
@@ -1,20 +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
-
17
- export {
18
- reactRefreshRules
19
- };
20
- //# sourceMappingURL=chunk-6L7EDNAG.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,25 +0,0 @@
1
- // src/eslint/constants.ts
2
- var configNames = {
3
- base: "base-config",
4
- disableTypeChecked: "typescript-eslint/disable-type-checked",
5
- ignores: "ignores-config",
6
- jsdoc: "jsdoc-config",
7
- markdown: "markdown-config",
8
- perfectionist: "perfectionist-config",
9
- preferArrowFunction: "prefer-arrow-function-config",
10
- react: "react-config",
11
- reactCompiler: "react-compiler-config",
12
- reactRefresh: "react-refresh-config",
13
- storybook: "storybook:stories",
14
- storybookConfig: "storybook:config",
15
- testing: "testing-config",
16
- turbo: "turbo-config",
17
- typescript: "tseslint-config",
18
- typescriptTesting: "tseslint-testing-config",
19
- unicorn: "unicorn-config"
20
- };
21
-
22
- export {
23
- configNames
24
- };
25
- //# sourceMappingURL=chunk-76XASR6Z.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/constants.ts"],"sourcesContent":["/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base-config\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores-config\",\n jsdoc: \"jsdoc-config\",\n markdown: \"markdown-config\",\n perfectionist: \"perfectionist-config\",\n preferArrowFunction: \"prefer-arrow-function-config\",\n react: \"react-config\",\n reactCompiler: \"react-compiler-config\",\n reactRefresh: \"react-refresh-config\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing-config\",\n turbo: \"turbo-config\",\n typescript: \"tseslint-config\",\n typescriptTesting: \"tseslint-testing-config\",\n unicorn: \"unicorn-config\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAKO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;","names":[]}
@@ -1,20 +0,0 @@
1
- import {
2
- configNames
3
- } from "./chunk-76XASR6Z.js";
4
-
5
- // src/eslint/turbo/config.ts
6
- import turbo from "eslint-plugin-turbo";
7
- var turboConfig = () => ({
8
- name: configNames.turbo,
9
- plugins: {
10
- turbo
11
- },
12
- rules: {
13
- "turbo/no-undeclared-env-vars": "warn"
14
- }
15
- });
16
-
17
- export {
18
- turboConfig
19
- };
20
- //# sourceMappingURL=chunk-7FTTMVPP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/turbo/config.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"],"mappings":";;;;;AAAA,OAAO,WAAW;AAYX,IAAM,cAAc,OAA2B;AAAA,EACpD,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,gCAAgC;AAAA,EAClC;AACF;","names":[]}
@@ -1,64 +0,0 @@
1
- import {
2
- isObject,
3
- isString
4
- } from "./chunk-PSSB4TGO.js";
5
- import {
6
- patchTailwindPlugin
7
- } from "./chunk-ZED5DLW7.js";
8
-
9
- // src/prettier/index.ts
10
- var prettierConfig = (options = {}) => {
11
- const {
12
- cssOrderPlugin = true,
13
- curlyPlugin = true,
14
- jsonSortPlugin = true,
15
- packageJsonPlugin = true,
16
- tailwindPlugin = false,
17
- ...rest
18
- } = options;
19
- const plugins = [];
20
- const config = {
21
- experimentalTernaries: true,
22
- ...rest
23
- };
24
- if (cssOrderPlugin) {
25
- plugins.push("prettier-plugin-css-order");
26
- }
27
- if (curlyPlugin) {
28
- plugins.push("prettier-plugin-curly");
29
- }
30
- if (jsonSortPlugin) {
31
- plugins.push("prettier-plugin-sort-json");
32
- if (isObject(jsonSortPlugin)) {
33
- Object.assign(config, jsonSortPlugin);
34
- } else {
35
- config.jsonRecursiveSort = true;
36
- }
37
- }
38
- if (packageJsonPlugin) {
39
- plugins.push("prettier-plugin-packagejson");
40
- }
41
- if (tailwindPlugin) {
42
- plugins.push("prettier-plugin-tailwindcss");
43
- const defaultTailwindFunctions = ["clsx", "cva", "cn"];
44
- if (isString(tailwindPlugin)) {
45
- config.tailwindStylesheet = tailwindPlugin;
46
- config.tailwindFunctions = defaultTailwindFunctions;
47
- } else if (isObject(tailwindPlugin)) {
48
- Object.assign(config, tailwindPlugin);
49
- if (!tailwindPlugin.tailwindFunctions) {
50
- config.tailwindFunctions = defaultTailwindFunctions;
51
- }
52
- } else {
53
- config.tailwindFunctions = defaultTailwindFunctions;
54
- }
55
- patchTailwindPlugin();
56
- }
57
- config.plugins = plugins;
58
- return config;
59
- };
60
-
61
- export {
62
- prettierConfig
63
- };
64
- //# sourceMappingURL=chunk-7OLD3L3V.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/prettier/index.ts"],"sourcesContent":["import type { Config as PrettierConfig } from \"prettier\";\nimport type { SortJsonOptions as SortJsonPluginOptions } from \"prettier-plugin-sort-json\";\nimport type { PluginOptions as TailwindPluginOptions } from \"prettier-plugin-tailwindcss\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { patchTailwindPlugin } from \"./patch-tailwind-plugin.js\";\n\nexport interface PrettierConfigOptions extends PrettierConfig {\n cssOrderPlugin?: boolean;\n curlyPlugin?: boolean;\n jsonSortPlugin?: boolean | SortJsonPluginOptions;\n packageJsonPlugin?: boolean;\n tailwindPlugin?: boolean | string | TailwindPluginOptions;\n}\n\nexport interface PrettierConfigWithPlugins\n extends PrettierConfig,\n SortJsonPluginOptions,\n TailwindPluginOptions {}\n\n/**\n * Creates a Prettier configuration object with optional Tailwind support\n *\n * @param options - Configuration options for Prettier\n * @param options.cssOrderPlugin CSS order sorting support\n * @param options.curlyPlugin Enforce curly braces for all control statements\n * @param options.jsonSortPlugin JSON sorting support\n * @param options.packageJsonPlugin Package.json sorting support\n * @param options.tailwindPlugin Tailwind CSS formatting support\n * @returns Prettier configuration object with:\n * - Default Prettier configuration\n * - Experimental ternaries enabled\n * - CSS order plugin\n * - Curly braces plugin\n * - JSON sorting plugin\n * - Package.json sorting plugin\n * - Optional Tailwind plugin and functions\n */\nexport const prettierConfig = (\n options: PrettierConfigOptions = {},\n): PrettierConfigWithPlugins => {\n const {\n cssOrderPlugin = true,\n curlyPlugin = true,\n jsonSortPlugin = true,\n packageJsonPlugin = true,\n tailwindPlugin = false,\n ...rest\n } = options;\n\n const plugins: string[] = [];\n const config: PrettierConfigWithPlugins = {\n experimentalTernaries: true,\n ...rest,\n };\n\n if (cssOrderPlugin) {\n plugins.push(\"prettier-plugin-css-order\");\n }\n\n if (curlyPlugin) {\n plugins.push(\"prettier-plugin-curly\");\n }\n\n if (jsonSortPlugin) {\n plugins.push(\"prettier-plugin-sort-json\");\n\n if (isObject(jsonSortPlugin)) {\n Object.assign(config, jsonSortPlugin);\n } else {\n config.jsonRecursiveSort = true;\n }\n }\n\n if (packageJsonPlugin) {\n plugins.push(\"prettier-plugin-packagejson\");\n }\n\n if (tailwindPlugin) {\n plugins.push(\"prettier-plugin-tailwindcss\");\n const defaultTailwindFunctions = [\"clsx\", \"cva\", \"cn\"];\n\n if (isString(tailwindPlugin)) {\n // then it's the path to the stylesheet\n config.tailwindStylesheet = tailwindPlugin;\n config.tailwindFunctions = defaultTailwindFunctions;\n } else if (isObject(tailwindPlugin)) {\n Object.assign(config, tailwindPlugin);\n\n // Ensure defaultTailwindFunctions is applied if tailwindFunctions wasn't specified\n if (!tailwindPlugin.tailwindFunctions) {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n } else {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n\n // Patch the Tailwind plugin declaration file to remove unsafe declare statement\n patchTailwindPlugin();\n }\n\n // Set plugins after all configurations are done\n config.plugins = plugins;\n\n return config;\n};\n"],"mappings":";;;;;;;;;AAsCO,IAAM,iBAAiB,CAC5B,UAAiC,CAAC,MACJ;AAC9B,QAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,IACjB,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,UAAoB,CAAC;AAC3B,QAAM,SAAoC;AAAA,IACxC,uBAAuB;AAAA,IACvB,GAAG;AAAA,EACL;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,2BAA2B;AAAA,EAC1C;AAEA,MAAI,aAAa;AACf,YAAQ,KAAK,uBAAuB;AAAA,EACtC;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,2BAA2B;AAExC,QAAI,SAAS,cAAc,GAAG;AAC5B,aAAO,OAAO,QAAQ,cAAc;AAAA,IACtC,OAAO;AACL,aAAO,oBAAoB;AAAA,IAC7B;AAAA,EACF;AAEA,MAAI,mBAAmB;AACrB,YAAQ,KAAK,6BAA6B;AAAA,EAC5C;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,6BAA6B;AAC1C,UAAM,2BAA2B,CAAC,QAAQ,OAAO,IAAI;AAErD,QAAI,SAAS,cAAc,GAAG;AAE5B,aAAO,qBAAqB;AAC5B,aAAO,oBAAoB;AAAA,IAC7B,WAAW,SAAS,cAAc,GAAG;AACnC,aAAO,OAAO,QAAQ,cAAc;AAGpC,UAAI,CAAC,eAAe,mBAAmB;AACrC,eAAO,oBAAoB;AAAA,MAC7B;AAAA,IACF,OAAO;AACL,aAAO,oBAAoB;AAAA,IAC7B;AAGA,wBAAoB;AAAA,EACtB;AAGA,SAAO,UAAU;AAEjB,SAAO;AACT;","names":[]}
@@ -1,141 +0,0 @@
1
- import {
2
- unicornConfig
3
- } from "./chunk-XBITZIAZ.js";
4
- import {
5
- storybookConfig
6
- } from "./chunk-N7AG2EKX.js";
7
- import {
8
- testingConfig
9
- } from "./chunk-UHCQX54J.js";
10
- import {
11
- turboConfig
12
- } from "./chunk-7FTTMVPP.js";
13
- import {
14
- tseslintConfig
15
- } from "./chunk-CNYUGKH5.js";
16
- import {
17
- preferArrowFunctionConfig
18
- } from "./chunk-YFJ363HR.js";
19
- import {
20
- reactEslintConfig
21
- } from "./chunk-X7JRY6MS.js";
22
- import {
23
- reactCompilerEslintConfig
24
- } from "./chunk-A6AJGHPQ.js";
25
- import {
26
- reactRefreshEslintConfig
27
- } from "./chunk-U7AFEGMK.js";
28
- import {
29
- baseEslintConfig
30
- } from "./chunk-2PDDRRZG.js";
31
- import {
32
- jsdocConfig
33
- } from "./chunk-HLIJN23S.js";
34
- import {
35
- perfectionistConfig
36
- } from "./chunk-SWT2QOL3.js";
37
- import {
38
- ignoresConfig
39
- } from "./chunk-HMC2O35U.js";
40
- import {
41
- isObject,
42
- isString
43
- } from "./chunk-PSSB4TGO.js";
44
-
45
- // src/eslint/index.ts
46
- var eslintConfig = ({
47
- functionStyle = "arrow",
48
- ignores = [],
49
- jsdoc = { requireJsdoc: false },
50
- react = false,
51
- sorting = true,
52
- storybook = false,
53
- testing,
54
- /**
55
- * Some preceding documentation...
56
- *
57
- * @param options.turbo - Whether to include Turborepo rules. Defaults to false.
58
- *
59
- * Some following documentation...
60
- */
61
- turbo = false,
62
- typescript = true,
63
- unicorn = true
64
- } = {}, ...additionalConfigs) => {
65
- const configs = [
66
- ignoresConfig({
67
- next: isObject(react) && react.next,
68
- storybook,
69
- userIgnores: ignores
70
- }),
71
- baseEslintConfig(functionStyle)
72
- ];
73
- if (jsdoc !== false) {
74
- configs.push(jsdocConfig(jsdoc.requireJsdoc ?? false));
75
- }
76
- if (typescript) {
77
- configs.push(
78
- ...tseslintConfig(
79
- isString(typescript) ? typescript : void 0
80
- )
81
- );
82
- }
83
- if (react) {
84
- configs.push(reactEslintConfig(functionStyle, Boolean(typescript)));
85
- const shouldUseReactCompiler = react === true || isObject(react) && react.reactCompiler !== false;
86
- if (shouldUseReactCompiler) {
87
- configs.push(reactCompilerEslintConfig);
88
- }
89
- const shouldUseReactRefresh = isObject(react) && react.reactRefresh === true;
90
- if (shouldUseReactRefresh) {
91
- configs.push(reactRefreshEslintConfig());
92
- }
93
- }
94
- if (testing !== false) {
95
- const defaultTestingConfig = {
96
- filenamePattern: "test",
97
- files: ["**/*.{test,spec}.{ts,tsx,js,jsx}"],
98
- formattingRules: true,
99
- framework: "vitest",
100
- itOrTest: "it"
101
- };
102
- const mergedTestingConfig = {
103
- ...defaultTestingConfig,
104
- ...isObject(testing) ? testing : {}
105
- };
106
- const { filenamePattern, files, formattingRules, framework, itOrTest } = mergedTestingConfig;
107
- configs.push(
108
- testingConfig({
109
- filenamePattern,
110
- files,
111
- formattingRules,
112
- framework,
113
- itOrTest
114
- })
115
- );
116
- }
117
- if (sorting) {
118
- configs.push(perfectionistConfig);
119
- }
120
- if (unicorn) {
121
- configs.push(unicornConfig);
122
- }
123
- if (functionStyle === "arrow") {
124
- configs.push(preferArrowFunctionConfig());
125
- }
126
- if (storybook) {
127
- configs.push(...storybookConfig);
128
- }
129
- if (turbo) {
130
- configs.push(turboConfig());
131
- }
132
- if (additionalConfigs.length > 0) {
133
- configs.push(...additionalConfigs);
134
- }
135
- return configs;
136
- };
137
-
138
- export {
139
- eslintConfig
140
- };
141
- //# sourceMappingURL=chunk-7ZDM3TOO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/index.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport type { FunctionStyle } from \"./types.js\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { baseEslintConfig } from \"./base/config.js\";\nimport { ignoresConfig } from \"./ignores.js\";\nimport { jsdocConfig } from \"./jsdoc/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { preferArrowFunctionConfig } from \"./prefer-arrow-function/config.js\";\nimport { reactCompilerEslintConfig } from \"./react-compiler/config.js\";\nimport { reactRefreshEslintConfig } from \"./react-refresh/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { storybookConfig } from \"./storybook/config.js\";\nimport { testingConfig, type TestingConfig } from \"./testing/config.js\";\nimport { turboConfig } from \"./turbo/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\nimport { unicornConfig } from \"./unicorn/config.js\";\n\nexport interface EslintConfigOptions {\n functionStyle?: \"off\" | FunctionStyle;\n ignores?: string[];\n jsdoc?:\n | false\n | {\n requireJsdoc?: boolean;\n };\n react?:\n | boolean\n | {\n next?: boolean | undefined;\n reactCompiler?: boolean | undefined;\n reactRefresh?: boolean | undefined;\n };\n sorting?: boolean;\n storybook?: boolean;\n testing?: false | TestingConfig;\n turbo?: boolean;\n typescript?: boolean | string;\n unicorn?: boolean;\n}\n\n/**\n * Configures ESLint based on provided options.\n *\n * @param options - The optional configuration object.\n * @param options.functionStyle - The function style to enforce. Defaults to \"arrow\".\n * @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `dist`.\n * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.\n * @param options.react - Whether to include React rules. When true, reactCompiler is enabled by default.\n * Can be configured with an object to control next.js support and reactCompiler.\n * Also controls reactRefresh, which is enabled by default when react is true.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.storybook - Whether to include Storybook rules. Defaults to false.\n * @param options.testing - An object with the following properties:\n * - `filenamePattern`: One of \"spec\" or \"test\" to determine which filename pattern to use.\n * - `files`: Array of file patterns to include in the configuration.\n * - `framework`: One of \"vitest\" or \"jest\" to determine which testing library to use.\n * - `formattingRules`: Whether to include formatting rules like padding around blocks.\n * - `itOrTest`: One of \"it\" or \"test\" to determine which test function to use.\n * @param options.typescript - Whether to include TypeScript rules. Can be a boolean or a string with path to tsconfig.\n * @param options.turbo - Whether to include Turborepo rules. Defaults to false.\n * @param options.unicorn - Whether to include Unicorn rules. Defaults to true.\n * @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.\n * @returns An array of ESLint configuration objects.\n */\nexport const eslintConfig = (\n {\n functionStyle = \"arrow\",\n ignores = [],\n jsdoc = { requireJsdoc: false },\n react = false,\n sorting = true,\n storybook = false,\n testing,\n /**\n * Some preceding documentation...\n *\n * @param options.turbo - Whether to include Turborepo rules. Defaults to false.\n *\n * Some following documentation...\n */\n turbo = false,\n typescript = true,\n unicorn = true,\n }: EslintConfigOptions = {},\n ...additionalConfigs: Linter.Config[]\n): Linter.Config[] => {\n const configs: Linter.Config[] = [\n ignoresConfig({\n next: isObject(react) && react.next,\n storybook,\n userIgnores: ignores,\n }),\n baseEslintConfig(functionStyle),\n ];\n\n if (jsdoc !== false) {\n configs.push(jsdocConfig(jsdoc.requireJsdoc ?? false));\n }\n\n if (typescript) {\n configs.push(\n ...(tseslintConfig(\n isString(typescript) ? typescript : undefined,\n ) as Linter.Config[]),\n );\n }\n\n if (react) {\n configs.push(reactEslintConfig(functionStyle, Boolean(typescript)));\n\n // Apply reactCompiler by default if react is true or if react.reactCompiler isn't explicitly false\n const shouldUseReactCompiler =\n react === true || (isObject(react) && react.reactCompiler !== false);\n\n if (shouldUseReactCompiler) {\n configs.push(reactCompilerEslintConfig);\n }\n\n // Apply reactRefresh only if explicitly enabled via react.reactRefresh = true\n const shouldUseReactRefresh =\n isObject(react) && react.reactRefresh === true;\n\n if (shouldUseReactRefresh) {\n configs.push(reactRefreshEslintConfig());\n }\n }\n\n if (testing !== false) {\n const defaultTestingConfig: TestingConfig = {\n filenamePattern: \"test\",\n files: [\"**/*.{test,spec}.{ts,tsx,js,jsx}\"],\n formattingRules: true,\n framework: \"vitest\",\n itOrTest: \"it\",\n };\n\n // Merge the user's testing config with defaults\n const mergedTestingConfig: TestingConfig = {\n ...defaultTestingConfig,\n ...(isObject(testing) ? testing : {}),\n };\n\n // Destructure from the merged config\n const { filenamePattern, files, formattingRules, framework, itOrTest } =\n mergedTestingConfig;\n\n configs.push(\n testingConfig({\n filenamePattern,\n files,\n formattingRules,\n framework,\n itOrTest,\n }),\n );\n }\n\n if (sorting) {\n configs.push(perfectionistConfig);\n }\n\n if (unicorn) {\n configs.push(unicornConfig);\n }\n\n if (functionStyle === \"arrow\") {\n configs.push(preferArrowFunctionConfig());\n }\n\n if (storybook) {\n configs.push(...storybookConfig);\n }\n\n if (turbo) {\n configs.push(turboConfig());\n }\n\n // Add any additional config objects provided by the user\n if (additionalConfigs.length > 0) {\n configs.push(...additionalConfigs);\n }\n\n return configs;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEO,IAAM,eAAe,CAC1B;AAAA,EACE,gBAAgB;AAAA,EAChB,UAAU,CAAC;AAAA,EACX,QAAQ,EAAE,cAAc,MAAM;AAAA,EAC9B,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AACZ,IAAyB,CAAC,MACvB,sBACiB;AACpB,QAAM,UAA2B;AAAA,IAC/B,cAAc;AAAA,MACZ,MAAM,SAAS,KAAK,KAAK,MAAM;AAAA,MAC/B;AAAA,MACA,aAAa;AAAA,IACf,CAAC;AAAA,IACD,iBAAiB,aAAa;AAAA,EAChC;AAEA,MAAI,UAAU,OAAO;AACnB,YAAQ,KAAK,YAAY,MAAM,gBAAgB,KAAK,CAAC;AAAA,EACvD;AAEA,MAAI,YAAY;AACd,YAAQ;AAAA,MACN,GAAI;AAAA,QACF,SAAS,UAAU,IAAI,aAAa;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,kBAAkB,eAAe,QAAQ,UAAU,CAAC,CAAC;AAGlE,UAAM,yBACJ,UAAU,QAAS,SAAS,KAAK,KAAK,MAAM,kBAAkB;AAEhE,QAAI,wBAAwB;AAC1B,cAAQ,KAAK,yBAAyB;AAAA,IACxC;AAGA,UAAM,wBACJ,SAAS,KAAK,KAAK,MAAM,iBAAiB;AAE5C,QAAI,uBAAuB;AACzB,cAAQ,KAAK,yBAAyB,CAAC;AAAA,IACzC;AAAA,EACF;AAEA,MAAI,YAAY,OAAO;AACrB,UAAM,uBAAsC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,OAAO,CAAC,kCAAkC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,WAAW;AAAA,MACX,UAAU;AAAA,IACZ;AAGA,UAAM,sBAAqC;AAAA,MACzC,GAAG;AAAA,MACH,GAAI,SAAS,OAAO,IAAI,UAAU,CAAC;AAAA,IACrC;AAGA,UAAM,EAAE,iBAAiB,OAAO,iBAAiB,WAAW,SAAS,IACnE;AAEF,YAAQ;AAAA,MACN,cAAc;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,mBAAmB;AAAA,EAClC;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,aAAa;AAAA,EAC5B;AAEA,MAAI,kBAAkB,SAAS;AAC7B,YAAQ,KAAK,0BAA0B,CAAC;AAAA,EAC1C;AAEA,MAAI,WAAW;AACb,YAAQ,KAAK,GAAG,eAAe;AAAA,EACjC;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,YAAY,CAAC;AAAA,EAC5B;AAGA,MAAI,kBAAkB,SAAS,GAAG;AAChC,YAAQ,KAAK,GAAG,iBAAiB;AAAA,EACnC;AAEA,SAAO;AACT;","names":[]}
@@ -1,20 +0,0 @@
1
- import {
2
- configNames
3
- } from "./chunk-76XASR6Z.js";
4
-
5
- // src/eslint/react-compiler/config.ts
6
- import reactCompiler from "eslint-plugin-react-compiler";
7
- var reactCompilerEslintConfig = {
8
- name: configNames.reactCompiler,
9
- plugins: {
10
- "react-compiler": reactCompiler
11
- },
12
- rules: {
13
- "react-compiler/react-compiler": "warn"
14
- }
15
- };
16
-
17
- export {
18
- reactCompilerEslintConfig
19
- };
20
- //# sourceMappingURL=chunk-A6AJGHPQ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/react-compiler/config.ts"],"sourcesContent":["import reactCompiler from \"eslint-plugin-react-compiler\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for React Compiler.\n *\n * @returns ESLint configuration object for React Compiler\n */\nexport const reactCompilerEslintConfig: EslintConfigObject = {\n name: configNames.reactCompiler,\n plugins: {\n \"react-compiler\": reactCompiler,\n },\n rules: {\n \"react-compiler/react-compiler\": \"warn\",\n },\n};\n"],"mappings":";;;;;AAAA,OAAO,mBAAmB;AAWnB,IAAM,4BAAgD;AAAA,EAC3D,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP,kBAAkB;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,IACL,iCAAiC;AAAA,EACnC;AACF;","names":[]}
@@ -1,38 +0,0 @@
1
- import {
2
- tseslintRules
3
- } from "./chunk-LITSWCYQ.js";
4
- import {
5
- configNames
6
- } from "./chunk-76XASR6Z.js";
7
-
8
- // src/eslint/typescript/config.ts
9
- import tseslint from "typescript-eslint";
10
- var tseslintConfig = (tsconfigPath) => {
11
- const userCwd = process.cwd();
12
- return tseslint.config(
13
- {
14
- files: ["**/*.{js,cjs,mjs,ts,jsx,tsx}"],
15
- languageOptions: {
16
- parser: tseslint.parser,
17
- parserOptions: {
18
- ...tsconfigPath ? { project: tsconfigPath, tsconfigRootDir: userCwd } : { projectService: true, tsconfigRootDir: import.meta.dirname }
19
- }
20
- },
21
- name: configNames.typescript,
22
- plugins: {
23
- "@typescript-eslint": tseslint.plugin
24
- },
25
- rules: tseslintRules
26
- },
27
- {
28
- // disable type-aware linting on JS files
29
- extends: [tseslint.configs.disableTypeChecked],
30
- files: ["**/*.js"]
31
- }
32
- );
33
- };
34
-
35
- export {
36
- tseslintConfig
37
- };
38
- //# sourceMappingURL=chunk-CNYUGKH5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/typescript/config.ts"],"sourcesContent":["import tseslint, { type Config } from \"typescript-eslint\";\n\nimport { configNames } from \"../constants.js\";\nimport { tseslintRules } from \"./rules.js\";\n\n/**\n * Creates a TypeScript ESLint configuration object.\n *\n * @param tsconfigPath - Path to the TypeScript configuration file\n * @returns TypeScript ESLint configuration object\n */\nexport const tseslintConfig = (tsconfigPath?: string): Config => {\n const userCwd = process.cwd();\n\n return tseslint.config(\n {\n files: [\"**/*.{js,cjs,mjs,ts,jsx,tsx}\"],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n ...(tsconfigPath ?\n { project: tsconfigPath, tsconfigRootDir: userCwd }\n : { projectService: true, tsconfigRootDir: import.meta.dirname }),\n },\n },\n name: configNames.typescript,\n plugins: {\n \"@typescript-eslint\": tseslint.plugin,\n },\n rules: tseslintRules,\n },\n {\n // disable type-aware linting on JS files\n extends: [tseslint.configs.disableTypeChecked],\n files: [\"**/*.js\"],\n },\n );\n};\n"],"mappings":";;;;;;;;AAAA,OAAO,cAA+B;AAW/B,IAAM,iBAAiB,CAAC,iBAAkC;AAC/D,QAAM,UAAU,QAAQ,IAAI;AAE5B,SAAO,SAAS;AAAA,IACd;AAAA,MACE,OAAO,CAAC,8BAA8B;AAAA,MACtC,iBAAiB;AAAA,QACf,QAAQ,SAAS;AAAA,QACjB,eAAe;AAAA,UACb,GAAI,eACF,EAAE,SAAS,cAAc,iBAAiB,QAAQ,IAClD,EAAE,gBAAgB,MAAM,iBAAiB,YAAY,QAAQ;AAAA,QACjE;AAAA,MACF;AAAA,MACA,MAAM,YAAY;AAAA,MAClB,SAAS;AAAA,QACP,sBAAsB,SAAS;AAAA,MACjC;AAAA,MACA,OAAO;AAAA,IACT;AAAA,IACA;AAAA;AAAA,MAEE,SAAS,CAAC,SAAS,QAAQ,kBAAkB;AAAA,MAC7C,OAAO,CAAC,SAAS;AAAA,IACnB;AAAA,EACF;AACF;","names":[]}
@@ -1,23 +0,0 @@
1
- import {
2
- jsdocRules
3
- } from "./chunk-XCPOAYGQ.js";
4
- import {
5
- configNames
6
- } from "./chunk-76XASR6Z.js";
7
-
8
- // src/eslint/jsdoc/config.ts
9
- import jsdoc from "eslint-plugin-jsdoc";
10
- var jsdocConfig = (requireJsdoc = false, typescript = true) => ({
11
- files: ["**/*.{js,jsx,ts,tsx,cjs,mjs}"],
12
- ignores: ["**/*.{test,spec}.{js,jsx,ts,tsx,cjs,mjs}"],
13
- name: configNames.jsdoc,
14
- plugins: {
15
- jsdoc
16
- },
17
- rules: jsdocRules(requireJsdoc, typescript)
18
- });
19
-
20
- export {
21
- jsdocConfig
22
- };
23
- //# sourceMappingURL=chunk-HLIJN23S.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eslint/jsdoc/config.ts"],"sourcesContent":["import jsdoc from \"eslint-plugin-jsdoc\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { jsdocRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for JSDoc comments.\n *\n * @param requireJsdoc - Whether to enforce JSDoc comments on functions and classes. Defaults to false.\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly. Defaults to true.\n * @returns An ESLint configuration object for JSDoc comments.\n */\nexport const jsdocConfig = (\n requireJsdoc = false,\n typescript = true,\n): EslintConfigObject => ({\n files: [\"**/*.{js,jsx,ts,tsx,cjs,mjs}\"],\n ignores: [\"**/*.{test,spec}.{js,jsx,ts,tsx,cjs,mjs}\"],\n name: configNames.jsdoc,\n plugins: {\n jsdoc,\n },\n rules: jsdocRules(requireJsdoc, typescript),\n});\n"],"mappings":";;;;;;;;AAAA,OAAO,WAAW;AAcX,IAAM,cAAc,CACzB,eAAe,OACf,aAAa,UACW;AAAA,EACxB,OAAO,CAAC,8BAA8B;AAAA,EACtC,SAAS,CAAC,0CAA0C;AAAA,EACpD,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,OAAO,WAAW,cAAc,UAAU;AAC5C;","names":[]}