@enjoys/context-engine 1.3.1 → 1.4.1

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 (221) hide show
  1. package/data/codeActions/angular.json +126 -0
  2. package/data/codeActions/nestjs.json +124 -0
  3. package/data/codeActions/nextjs.json +198 -0
  4. package/data/codeActions/react.json +154 -0
  5. package/data/codeActions/shadcn.json +112 -0
  6. package/data/codeActions/shell.json +169 -26
  7. package/data/codeLens/angular.json +22 -0
  8. package/data/codeLens/nestjs.json +21 -0
  9. package/data/codeLens/nextjs.json +117 -0
  10. package/data/codeLens/react.json +89 -0
  11. package/data/codeLens/shadcn.json +89 -0
  12. package/data/codeLens/shell.json +59 -17
  13. package/data/codeLens/tailwindcss.json +56 -0
  14. package/data/color/angular.json +21 -0
  15. package/data/color/nestjs.json +18 -0
  16. package/data/color/nextjs.json +22 -0
  17. package/data/color/react.json +93 -0
  18. package/data/color/shadcn.json +66 -0
  19. package/data/color/shell.json +106 -80
  20. package/data/commands/angular.json +312 -0
  21. package/data/commands/manifest.json +5 -0
  22. package/data/commands/nestjs.json +273 -0
  23. package/data/commands/nextjs.json +123 -0
  24. package/data/commands/react.json +210 -0
  25. package/data/commands/shadcn.json +410 -0
  26. package/data/commands/shell.json +571 -41
  27. package/data/completion/angular.json +1490 -0
  28. package/data/completion/css.json +793 -0
  29. package/data/completion/nestjs.json +1454 -0
  30. package/data/completion/nextjs.json +1373 -0
  31. package/data/completion/react.json +1319 -0
  32. package/data/completion/shadcn.json +1202 -0
  33. package/data/completion/shell.json +2446 -510
  34. package/data/declaration/angular.json +46 -0
  35. package/data/declaration/nestjs.json +47 -0
  36. package/data/declaration/nextjs.json +274 -0
  37. package/data/declaration/react.json +199 -0
  38. package/data/declaration/shadcn.json +211 -0
  39. package/data/declaration/shell.json +343 -24
  40. package/data/declaration/tailwindcss.json +72 -0
  41. package/data/definition/angular.json +670 -0
  42. package/data/definition/nestjs.json +684 -0
  43. package/data/definition/nextjs.json +439 -0
  44. package/data/definition/react.json +397 -0
  45. package/data/definition/shadcn.json +99 -0
  46. package/data/definition/shell.json +820 -0
  47. package/data/documentHighlight/angular.json +414 -0
  48. package/data/documentHighlight/css.json +77 -2
  49. package/data/documentHighlight/nestjs.json +115 -0
  50. package/data/documentHighlight/nextjs.json +212 -0
  51. package/data/documentHighlight/react.json +119 -0
  52. package/data/documentHighlight/shadcn.json +168 -0
  53. package/data/documentHighlight/shell.json +664 -334
  54. package/data/documentHighlight/tailwindcss.json +105 -10
  55. package/data/documentRangeFormatting/angular.json +45 -0
  56. package/data/documentRangeFormatting/nestjs.json +17 -0
  57. package/data/documentRangeFormatting/nextjs.json +17 -0
  58. package/data/documentRangeFormatting/react.json +78 -0
  59. package/data/documentRangeFormatting/shadcn.json +45 -0
  60. package/data/documentRangeFormatting/shell.json +120 -53
  61. package/data/documentSymbol/angular.json +180 -0
  62. package/data/documentSymbol/nestjs.json +152 -0
  63. package/data/documentSymbol/nextjs.json +159 -0
  64. package/data/documentSymbol/react.json +145 -0
  65. package/data/documentSymbol/shadcn.json +131 -0
  66. package/data/documentSymbol/shell.json +166 -26
  67. package/data/documentSymbol/tailwindcss.json +49 -0
  68. package/data/foldingRange/angular.json +99 -0
  69. package/data/foldingRange/nestjs.json +26 -0
  70. package/data/foldingRange/nextjs.json +26 -0
  71. package/data/foldingRange/react.json +120 -0
  72. package/data/foldingRange/shadcn.json +93 -0
  73. package/data/foldingRange/shell.json +106 -46
  74. package/data/formatting/angular.json +21 -0
  75. package/data/formatting/nestjs.json +23 -0
  76. package/data/formatting/nextjs.json +23 -0
  77. package/data/formatting/react.json +71 -0
  78. package/data/formatting/shadcn.json +61 -0
  79. package/data/formatting/shell.json +103 -19
  80. package/data/hover/angular.json +455 -0
  81. package/data/hover/css.json +232 -0
  82. package/data/hover/nestjs.json +296 -0
  83. package/data/hover/nextjs.json +305 -0
  84. package/data/hover/react.json +173 -0
  85. package/data/hover/shadcn.json +450 -0
  86. package/data/hover/shell.json +684 -75
  87. package/data/implementation/angular.json +22 -0
  88. package/data/implementation/nestjs.json +24 -0
  89. package/data/implementation/nextjs.json +137 -0
  90. package/data/implementation/react.json +125 -0
  91. package/data/implementation/shadcn.json +89 -0
  92. package/data/implementation/shell.json +59 -3
  93. package/data/inlayHints/angular.json +24 -0
  94. package/data/inlayHints/nestjs.json +24 -0
  95. package/data/inlayHints/nextjs.json +143 -0
  96. package/data/inlayHints/react.json +177 -0
  97. package/data/inlayHints/shadcn.json +109 -0
  98. package/data/inlayHints/shell.json +223 -35
  99. package/data/inlineCompletions/angular.json +135 -0
  100. package/data/inlineCompletions/nestjs.json +25 -0
  101. package/data/inlineCompletions/nextjs.json +179 -0
  102. package/data/inlineCompletions/react.json +203 -0
  103. package/data/inlineCompletions/shadcn.json +115 -0
  104. package/data/inlineCompletions/shell.json +185 -35
  105. package/data/linkedEditingRange/angular.json +23 -0
  106. package/data/linkedEditingRange/nestjs.json +10 -0
  107. package/data/linkedEditingRange/nextjs.json +11 -0
  108. package/data/linkedEditingRange/react.json +75 -0
  109. package/data/linkedEditingRange/shadcn.json +23 -0
  110. package/data/linkedEditingRange/shell.json +25 -25
  111. package/data/links/angular.json +95 -0
  112. package/data/links/nestjs.json +130 -0
  113. package/data/links/nextjs.json +91 -0
  114. package/data/links/react.json +75 -0
  115. package/data/links/shadcn.json +98 -0
  116. package/data/links/shell.json +56 -0
  117. package/data/links/tailwindcss.json +25 -0
  118. package/data/manifest.json +339 -152
  119. package/data/onTypeFormatting/angular.json +14 -0
  120. package/data/onTypeFormatting/nestjs.json +16 -0
  121. package/data/onTypeFormatting/nextjs.json +17 -0
  122. package/data/onTypeFormatting/react.json +127 -0
  123. package/data/onTypeFormatting/shadcn.json +54 -0
  124. package/data/onTypeFormatting/shell.json +72 -68
  125. package/data/rangeSemanticTokens/angular.json +140 -0
  126. package/data/rangeSemanticTokens/nestjs.json +27 -0
  127. package/data/rangeSemanticTokens/nextjs.json +28 -0
  128. package/data/rangeSemanticTokens/react.json +216 -0
  129. package/data/rangeSemanticTokens/shadcn.json +140 -0
  130. package/data/rangeSemanticTokens/shell.json +247 -69
  131. package/data/rangeSemanticTokens/tailwindcss.json +99 -8
  132. package/data/references/angular.json +26 -0
  133. package/data/references/nestjs.json +24 -0
  134. package/data/references/nextjs.json +178 -0
  135. package/data/references/react.json +192 -0
  136. package/data/references/shadcn.json +101 -0
  137. package/data/references/shell.json +323 -92
  138. package/data/references/tailwindcss.json +66 -0
  139. package/data/rename/angular.json +131 -0
  140. package/data/rename/nestjs.json +32 -0
  141. package/data/rename/nextjs.json +31 -0
  142. package/data/rename/react.json +88 -0
  143. package/data/rename/shadcn.json +79 -0
  144. package/data/rename/shell.json +101 -31
  145. package/data/selectionRange/angular.json +95 -0
  146. package/data/selectionRange/nestjs.json +21 -0
  147. package/data/selectionRange/nextjs.json +22 -0
  148. package/data/selectionRange/react.json +87 -0
  149. package/data/selectionRange/shadcn.json +89 -0
  150. package/data/selectionRange/shell.json +65 -35
  151. package/data/semanticTokens/angular.json +198 -0
  152. package/data/semanticTokens/nestjs.json +35 -0
  153. package/data/semanticTokens/nextjs.json +38 -0
  154. package/data/semanticTokens/react.json +215 -0
  155. package/data/semanticTokens/shadcn.json +180 -0
  156. package/data/semanticTokens/shell.json +238 -65
  157. package/data/signatureHelp/angular.json +182 -0
  158. package/data/signatureHelp/nestjs.json +128 -0
  159. package/data/signatureHelp/nextjs.json +127 -0
  160. package/data/signatureHelp/react.json +281 -0
  161. package/data/signatureHelp/shadcn.json +237 -0
  162. package/data/signatureHelp/shell.json +797 -104
  163. package/data/typeDefinition/angular.json +362 -0
  164. package/data/typeDefinition/nestjs.json +334 -0
  165. package/data/typeDefinition/nextjs.json +285 -0
  166. package/data/typeDefinition/react.json +236 -0
  167. package/data/typeDefinition/shadcn.json +292 -0
  168. package/data/typeDefinition/shell.json +104 -40
  169. package/package.json +1 -1
  170. package/data/codeActions/bash.json +0 -169
  171. package/data/codeActions/zsh.json +0 -49
  172. package/data/codeLens/bash.json +0 -75
  173. package/data/codeLens/zsh.json +0 -19
  174. package/data/color/bash.json +0 -100
  175. package/data/color/zsh.json +0 -80
  176. package/data/commands/bash.json +0 -102
  177. package/data/commands/zsh.json +0 -166
  178. package/data/completion/bash.json +0 -1184
  179. package/data/completion/zsh.json +0 -973
  180. package/data/declaration/bash.json +0 -301
  181. package/data/declaration/zsh.json +0 -205
  182. package/data/definition/bash.json +0 -565
  183. package/data/definition/zsh.json +0 -350
  184. package/data/documentHighlight/bash.json +0 -393
  185. package/data/documentHighlight/zsh.json +0 -266
  186. package/data/documentRangeFormatting/bash.json +0 -41
  187. package/data/documentRangeFormatting/zsh.json +0 -59
  188. package/data/documentSymbol/bash.json +0 -124
  189. package/data/documentSymbol/zsh.json +0 -26
  190. package/data/foldingRange/bash.json +0 -76
  191. package/data/foldingRange/zsh.json +0 -46
  192. package/data/formatting/bash.json +0 -88
  193. package/data/formatting/zsh.json +0 -28
  194. package/data/hover/bash.json +0 -579
  195. package/data/hover/zsh.json +0 -96
  196. package/data/implementation/bash.json +0 -44
  197. package/data/implementation/zsh.json +0 -41
  198. package/data/inlayHints/bash.json +0 -207
  199. package/data/inlayHints/zsh.json +0 -43
  200. package/data/inlineCompletions/bash.json +0 -155
  201. package/data/inlineCompletions/zsh.json +0 -17
  202. package/data/linkedEditingRange/bash.json +0 -25
  203. package/data/linkedEditingRange/zsh.json +0 -25
  204. package/data/links/bash.json +0 -56
  205. package/data/links/zsh.json +0 -15
  206. package/data/onTypeFormatting/bash.json +0 -68
  207. package/data/onTypeFormatting/zsh.json +0 -68
  208. package/data/rangeSemanticTokens/bash.json +0 -90
  209. package/data/rangeSemanticTokens/zsh.json +0 -76
  210. package/data/references/bash.json +0 -221
  211. package/data/references/zsh.json +0 -166
  212. package/data/rename/bash.json +0 -37
  213. package/data/rename/zsh.json +0 -31
  214. package/data/selectionRange/bash.json +0 -35
  215. package/data/selectionRange/zsh.json +0 -35
  216. package/data/semanticTokens/bash.json +0 -71
  217. package/data/semanticTokens/zsh.json +0 -71
  218. package/data/signatureHelp/bash.json +0 -111
  219. package/data/signatureHelp/zsh.json +0 -118
  220. package/data/typeDefinition/bash.json +0 -95
  221. package/data/typeDefinition/zsh.json +0 -40
@@ -7,7 +7,17 @@
7
7
  "description": "Highlight Tailwind display/layout utility class names."
8
8
  },
9
9
  {
10
- "pattern": "\\b(p|m|px|py|pt|pr|pb|pl|mx|my|mt|mr|mb|ml|gap|space-x|space-y)-\\d+\\b",
10
+ "pattern": "\\b(relative|absolute|fixed|sticky|static)\\b",
11
+ "kind": "text",
12
+ "description": "Highlight Tailwind position utility class names."
13
+ },
14
+ {
15
+ "pattern": "\\b(inset|top|right|bottom|left|z)-[\\w/.-]+\\b",
16
+ "kind": "text",
17
+ "description": "Highlight Tailwind position offset and z-index utility class names."
18
+ },
19
+ {
20
+ "pattern": "\\b(p|m|px|py|pt|pr|pb|pl|mx|my|mt|mr|mb|ml|gap|gap-x|gap-y|space-x|space-y)-[\\w/]+\\b",
11
21
  "kind": "text",
12
22
  "description": "Highlight Tailwind spacing utility class names."
13
23
  },
@@ -17,45 +27,130 @@
17
27
  "description": "Highlight Tailwind sizing utility class names."
18
28
  },
19
29
  {
20
- "pattern": "\\b(text|font|leading|tracking|decoration|underline|overline|line-through|no-underline)-[\\w-]+\\b",
30
+ "pattern": "\\b(text|font|leading|tracking|decoration|underline|overline|line-through|no-underline|truncate|uppercase|lowercase|capitalize|normal-case|italic|not-italic|whitespace|break|line-clamp)-[\\w-]*\\b",
21
31
  "kind": "text",
22
32
  "description": "Highlight Tailwind typography utility class names."
23
33
  },
24
34
  {
25
- "pattern": "\\b(bg|from|via|to)-[\\w-]+\\b",
35
+ "pattern": "\\b(bg|from|via|to|bg-gradient)-[\\w-]+\\b",
26
36
  "kind": "text",
27
37
  "description": "Highlight Tailwind background and gradient utility class names."
28
38
  },
29
39
  {
30
40
  "pattern": "\\b(border|rounded|ring|divide|outline)-[\\w-]*\\b",
31
41
  "kind": "text",
32
- "description": "Highlight Tailwind border and ring utility class names."
42
+ "description": "Highlight Tailwind border/ring/divide/outline utility class names."
33
43
  },
34
44
  {
35
- "pattern": "\\b(shadow|opacity|blur|backdrop-blur|brightness|contrast|saturate)-[\\w-]*\\b",
45
+ "pattern": "\\b(shadow|opacity|blur|backdrop-blur|brightness|contrast|saturate|grayscale|invert|sepia|hue-rotate|drop-shadow)-[\\w-]*\\b",
36
46
  "kind": "text",
37
47
  "description": "Highlight Tailwind effects and filter utility class names."
38
48
  },
39
49
  {
40
- "pattern": "\\b(sm|md|lg|xl|2xl):",
50
+ "pattern": "\\b(transition|duration|ease|delay|animate)-[\\w-]*\\b",
51
+ "kind": "text",
52
+ "description": "Highlight Tailwind transition and animation utility class names."
53
+ },
54
+ {
55
+ "pattern": "\\b(scale|rotate|translate|skew|origin)-[\\w-]*\\b",
56
+ "kind": "text",
57
+ "description": "Highlight Tailwind transform utility class names."
58
+ },
59
+ {
60
+ "pattern": "\\b(items|justify|self|content|place)-(start|end|center|between|around|evenly|stretch|baseline|auto)\\b",
61
+ "kind": "text",
62
+ "description": "Highlight Tailwind alignment and distribution utility class names."
63
+ },
64
+ {
65
+ "pattern": "\\b(flex-row|flex-col|flex-wrap|flex-nowrap|flex-1|flex-auto|flex-initial|flex-none|grow|shrink|basis|order)-?[\\w-]*\\b",
41
66
  "kind": "text",
42
- "description": "Highlight responsive breakpoint prefixes."
67
+ "description": "Highlight Tailwind flex item property utility class names."
43
68
  },
44
69
  {
45
- "pattern": "\\b(hover|focus|active|visited|disabled|first|last|odd|even|focus-within|focus-visible):",
70
+ "pattern": "\\b(grid-cols|grid-rows|col-span|row-span|col-start|col-end|row-start|row-end|auto-cols|auto-rows|grid-flow)-[\\w-]+\\b",
71
+ "kind": "text",
72
+ "description": "Highlight Tailwind CSS Grid utility class names."
73
+ },
74
+ {
75
+ "pattern": "\\b(cursor|select|resize|scroll|snap|touch|pointer-events|will-change|appearance|accent|caret)-[\\w-]*\\b",
76
+ "kind": "text",
77
+ "description": "Highlight Tailwind interactivity utility class names."
78
+ },
79
+ {
80
+ "pattern": "\\b(overflow|overflow-x|overflow-y|overscroll)-(auto|hidden|visible|scroll|contain|none)\\b",
81
+ "kind": "text",
82
+ "description": "Highlight Tailwind overflow/overscroll utility class names."
83
+ },
84
+ {
85
+ "pattern": "\\b(aspect|object|container|columns|break-inside|break-before|break-after)-[\\w-]*\\b",
86
+ "kind": "text",
87
+ "description": "Highlight Tailwind container/aspect-ratio/object/columns/break utility class names."
88
+ },
89
+ {
90
+ "pattern": "\\bsr-only\\b|\\bnot-sr-only\\b",
91
+ "kind": "text",
92
+ "description": "Highlight Tailwind accessibility utility class names."
93
+ },
94
+ {
95
+ "pattern": "\\b\\w+-\\[[^\\]]+\\]\\b",
96
+ "kind": "text",
97
+ "description": "Highlight Tailwind arbitrary value utilities using bracket notation."
98
+ },
99
+ {
100
+ "pattern": "!\\w+",
101
+ "kind": "text",
102
+ "description": "Highlight Tailwind important modifier prefix."
103
+ },
104
+ {
105
+ "pattern": "\\b(sm|md|lg|xl|2xl|min-\\[\\w+\\]|max-\\[\\w+\\]):",
106
+ "kind": "text",
107
+ "description": "Highlight responsive breakpoint prefixes including arbitrary breakpoints."
108
+ },
109
+ {
110
+ "pattern": "\\b(hover|focus|active|visited|disabled|first|last|odd|even|focus-within|focus-visible|checked|required|invalid|placeholder-shown|autofill|read-only|empty|default|indeterminate):",
46
111
  "kind": "text",
47
112
  "description": "Highlight state variant prefixes."
48
113
  },
49
114
  {
50
- "pattern": "\\b(dark|group-hover|group-focus|peer-focus|peer-checked|peer-hover):",
115
+ "pattern": "\\b(before|after|placeholder|file|marker|selection|first-line|first-letter|backdrop):",
116
+ "kind": "text",
117
+ "description": "Highlight pseudo-element variant prefixes."
118
+ },
119
+ {
120
+ "pattern": "\\b(dark|group-hover|group-focus|group-active|peer-focus|peer-checked|peer-hover|peer-invalid|peer-disabled):",
51
121
  "kind": "text",
52
122
  "description": "Highlight dark mode and group/peer variant prefixes."
53
123
  },
54
124
  {
55
- "pattern": "@(tailwind|apply|layer|config|responsive|variants|screen)",
125
+ "pattern": "\\b(motion-safe|motion-reduce|print|portrait|landscape|rtl|ltr|contrast-more|forced-colors):",
126
+ "kind": "text",
127
+ "description": "Highlight media query variant prefixes."
128
+ },
129
+ {
130
+ "pattern": "\\baria-[\\w-]+:",
131
+ "kind": "text",
132
+ "description": "Highlight ARIA attribute variant prefixes."
133
+ },
134
+ {
135
+ "pattern": "\\bdata-\\[[^\\]]+\\]:",
136
+ "kind": "text",
137
+ "description": "Highlight data attribute variant prefixes."
138
+ },
139
+ {
140
+ "pattern": "\\b(supports|has)-\\[[^\\]]+\\]:",
141
+ "kind": "text",
142
+ "description": "Highlight conditional variant prefixes (supports, has)."
143
+ },
144
+ {
145
+ "pattern": "@(tailwind|apply|layer|config|responsive|variants|screen|source|plugin)",
56
146
  "kind": "text",
57
147
  "description": "Highlight Tailwind CSS at-rule directives."
58
148
  },
149
+ {
150
+ "pattern": "\\b(theme|screen)\\s*\\(",
151
+ "kind": "text",
152
+ "description": "Highlight Tailwind CSS function calls."
153
+ },
59
154
  {
60
155
  "pattern": "\\b(slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(50|100|200|300|400|500|600|700|800|900|950)\\b",
61
156
  "kind": "text",
@@ -0,0 +1,45 @@
1
+ {
2
+ "language": "angular",
3
+ "rangeFormattingRules": [
4
+ {
5
+ "context": "decorator",
6
+ "rule": "indent-decorator-properties",
7
+ "description": "Format Angular decorator metadata with consistent indentation, placing each property on its own line with 2-space indent inside the decorator argument object"
8
+ },
9
+ {
10
+ "context": "class-member",
11
+ "rule": "align-class-members",
12
+ "description": "Ensure consistent indentation of class members including properties, methods, and accessors with 2-space indent from the class body brace"
13
+ },
14
+ {
15
+ "context": "template-string",
16
+ "rule": "align-template-literals",
17
+ "description": "Align multi-line template literal content preserving relative indentation within inline component templates"
18
+ },
19
+ {
20
+ "context": "import-block",
21
+ "rule": "sort-and-group-imports",
22
+ "description": "Sort import statements alphabetically within groups: Angular core, Angular modules, third-party libraries, and local imports separated by blank lines"
23
+ },
24
+ {
25
+ "context": "constructor-injection",
26
+ "rule": "align-constructor-params",
27
+ "description": "Format constructor dependency injection parameters one per line with consistent indentation and access modifier alignment"
28
+ },
29
+ {
30
+ "context": "array-object-literal",
31
+ "rule": "format-literals",
32
+ "description": "Format array and object literals with consistent bracket placement, trailing commas, and indentation for providers, imports, and declarations arrays"
33
+ },
34
+ {
35
+ "context": "method-chain",
36
+ "rule": "align-method-chains",
37
+ "description": "Align chained method calls such as RxJS pipe operators and builder patterns with each call on a new indented line"
38
+ },
39
+ {
40
+ "context": "control-flow-block",
41
+ "rule": "format-control-flow",
42
+ "description": "Format Angular control flow blocks (@if, @for, @switch, @defer) with consistent indentation and brace placement"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "language": "nestjs",
3
+ "documentRangeFormatting": {
4
+ "tabSize": 2,
5
+ "insertSpaces": true,
6
+ "rules": [
7
+ { "description": "Normalize indentation", "pattern": "^\\t+", "replacement": " ", "perIndentLevel": true },
8
+ { "description": "Remove trailing whitespace", "pattern": "\\s+$", "replacement": "" },
9
+ { "description": "Space after keywords", "pattern": "\\b(if|for|while|switch|catch)\\(", "replacement": "$1 (" },
10
+ { "description": "Space before opening brace", "pattern": "\\)\\{", "replacement": ") {" },
11
+ { "description": "Consistent arrow spacing", "pattern": "\\)\\s*=>\\s*\\{", "replacement": ") => {" },
12
+ { "description": "Consistent type annotation spacing", "pattern": "(\\w)\\s*:\\s*(\\w)", "replacement": "$1: $2" },
13
+ { "description": "Normalize decorator spacing", "pattern": "@(\\w+)\\(\\s+", "replacement": "@$1(" },
14
+ { "description": "Single space after commas", "pattern": ",([^\\s])", "replacement": ", $1" }
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "language": "nextjs",
3
+ "documentRangeFormatting": {
4
+ "tabSize": 2,
5
+ "insertSpaces": true,
6
+ "rules": [
7
+ { "description": "Normalize indentation", "pattern": "^\\t+", "replacement": " ", "perIndentLevel": true },
8
+ { "description": "Remove trailing whitespace", "pattern": "\\s+$", "replacement": "" },
9
+ { "description": "Space after keywords", "pattern": "\\b(if|for|while|switch|catch)\\(", "replacement": "$1 (" },
10
+ { "description": "Space before opening brace", "pattern": "\\)\\{", "replacement": ") {" },
11
+ { "description": "Consistent arrow spacing", "pattern": "\\)\\s*=>\\s*\\{", "replacement": ") => {" },
12
+ { "description": "JSX attribute spacing", "pattern": "(\\w)\\s*=\\s*\\{", "replacement": "$1={" },
13
+ { "description": "Normalize string quotes to double", "pattern": "'([^']*)'", "replacement": "\"$1\"" },
14
+ { "description": "JSX self-closing space", "pattern": "(\\w)\\/>", "replacement": "$1 />" }
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "language": "react",
3
+ "documentRangeFormatting": {
4
+ "tabSize": 2,
5
+ "insertSpaces": true,
6
+ "trimTrailingWhitespace": true,
7
+ "insertFinalNewline": true,
8
+ "trimFinalNewlines": true,
9
+ "rules": [
10
+ {
11
+ "description": "Indent JSX children relative to parent tag",
12
+ "pattern": "(<[A-Za-z][a-zA-Z0-9.]*[^>]*>)([\\s\\S]*?)(<\\/[A-Za-z][a-zA-Z0-9.]*>)",
13
+ "indentChildren": true,
14
+ "indentSize": 2
15
+ },
16
+ {
17
+ "description": "Align multi-line JSX props",
18
+ "pattern": "<([A-Za-z][a-zA-Z0-9.]*)\\s+([\\s\\S]*?)\\s*\\/?>",
19
+ "alignProps": true,
20
+ "propIndent": 2
21
+ },
22
+ {
23
+ "description": "Format JSX expression containers",
24
+ "pattern": "\\{([^}]+)\\}",
25
+ "trimInnerSpaces": true
26
+ },
27
+ {
28
+ "description": "Normalize hook dependency arrays",
29
+ "pattern": "\\},\\s*\\[([^\\]]*)\\]\\s*\\)",
30
+ "normalizeSpacing": true
31
+ },
32
+ {
33
+ "description": "Consistent arrow function spacing",
34
+ "pattern": "(\\([^)]*\\))\\s*=>\\s*(\\{|\\()",
35
+ "spaceBefore": " ",
36
+ "spaceAfter": " "
37
+ },
38
+ {
39
+ "description": "Format object destructuring in props",
40
+ "pattern": "\\(\\s*\\{\\s*([^}]+)\\s*\\}\\s*(?::\\s*\\w+)?\\s*\\)",
41
+ "normalizeSpacing": true
42
+ },
43
+ {
44
+ "description": "Normalize import spacing",
45
+ "pattern": "import\\s+\\{\\s*([^}]+)\\s*\\}\\s+from",
46
+ "normalizeSpacing": true
47
+ },
48
+ {
49
+ "description": "Consistent ternary formatting",
50
+ "pattern": "([^?]+)\\s*\\?\\s*([^:]+)\\s*:\\s*([^;,)]+)",
51
+ "multilineThreshold": 80,
52
+ "indentBranches": true
53
+ },
54
+ {
55
+ "description": "Multi-line array/object in state",
56
+ "pattern": "useState\\(\\s*(\\{[\\s\\S]*?\\}|\\[[\\s\\S]*?\\])\\s*\\)",
57
+ "indentContent": true,
58
+ "indentSize": 2
59
+ },
60
+ {
61
+ "description": "Format className concatenation",
62
+ "pattern": "className=\\{`([^`]*)`\\}",
63
+ "preserveTemplateSpacing": true
64
+ },
65
+ {
66
+ "description": "Normalize style object formatting",
67
+ "pattern": "style=\\{\\{([^}]*)\\}\\}",
68
+ "formatAsObject": true,
69
+ "indentSize": 2
70
+ },
71
+ {
72
+ "description": "Consistent spacing in map/filter/reduce callbacks",
73
+ "pattern": "\\.(map|filter|reduce|forEach|find|some|every)\\(\\s*\\(([^)]*)\\)\\s*=>",
74
+ "normalizeSpacing": true
75
+ }
76
+ ]
77
+ }
78
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "language": "shadcn",
3
+ "rangeFormattingRules": [
4
+ {
5
+ "context": "JSX props",
6
+ "rule": "When a JSX element has more than 2 props, format each prop on its own line with consistent indentation relative to the opening tag.",
7
+ "description": "Format JSX component props across multiple lines for readability"
8
+ },
9
+ {
10
+ "context": "className cn() call",
11
+ "rule": "Format cn() arguments with each class group on a separate line when the total length exceeds 80 characters. Keep short cn() calls on a single line.",
12
+ "description": "Format cn() utility class merging expressions for clarity"
13
+ },
14
+ {
15
+ "context": "cva variant object",
16
+ "rule": "Format cva() config objects with each variant key on its own line, and each variant value object indented one level deeper. Align variant value keys vertically.",
17
+ "description": "Format class-variance-authority variant definition objects"
18
+ },
19
+ {
20
+ "context": "import block",
21
+ "rule": "Sort imports in groups: 1) React/Next.js, 2) third-party packages, 3) @/components/ui, 4) @/lib utilities, 5) @/hooks, 6) relative imports. Separate groups with a blank line.",
22
+ "description": "Sort and group import statements by convention"
23
+ },
24
+ {
25
+ "context": "component body",
26
+ "rule": "Indent component body content consistently with 2 spaces. Ensure hooks appear before derived state, followed by event handlers, then the return statement.",
27
+ "description": "Format indentation within React component function bodies"
28
+ },
29
+ {
30
+ "context": "Tailwind class ordering",
31
+ "rule": "Order Tailwind classes following: layout (flex, grid) → spacing (p, m) → sizing (w, h) → typography (text, font) → backgrounds (bg) → borders (border, rounded) → effects (shadow, opacity) → transitions (transition, duration) → responsive/state variants (sm:, hover:, dark:).",
32
+ "description": "Reorder Tailwind CSS utility classes within className strings"
33
+ },
34
+ {
35
+ "context": "form field nesting",
36
+ "rule": "Format FormField render props with FormItem, FormLabel, FormControl, FormDescription, and FormMessage each on their own line, properly nested and indented.",
37
+ "description": "Format shadcn/ui form field component nesting structure"
38
+ },
39
+ {
40
+ "context": "array/object literal",
41
+ "rule": "Format multi-element arrays and multi-property objects with each entry on its own line. Align colons in object literals when properties are adjacent. Use trailing commas.",
42
+ "description": "Align array elements and object literal properties consistently"
43
+ }
44
+ ]
45
+ }
@@ -1,53 +1,120 @@
1
- {
2
- "language": "shell",
3
- "defaultOptions": {
4
- "tabSize": 2,
5
- "insertSpaces": true
6
- },
7
- "rangeFormattingRules": [
8
- {
9
- "description": "Indent function bodies",
10
- "pattern": "\\w+\\s*\\(\\)\\s*\\{|\\bfunction\\b\\s+\\w+\\s*\\{",
11
- "action": "indent",
12
- "options": { "indentBody": true }
13
- },
14
- {
15
- "description": "Indent if/elif/else/fi blocks",
16
- "pattern": "\\b(if|elif|else)\\b",
17
- "action": "indent",
18
- "options": { "indentBody": true, "endKeyword": "fi" }
19
- },
20
- {
21
- "description": "Format case statement patterns and bodies",
22
- "pattern": "\\bcase\\b\\s+.*\\bin\\b[\\s\\S]*?\\besac\\b",
23
- "action": "indent",
24
- "options": { "indentPatterns": true, "indentBody": true }
25
- },
26
- {
27
- "description": "Indent for/while/until loops",
28
- "pattern": "\\b(for|while|until)\\b.*\\bdo\\b",
29
- "action": "indent",
30
- "options": { "indentBody": true, "endKeyword": "done" }
31
- },
32
- {
33
- "description": "Format pipeline continuations across lines",
34
- "pattern": "\\|\\s*\\\\?\\s*\\n",
35
- "action": "indent",
36
- "options": { "continuationIndent": true }
37
- },
38
- {
39
- "description": "Indent here-document content",
40
- "pattern": "<<-?\\s*['\"]?\\w+['\"]?",
41
- "action": "indent",
42
- "options": { "heredoc": true }
43
- },
44
- {
45
- "description": "Trim trailing whitespace",
46
- "pattern": "[ \\t]+$",
47
- "action": "trimWhitespace",
48
- "options": {}
49
- }
50
- ],
51
- "adjustToSyntaxNode": true,
52
- "supportedRangeTypes": ["statement", "block", "function"]
53
- }
1
+ {
2
+ "language": "shell",
3
+ "defaultOptions": {
4
+ "tabSize": 2,
5
+ "insertSpaces": true
6
+ },
7
+ "rangeFormattingRules": [
8
+ {
9
+ "description": "Indent function bodies",
10
+ "pattern": "\\w+\\s*\\(\\)\\s*\\{|\\bfunction\\b\\s+\\w+\\s*\\{",
11
+ "action": "indent",
12
+ "options": {
13
+ "indentBody": true
14
+ }
15
+ },
16
+ {
17
+ "description": "Indent if/elif/else/fi blocks",
18
+ "pattern": "\\b(if|elif|else)\\b",
19
+ "action": "indent",
20
+ "options": {
21
+ "indentBody": true,
22
+ "endKeyword": "fi"
23
+ }
24
+ },
25
+ {
26
+ "description": "Format case statement patterns and bodies",
27
+ "pattern": "\\bcase\\b\\s+.*\\bin\\b[\\s\\S]*?\\besac\\b",
28
+ "action": "indent",
29
+ "options": {
30
+ "indentPatterns": true,
31
+ "indentBody": true
32
+ }
33
+ },
34
+ {
35
+ "description": "Indent for/while/until loops",
36
+ "pattern": "\\b(for|while|until)\\b.*\\bdo\\b",
37
+ "action": "indent",
38
+ "options": {
39
+ "indentBody": true,
40
+ "endKeyword": "done"
41
+ }
42
+ },
43
+ {
44
+ "description": "Format pipeline continuations across lines",
45
+ "pattern": "\\|\\s*\\\\?\\s*\\n",
46
+ "action": "indent",
47
+ "options": {
48
+ "continuationIndent": true
49
+ }
50
+ },
51
+ {
52
+ "description": "Indent here-document content",
53
+ "pattern": "<<-?\\s*['\"]?\\w+['\"]?",
54
+ "action": "indent",
55
+ "options": {
56
+ "heredoc": true
57
+ }
58
+ },
59
+ {
60
+ "description": "Trim trailing whitespace",
61
+ "pattern": "[ \\t]+$",
62
+ "action": "trimWhitespace",
63
+ "options": {}
64
+ },
65
+ {
66
+ "description": "Indent contents of if/then/fi blocks",
67
+ "pattern": "\\b(if|then|elif|else|fi)\\b",
68
+ "action": "indent",
69
+ "options": {}
70
+ },
71
+ {
72
+ "description": "Indent contents of for/while/do/done loops",
73
+ "pattern": "\\b(for|while|do|done)\\b",
74
+ "action": "indent",
75
+ "options": {}
76
+ },
77
+ {
78
+ "description": "Indent case/esac blocks",
79
+ "pattern": "\\b(case|esac)\\b",
80
+ "action": "indent",
81
+ "options": {}
82
+ },
83
+ {
84
+ "description": "Normalize spacing around variable assignments",
85
+ "pattern": "\\w+=",
86
+ "action": "normalizeSpacing",
87
+ "options": {
88
+ "spacesAroundEquals": false
89
+ }
90
+ },
91
+ {
92
+ "description": "Trim trailing whitespace",
93
+ "pattern": "\\s+$",
94
+ "action": "trimWhitespace",
95
+ "options": {}
96
+ },
97
+ {
98
+ "description": "Indent here-document and here-string content",
99
+ "pattern": "<<-?\\s*['\"]?\\w+['\"]?|<<<",
100
+ "action": "indent",
101
+ "options": {
102
+ "heredoc": true
103
+ }
104
+ },
105
+ {
106
+ "description": "Indent zsh-specific constructs (zparseopts, zstyle)",
107
+ "pattern": "\\b(zparseopts|zstyle|autoload|zmodload)\\b",
108
+ "action": "normalizeSpacing",
109
+ "options": {
110
+ "singleSpace": true
111
+ }
112
+ }
113
+ ],
114
+ "adjustToSyntaxNode": true,
115
+ "supportedRangeTypes": [
116
+ "statement",
117
+ "block",
118
+ "function"
119
+ ]
120
+ }