lint-suite 1.6.2 → 2.0.0

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 (207) hide show
  1. package/README.md +262 -18
  2. package/eslint.cjs +4027 -467
  3. package/eslint.cjs.map +4 -4
  4. package/eslint.js +3972 -350
  5. package/eslint.js.map +4 -4
  6. package/lib/angular-template.d.ts.map +1 -1
  7. package/lib/angular.d.ts +0 -1
  8. package/lib/angular.d.ts.map +1 -1
  9. package/lib/base-limits.d.ts.map +1 -1
  10. package/lib/base-practices.d.ts.map +1 -1
  11. package/lib/line-length.const.d.ts +2 -0
  12. package/lib/line-length.const.d.ts.map +1 -0
  13. package/lib/rules/arrow-body-fits-line/arrow-body-fits-line.d.ts +6 -0
  14. package/lib/rules/arrow-body-fits-line/arrow-body-fits-line.d.ts.map +1 -0
  15. package/lib/rules/chain-fits-line/chain-fits-line.d.ts +6 -0
  16. package/lib/rules/chain-fits-line/chain-fits-line.d.ts.map +1 -0
  17. package/lib/rules/chain-receiver-is-name/chain-receiver-is-name.d.ts +7 -0
  18. package/lib/rules/chain-receiver-is-name/chain-receiver-is-name.d.ts.map +1 -0
  19. package/lib/rules/common/class-usage.type.d.ts +26 -0
  20. package/lib/rules/common/class-usage.type.d.ts.map +1 -0
  21. package/lib/rules/common/file-cache.type.d.ts +11 -0
  22. package/lib/rules/common/file-cache.type.d.ts.map +1 -0
  23. package/lib/rules/common/glob-matcher.type.d.ts +2 -0
  24. package/lib/rules/common/glob-matcher.type.d.ts.map +1 -0
  25. package/lib/rules/component-metadata.d.ts +3 -0
  26. package/lib/rules/component-metadata.d.ts.map +1 -0
  27. package/lib/rules/explicit-accessibility/common/explicit-accessibility.const.d.ts +1 -1
  28. package/lib/rules/explicit-accessibility/common/explicit-accessibility.const.d.ts.map +1 -1
  29. package/lib/rules/explicit-accessibility/common/explicit-accessibility.type.d.ts +4 -1
  30. package/lib/rules/explicit-accessibility/common/explicit-accessibility.type.d.ts.map +1 -1
  31. package/lib/rules/file-cache.d.ts +14 -0
  32. package/lib/rules/file-cache.d.ts.map +1 -0
  33. package/lib/rules/max-condition-operands/max-condition-operands.d.ts +10 -0
  34. package/lib/rules/max-condition-operands/max-condition-operands.d.ts.map +1 -0
  35. package/lib/rules/no-call-in-condition/common/no-call-in-condition.const.d.ts +6 -0
  36. package/lib/rules/no-call-in-condition/common/no-call-in-condition.const.d.ts.map +1 -0
  37. package/lib/rules/no-call-in-condition/common/no-call-in-condition.type.d.ts +21 -0
  38. package/lib/rules/no-call-in-condition/common/no-call-in-condition.type.d.ts.map +1 -0
  39. package/lib/rules/no-call-in-condition/no-call-in-condition.d.ts +7 -0
  40. package/lib/rules/no-call-in-condition/no-call-in-condition.d.ts.map +1 -0
  41. package/lib/rules/no-call-in-condition/utils/call-exemptions.util.d.ts +4 -0
  42. package/lib/rules/no-call-in-condition/utils/call-exemptions.util.d.ts.map +1 -0
  43. package/lib/rules/no-call-in-condition/utils/condition-calls.util.d.ts +7 -0
  44. package/lib/rules/no-call-in-condition/utils/condition-calls.util.d.ts.map +1 -0
  45. package/lib/rules/no-grouped-condition/no-grouped-condition.d.ts +7 -0
  46. package/lib/rules/no-grouped-condition/no-grouped-condition.d.ts.map +1 -0
  47. package/lib/rules/no-inline-object-types/no-inline-object-types.d.ts.map +1 -1
  48. package/lib/rules/no-inline-return-object/no-inline-return-object.d.ts +6 -0
  49. package/lib/rules/no-inline-return-object/no-inline-return-object.d.ts.map +1 -0
  50. package/lib/rules/no-nested-object-value/common/no-nested-object-value.const.d.ts +5 -0
  51. package/lib/rules/no-nested-object-value/common/no-nested-object-value.const.d.ts.map +1 -0
  52. package/lib/rules/no-nested-object-value/common/no-nested-object-value.type.d.ts +7 -0
  53. package/lib/rules/no-nested-object-value/common/no-nested-object-value.type.d.ts.map +1 -0
  54. package/lib/rules/no-nested-object-value/no-nested-object-value.d.ts +7 -0
  55. package/lib/rules/no-nested-object-value/no-nested-object-value.d.ts.map +1 -0
  56. package/lib/rules/no-nested-object-value/utils/decorator-config.util.d.ts +3 -0
  57. package/lib/rules/no-nested-object-value/utils/decorator-config.util.d.ts.map +1 -0
  58. package/lib/rules/no-spread-expression/no-spread-expression.d.ts +6 -0
  59. package/lib/rules/no-spread-expression/no-spread-expression.d.ts.map +1 -0
  60. package/lib/rules/no-unstyled-classes/common/no-unstyled-classes.type.d.ts +33 -0
  61. package/lib/rules/no-unstyled-classes/common/no-unstyled-classes.type.d.ts.map +1 -0
  62. package/lib/rules/no-unstyled-classes/no-unstyled-classes.d.ts +8 -0
  63. package/lib/rules/no-unstyled-classes/no-unstyled-classes.d.ts.map +1 -0
  64. package/lib/rules/no-unstyled-classes/styles/component-stylesheets.d.ts +4 -0
  65. package/lib/rules/no-unstyled-classes/styles/component-stylesheets.d.ts.map +1 -0
  66. package/lib/rules/no-unstyled-classes/styles/linked-stylesheets.d.ts +3 -0
  67. package/lib/rules/no-unstyled-classes/styles/linked-stylesheets.d.ts.map +1 -0
  68. package/lib/rules/no-unstyled-classes/styles/stylesheet-classes.d.ts +3 -0
  69. package/lib/rules/no-unstyled-classes/styles/stylesheet-classes.d.ts.map +1 -0
  70. package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts +4 -0
  71. package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts.map +1 -0
  72. package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts +2 -0
  73. package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts.map +1 -0
  74. package/lib/rules/no-unstyled-classes/styles/template-stylesheets.d.ts +3 -0
  75. package/lib/rules/no-unstyled-classes/styles/template-stylesheets.d.ts.map +1 -0
  76. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-directive-index.d.ts +5 -0
  77. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-directive-index.d.ts.map +1 -1
  78. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-resolved-path.d.ts.map +1 -1
  79. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-resolution.d.ts +0 -1
  80. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-resolution.d.ts.map +1 -1
  81. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-reads.d.ts.map +1 -1
  82. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-references.d.ts.map +1 -1
  83. package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-index.type.d.ts +6 -8
  84. package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-index.type.d.ts.map +1 -1
  85. package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-usage.type.d.ts +3 -14
  86. package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-usage.type.d.ts.map +1 -1
  87. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-file-entry.d.ts.map +1 -1
  88. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-classes.d.ts +3 -2
  89. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-classes.d.ts.map +1 -1
  90. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-reconciliation.d.ts +1 -1
  91. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-reconciliation.d.ts.map +1 -1
  92. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-staleness.d.ts +8 -4
  93. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-staleness.d.ts.map +1 -1
  94. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-usage.d.ts +3 -2
  95. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-usage.d.ts.map +1 -1
  96. package/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-destructuring-reads.d.ts.map +1 -1
  97. package/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-reads.d.ts.map +1 -1
  98. package/lib/rules/no-unused-angular-instance-fields/project-usage/utils/class-members.util.d.ts +10 -0
  99. package/lib/rules/no-unused-angular-instance-fields/project-usage/utils/class-members.util.d.ts.map +1 -0
  100. package/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-class-fields.d.ts.map +1 -1
  101. package/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-imports.d.ts.map +1 -1
  102. package/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-managed-fields.d.ts.map +1 -1
  103. package/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-literals.d.ts.map +1 -1
  104. package/lib/rules/no-unused-angular-instance-fields/rule/common/no-unused-angular-instance-fields.type.d.ts +2 -1
  105. package/lib/rules/no-unused-angular-instance-fields/rule/common/no-unused-angular-instance-fields.type.d.ts.map +1 -1
  106. package/lib/rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.d.ts.map +1 -1
  107. package/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-class-read-visitor.d.ts.map +1 -1
  108. package/lib/rules/no-unused-classes/common/no-unused-classes.type.d.ts +24 -0
  109. package/lib/rules/no-unused-classes/common/no-unused-classes.type.d.ts.map +1 -0
  110. package/lib/rules/no-unused-classes/no-unused-classes.d.ts +8 -0
  111. package/lib/rules/no-unused-classes/no-unused-classes.d.ts.map +1 -0
  112. package/lib/rules/no-unused-classes/styles/linked-templates.d.ts +9 -0
  113. package/lib/rules/no-unused-classes/styles/linked-templates.d.ts.map +1 -0
  114. package/lib/rules/no-unused-classes/styles/stylesheet-components.d.ts +3 -0
  115. package/lib/rules/no-unused-classes/styles/stylesheet-components.d.ts.map +1 -0
  116. package/lib/rules/no-unused-classes/template/template-usage.d.ts +3 -0
  117. package/lib/rules/no-unused-classes/template/template-usage.d.ts.map +1 -0
  118. package/lib/rules/no-unused-exports/common/no-unused-exports.const.d.ts +7 -0
  119. package/lib/rules/no-unused-exports/common/no-unused-exports.const.d.ts.map +1 -0
  120. package/lib/rules/no-unused-exports/common/no-unused-exports.type.d.ts +70 -0
  121. package/lib/rules/no-unused-exports/common/no-unused-exports.type.d.ts.map +1 -0
  122. package/lib/rules/no-unused-exports/export-index.d.ts +6 -0
  123. package/lib/rules/no-unused-exports/export-index.d.ts.map +1 -0
  124. package/lib/rules/no-unused-exports/no-unused-exports.d.ts +7 -0
  125. package/lib/rules/no-unused-exports/no-unused-exports.d.ts.map +1 -0
  126. package/lib/rules/no-unused-exports/report-unused-exports.d.ts +12 -0
  127. package/lib/rules/no-unused-exports/report-unused-exports.d.ts.map +1 -0
  128. package/lib/rules/no-unused-exports/utils/aggregate-update.util.d.ts +4 -0
  129. package/lib/rules/no-unused-exports/utils/aggregate-update.util.d.ts.map +1 -0
  130. package/lib/rules/no-unused-exports/utils/export-edges.util.d.ts +5 -0
  131. package/lib/rules/no-unused-exports/utils/export-edges.util.d.ts.map +1 -0
  132. package/lib/rules/no-unused-exports/utils/export-nodes.util.d.ts +5 -0
  133. package/lib/rules/no-unused-exports/utils/export-nodes.util.d.ts.map +1 -0
  134. package/lib/rules/no-unused-exports/utils/export-usage.util.d.ts +4 -0
  135. package/lib/rules/no-unused-exports/utils/export-usage.util.d.ts.map +1 -0
  136. package/lib/rules/no-unused-exports/utils/exported-names.util.d.ts +3 -0
  137. package/lib/rules/no-unused-exports/utils/exported-names.util.d.ts.map +1 -0
  138. package/lib/rules/no-unused-exports/utils/file-changes.util.d.ts +4 -0
  139. package/lib/rules/no-unused-exports/utils/file-changes.util.d.ts.map +1 -0
  140. package/lib/rules/no-unused-exports/utils/module-edges.util.d.ts +4 -0
  141. package/lib/rules/no-unused-exports/utils/module-edges.util.d.ts.map +1 -0
  142. package/lib/rules/no-unused-exports/utils/module-target.util.d.ts +4 -0
  143. package/lib/rules/no-unused-exports/utils/module-target.util.d.ts.map +1 -0
  144. package/lib/rules/no-unused-exports/utils/public-exports.util.d.ts +3 -0
  145. package/lib/rules/no-unused-exports/utils/public-exports.util.d.ts.map +1 -0
  146. package/lib/rules/one-line-guard/one-line-guard.d.ts +10 -0
  147. package/lib/rules/one-line-guard/one-line-guard.d.ts.map +1 -0
  148. package/lib/rules/readonly-type-properties/readonly-type-properties.d.ts +2 -1
  149. package/lib/rules/readonly-type-properties/readonly-type-properties.d.ts.map +1 -1
  150. package/lib/rules/selector-classes.d.ts +7 -0
  151. package/lib/rules/selector-classes.d.ts.map +1 -0
  152. package/lib/rules/ternary-branch-shape/ternary-branch-shape.d.ts +6 -0
  153. package/lib/rules/ternary-branch-shape/ternary-branch-shape.d.ts.map +1 -0
  154. package/lib/rules/test-file-shape/common/test-file-shape.const.d.ts +14 -0
  155. package/lib/rules/test-file-shape/common/test-file-shape.const.d.ts.map +1 -0
  156. package/lib/rules/test-file-shape/common/test-file-shape.type.d.ts +7 -0
  157. package/lib/rules/test-file-shape/common/test-file-shape.type.d.ts.map +1 -0
  158. package/lib/rules/test-file-shape/mock-exports.d.ts +7 -0
  159. package/lib/rules/test-file-shape/mock-exports.d.ts.map +1 -0
  160. package/lib/rules/test-file-shape/stub-exports.d.ts +7 -0
  161. package/lib/rules/test-file-shape/stub-exports.d.ts.map +1 -0
  162. package/lib/rules/test-file-shape/test-file-shape.d.ts +7 -0
  163. package/lib/rules/test-file-shape/test-file-shape.d.ts.map +1 -0
  164. package/lib/rules/type-placement/common/type-placement.const.d.ts +5 -0
  165. package/lib/rules/type-placement/common/type-placement.const.d.ts.map +1 -0
  166. package/lib/rules/type-placement/common/type-placement.type.d.ts +7 -0
  167. package/lib/rules/type-placement/common/type-placement.type.d.ts.map +1 -0
  168. package/lib/rules/type-placement/type-placement.d.ts +7 -0
  169. package/lib/rules/type-placement/type-placement.d.ts.map +1 -0
  170. package/lib/rules/util-purity/common/util-purity.const.d.ts +10 -0
  171. package/lib/rules/util-purity/common/util-purity.const.d.ts.map +1 -0
  172. package/lib/rules/util-purity/common/util-purity.type.d.ts +7 -0
  173. package/lib/rules/util-purity/common/util-purity.type.d.ts.map +1 -0
  174. package/lib/rules/util-purity/util-purity.d.ts +7 -0
  175. package/lib/rules/util-purity/util-purity.d.ts.map +1 -0
  176. package/lib/rules/utils/class-expression-literals.util.d.ts +4 -0
  177. package/lib/rules/utils/class-expression-literals.util.d.ts.map +1 -0
  178. package/lib/rules/utils/enclosing-statement.util.d.ts +3 -0
  179. package/lib/rules/utils/enclosing-statement.util.d.ts.map +1 -0
  180. package/lib/rules/utils/glob-matcher.util.d.ts +3 -0
  181. package/lib/rules/utils/glob-matcher.util.d.ts.map +1 -0
  182. package/lib/rules/utils/indent-of.util.d.ts +3 -0
  183. package/lib/rules/utils/indent-of.util.d.ts.map +1 -0
  184. package/lib/rules/utils/resolved-rules.util.d.ts +5 -0
  185. package/lib/rules/utils/resolved-rules.util.d.ts.map +1 -0
  186. package/lib/rules/utils/template-classes.util.d.ts +3 -0
  187. package/lib/rules/utils/template-classes.util.d.ts.map +1 -0
  188. package/lib/rules/utils/template-links.util.d.ts +2 -0
  189. package/lib/rules/utils/template-links.util.d.ts.map +1 -0
  190. package/lib/rules/utils/to-regexp.util.d.ts +2 -0
  191. package/lib/rules/utils/to-regexp.util.d.ts.map +1 -0
  192. package/lib/typescript-local-plugin.d.ts.map +1 -1
  193. package/lib/typescript-safety.d.ts.map +1 -1
  194. package/lib/typescript.d.ts +0 -1
  195. package/lib/typescript.d.ts.map +1 -1
  196. package/lib/vitest.d.ts.map +1 -1
  197. package/package.json +4 -1
  198. package/prettier.cjs +6 -1
  199. package/prettier.cjs.map +3 -3
  200. package/prettier.d.ts.map +1 -1
  201. package/prettier.js +4 -1
  202. package/prettier.js.map +3 -3
  203. package/stylelint.cjs +884 -4
  204. package/stylelint.cjs.map +4 -4
  205. package/stylelint.d.ts.map +1 -1
  206. package/stylelint.js +918 -4
  207. package/stylelint.js.map +4 -4
package/eslint.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../packages/lint-suite/src/lib/angular-template.ts", "../../../../packages/lint-suite/src/lib/angular.ts", "../../../../packages/lint-suite/src/lib/rules/define-plugin.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-imports.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-member-candidates.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-managed-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-literals.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-template-parsing.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-expression-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/utils/angular-read-target.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-class-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-class-read-visitor.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-field-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-lexical-this.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-write-targets.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-usage.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-directive-index.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-resolution.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-resolved-path.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/type-property-symbols.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-chains.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-references.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/read-chain-text.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-angular-interface-methods.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-symbol-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-destructuring-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-assignment-pattern-elements.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-binding-pattern-elements.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-write-targets.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-type-dependencies.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-file-entry.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-component-discovery.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-component-scope.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-decorator-kind.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-metadata-values.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/spec-file.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-staleness.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-candidate-names.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-classes.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-reconciliation.ts", "../../../../packages/lint-suite/src/lib/base.ts", "../../../../packages/lint-suite/src/lib/base-limits.ts", "../../../../packages/lint-suite/src/lib/base-practices.ts", "../../../../packages/lint-suite/src/lib/base-recommended.ts", "../../../../packages/lint-suite/src/lib/boundaries.ts", "../../../../packages/lint-suite/src/lib/javascript.ts", "../../../../packages/lint-suite/src/lib/json.ts", "../../../../packages/lint-suite/src/lib/playwright.ts", "../../../../packages/lint-suite/src/lib/prettier.ts", "../../../../packages/lint-suite/src/lib/rxjs.ts", "../../../../packages/lint-suite/src/lib/storybook.ts", "../../../../packages/lint-suite/src/lib/typescript.ts", "../../../../packages/lint-suite/src/lib/typescript-consistency.ts", "../../../../packages/lint-suite/src/lib/typescript-imports.ts", "../../../../packages/lint-suite/src/lib/typescript-overrides.ts", "../../../../packages/lint-suite/src/lib/typescript-recommended.ts", "../../../../packages/lint-suite/src/lib/typescript-safety.ts", "../../../../packages/lint-suite/src/lib/rules/explicit-accessibility/explicit-accessibility.ts", "../../../../packages/lint-suite/src/lib/rules/explicit-accessibility/common/explicit-accessibility.const.ts", "../../../../packages/lint-suite/src/lib/rules/no-inline-object-types/no-inline-object-types.ts", "../../../../packages/lint-suite/src/lib/rules/readonly-type-properties/readonly-type-properties.ts", "../../../../packages/lint-suite/src/lib/typescript-local-plugin.ts", "../../../../packages/lint-suite/src/lib/vitest.ts", "../../../../packages/lint-suite/src/eslint.ts"],
4
- "sourcesContent": ["import { configs } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\n\nexport const angularTemplate = defineConfig([\n {\n files: ['**/*.html'],\n extends: [...configs.templateAccessibility, ...configs.templateRecommended],\n rules: {\n '@angular-eslint/template/prefer-template-literal': 'error',\n '@angular-eslint/template/no-any': 'error',\n '@angular-eslint/template/no-duplicate-attributes': 'error',\n '@angular-eslint/template/button-has-type': 'error',\n '@angular-eslint/template/no-positive-tabindex': 'error',\n '@angular-eslint/template/valid-aria': 'error',\n '@angular-eslint/template/alt-text': 'error',\n '@angular-eslint/template/elements-content': 'error',\n '@angular-eslint/template/click-events-have-key-events': 'error',\n '@angular-eslint/template/mouse-events-have-key-events': 'error',\n '@angular-eslint/template/table-scope': 'error',\n '@angular-eslint/template/no-autofocus': 'error',\n '@angular-eslint/template/no-distracting-elements': 'error',\n '@angular-eslint/template/prefer-control-flow': 'error',\n '@angular-eslint/template/prefer-self-closing-tags': 'error',\n '@angular-eslint/template/prefer-ngsrc': 'error',\n '@angular-eslint/template/prefer-built-in-pipes': 'error',\n '@angular-eslint/template/no-interpolation-in-attributes': 'error',\n '@angular-eslint/template/no-nested-tags': 'error',\n '@angular-eslint/template/use-track-by-function': 'error',\n '@angular-eslint/template/label-has-associated-control': 'error',\n '@angular-eslint/template/prefer-at-else': 'error', // v21: @if/@else syntax\n '@angular-eslint/template/prefer-at-empty': 'error', // v21: @for/@empty syntax\n '@angular-eslint/template/prefer-contextual-for-variables': 'error', // v21: Use $index, $first, etc.\n '@angular-eslint/template/no-empty-control-flow': 'error', // v21: Catch incomplete refactoring\n '@angular-eslint/template/prefer-class-binding': 'error', // v21.2.0: Prefer [class] over ngClass\n '@angular-eslint/template/prefer-static-string-properties': 'error', // Reduce change detection\n '@angular-eslint/template/no-non-null-assertion': 'error', // Forbid `!` assertions in templates\n '@angular-eslint/template/no-inline-styles': 'error', // Forbid inline style=\"...\" attributes\n '@angular-eslint/template/conditional-complexity': [\n 'warn',\n { maxComplexity: 5 }\n ], // Template readability\n '@angular-eslint/template/attributes-order': [\n 'error',\n {\n alphabetical: true,\n order: [\n 'STRUCTURAL_DIRECTIVE', // e.g. `*ngIf=\"true\"`, `*ngFor=\"let item of items\"`\n 'TEMPLATE_REFERENCE', // e.g. `<input #inputRef>`\n 'INPUT_BINDING', // e.g. `[id]=\"3\"`, `[attr.colspan]=\"colspan\"`, [style.width.%]=\"100\", [@triggerName]=\"expression\", `bind-id=\"handleChange()\"`\n 'TWO_WAY_BINDING', // e.g. `[(id)]=\"id\"`, `bindon-id=\"id\"\n 'ATTRIBUTE_BINDING', // e.g. `<input required>`, `id=\"3\"`\n 'OUTPUT_BINDING' // e.g. `(idChange)=\"handleChange()\"`, `on-id=\"handleChange()\"`\n ]\n }\n ]\n }\n }\n]);\n", "import { configs, processInlineTemplates } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\nimport globals from 'globals';\n\nimport { definePlugin } from './rules/define-plugin.util.ts';\nimport noUnusedInstanceFieldsRule from './rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.ts';\n\nexport const lintSuiteAngularPlugin = definePlugin('lint-suite-angular', {\n 'no-unused-instance-fields': noUnusedInstanceFieldsRule\n});\n\nexport const angular = defineConfig([\n {\n files: ['**/*.ts'],\n extends: [...configs.tsRecommended],\n plugins: {\n 'lint-suite-angular': lintSuiteAngularPlugin\n },\n languageOptions: {\n globals: {\n ...globals.browser,\n ...globals.es2025,\n ...globals.node\n },\n parserOptions: {\n projectService: true\n }\n },\n processor: processInlineTemplates,\n rules: {\n 'lint-suite-angular/no-unused-instance-fields': [\n 'error',\n { analysis: 'project' }\n ],\n '@angular-eslint/prefer-on-push-component-change-detection': 'error', // v22: flags only explicit opt-out of OnPush (omission now means OnPush)\n '@angular-eslint/prefer-signals': 'error',\n '@angular-eslint/use-injectable-provided-in': 'error',\n '@angular-eslint/prefer-signal-model': 'error',\n '@angular-eslint/no-uncalled-signals': 'error',\n '@angular-eslint/prefer-host-metadata-property': 'error',\n '@angular-eslint/no-implicit-take-until-destroyed': 'error', // v21.2.0: Enforce explicit DestroyRef\n '@angular-eslint/no-async-lifecycle-method': 'error', // Prevent async lifecycle hooks\n '@angular-eslint/prefer-output-readonly': 'warn', // Prevent accidental reassignment\n '@angular-eslint/prefer-output-emitter-ref': 'warn', // Modern output() function over @Output()\n '@angular-eslint/sort-lifecycle-methods': 'warn', // Consistent lifecycle method ordering\n '@angular-eslint/computed-must-return': 'error', // Catch silent computed() bugs missing a return\n '@angular-eslint/no-duplicates-in-metadata-arrays': 'error', // Catch duplicate imports/providers in @Component/@NgModule\n '@angular-eslint/no-lifecycle-call': 'error', // Forbid manual this.ngOnInit() calls\n '@angular-eslint/require-lifecycle-on-prototype': 'error', // Lifecycle hooks must be methods, not arrow-fn fields\n '@angular-eslint/relative-url-prefix': 'error', // Require ./ in templateUrl/styleUrl for portability\n '@angular-eslint/use-component-selector': 'error', // All components must declare a selector\n '@angular-eslint/no-developer-preview': 'warn', // Flag APIs marked @developerPreview (no breaking-change policy)\n '@angular-eslint/no-experimental': 'warn' // Flag APIs marked @experimental\n }\n }\n]);\n", "import type { TSESLint } from '@typescript-eslint/utils';\nimport type { CompatiblePlugin } from 'typescript-eslint';\n\ntype Rules = NonNullable<TSESLint.FlatConfig.Plugin['rules']>;\n\nexport const definePlugin = (name: string, rules: Rules): CompatiblePlugin => {\n const meta = { name };\n const plugin = { meta, rules };\n\n return plugin;\n};\n", "import { ESLintUtils } from '@typescript-eslint/utils';\nimport type {\n JSONSchema,\n ParserServicesWithTypeInformation,\n TSESLint,\n TSESTree\n} from '@typescript-eslint/utils';\n\nimport { reportUnusedMembers } from './angular/angular-class-fields.ts';\nimport { angularClassImports } from './angular/angular-imports.ts';\nimport type {\n ClassEntry,\n DynamicClasses,\n MessageIds,\n ProjectMemberUsed,\n ReportUnusedMembersOptions,\n RuleContext,\n RuleOptions\n} from './common/no-unused-angular-instance-fields.type.ts';\nimport { classReadVisitor } from './typescript/typescript-class-read-visitor.ts';\nimport type { ProjectUsageIndex } from '../project-usage/common/project-index.type.ts';\nimport {\n projectUsage,\n projectUsageIsCurrent\n} from '../project-usage/project-usage.ts';\nimport { isSpecFile } from '../project-usage/utils/spec-file.util.ts';\n\ntype Options = [RuleOptions];\ntype Analysis = NonNullable<RuleOptions['analysis']>;\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow unread instance fields and methods in Angular components and directives'\n};\n\nconst messages: Record<MessageIds, string> = {\n unusedField: \"Angular instance field '{{name}}' is never read.\",\n unusedMethod: \"Angular instance method '{{name}}' is never read.\"\n};\n\nconst allowEffectFieldsSchema: JSONSchema.JSONSchema4 = {\n type: 'boolean',\n description: 'Allow Angular effect() fields with automatic cleanup.'\n};\n\nconst analysisSchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['local', 'project'],\n description: 'Choose local-file or typed whole-project analysis.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n allowEffectFields: allowEffectFieldsSchema,\n analysis: analysisSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = {\n allowEffectFields: false,\n analysis: 'local'\n};\n\nconst defaultOptions: Options = [ruleDefaults];\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://eslint.org/docs/latest/rules/no-unused-private-class-members'\n);\n\nconst projectParserServices = (\n context: RuleContext,\n analysis: Analysis\n): ParserServicesWithTypeInformation | undefined => {\n if (analysis !== 'project') return undefined;\n\n try {\n return ESLintUtils.getParserServices(context);\n } catch {\n throw new Error(\n 'Project analysis requires parser services with type information.'\n );\n }\n};\n\nconst projectMemberUsedFor = (\n parserServices: ParserServicesWithTypeInformation | undefined\n): ProjectMemberUsed | undefined => {\n if (parserServices === undefined) return undefined;\n\n let usage: ProjectUsageIndex | null | undefined;\n\n const memberUsed = (node: TSESTree.ClassElement): boolean => {\n if (usage === undefined) {\n usage = projectUsage(parserServices.program);\n }\n\n return usage?.has(parserServices.esTreeNodeToTSNodeMap.get(node)) ?? true;\n };\n\n return memberUsed;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-unused-instance-fields',\n meta,\n defaultOptions,\n create(context, [options]): TSESLint.RuleListener {\n const analysis = options.analysis ?? 'local';\n const isSpec = isSpecFile(context.filename);\n const noListeners: TSESLint.RuleListener = {};\n\n if (analysis === 'project' && isSpec) return noListeners;\n\n const parserServices = projectParserServices(context, analysis);\n const imports = angularClassImports(context.sourceCode.ast);\n\n if (!imports) return noListeners;\n\n const classes: ClassEntry[] = [];\n const stack: ClassEntry[] = [];\n const dynamicClasses: DynamicClasses = new Set();\n\n const projectIndexed = (): boolean => {\n if (parserServices === undefined) return false;\n\n return projectUsageIsCurrent(parserServices.program);\n };\n\n const reportOptions: ReportUnusedMembersOptions = {\n allowEffectFields: options.allowEffectFields ?? false,\n classes,\n context,\n dynamicClasses,\n imports,\n projectIndexed,\n projectMemberUsed: projectMemberUsedFor(parserServices)\n };\n\n const readListeners = classReadVisitor(classes, stack, dynamicClasses);\n const listeners: TSESLint.RuleListener = {\n ...readListeners,\n 'Program:exit'(): void {\n reportUnusedMembers(reportOptions);\n }\n };\n\n return listeners;\n }\n});\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n AngularImport,\n AngularImports\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst calleeRoot = (\n node: TSESTree.Expression\n): TSESTree.Identifier | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) return node;\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.object.type === TSESTree.AST_NODE_TYPES.Super\n ) {\n return undefined;\n }\n\n return calleeRoot(node.object);\n};\n\nexport const angularName = (\n node: TSESTree.Expression,\n imports: AngularImports\n): AngularImport | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imports.get(node.name);\n }\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.computed ||\n node.property.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return null;\n }\n\n if (node.object.type === TSESTree.AST_NODE_TYPES.Identifier) {\n const namespaceAlias = imports.get(node.object.name);\n\n if (namespaceAlias === null) return node.property.name;\n }\n\n return angularName(node.object, imports);\n};\n\nexport const isImportBinding = (\n node: TSESTree.Expression,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const root = calleeRoot(node);\n\n if (!root) return false;\n\n for (\n let scope: TSESLint.Scope.Scope | null = sourceCode.getScope(root);\n scope;\n scope = scope.upper\n ) {\n const variable = scope.set.get(root.name);\n\n if (variable) return variable.defs[0]?.type === 'ImportBinding';\n }\n\n return false;\n};\n\nexport const addAngularImport = (\n node: TSESTree.ImportDeclaration,\n imports: AngularImports\n): void => {\n if (node.source.value !== '@angular/core' || node.importKind === 'type') {\n return;\n }\n\n for (const specifier of node.specifiers) {\n if (specifier.type === TSESTree.AST_NODE_TYPES.ImportNamespaceSpecifier) {\n imports.set(specifier.local.name, null);\n } else if (\n specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier &&\n specifier.importKind !== 'type'\n ) {\n const { imported } = specifier;\n const isIdentifier = imported.type === TSESTree.AST_NODE_TYPES.Identifier;\n const importedName = isIdentifier ? imported.name : imported.value;\n\n imports.set(specifier.local.name, importedName);\n }\n }\n};\n\nexport const angularClassMetadata = (\n node: AngularClassNode,\n imports: AngularImports\n): AngularClassMetadata | null => {\n for (const decorator of node.decorators) {\n if (decorator.expression.type !== TSESTree.AST_NODE_TYPES.CallExpression) {\n continue;\n }\n\n const kind = angularName(decorator.expression.callee, imports);\n const metadata = decorator.expression.arguments.at(0);\n\n const isComponentOrDirective = kind === 'Component' || kind === 'Directive';\n\n if (\n isComponentOrDirective &&\n metadata?.type === TSESTree.AST_NODE_TYPES.ObjectExpression\n ) {\n const classMetadata: AngularClassMetadata | null = {\n component: kind === 'Component',\n metadata\n };\n\n return classMetadata;\n }\n }\n\n return null;\n};\n\nexport const angularClassImports = (\n ast: TSESTree.Program\n): AngularImports | null => {\n const imports: AngularImports = new Map();\n\n for (const node of ast.body) {\n if (node.type === TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n addAngularImport(node, imports);\n }\n }\n\n for (const imported of imports.values()) {\n const isNamespaceImport = imported === null;\n const isComponent = imported === 'Component';\n const isDirective = imported === 'Directive';\n const isAngularClassImport =\n isNamespaceImport || isComponent || isDirective;\n\n if (isAngularClassImport) return imports;\n }\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n isAngularComponentRefField,\n isManagedField\n} from './angular-managed-fields.ts';\nimport type {\n AngularClassNode,\n FieldCandidateOptions,\n InstanceField,\n InstanceMethod,\n MemberCandidate\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst lifecycleHooks: ReadonlySet<string> = new Set([\n 'ngOnChanges',\n 'ngOnInit',\n 'ngDoCheck',\n 'ngAfterContentInit',\n 'ngAfterContentChecked',\n 'ngAfterViewInit',\n 'ngAfterViewChecked',\n 'ngOnDestroy'\n]);\n\nconst formsInterfaceMethods: Readonly<Record<string, string[]>> = {\n AsyncValidator: ['validate', 'registerOnValidatorChange'],\n ControlValueAccessor: [\n 'writeValue',\n 'registerOnChange',\n 'registerOnTouched',\n 'setDisabledState'\n ],\n Validator: ['validate', 'registerOnValidatorChange']\n};\n\nconst isInstanceField = (\n node: TSESTree.ClassElement\n): node is InstanceField => {\n if (node.type !== TSESTree.AST_NODE_TYPES.PropertyDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isInstanceMethod = (\n node: TSESTree.ClassElement\n): node is InstanceMethod => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isExcludedField = (\n node: InstanceField,\n localPrivateOnly: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const isModified = node.static || node.declare || node.override;\n const isDecorated = node.decorators.length > 0;\n\n if (isModified || isDecorated) return true;\n\n const isComponentRef = isAngularComponentRefField(node, sourceCode);\n\n if (isComponentRef) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nconst isExcludedMethod = (\n node: InstanceMethod,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): boolean => {\n const isModified = node.static || node.override || node.computed;\n const isDecorated = node.decorators.length > 0;\n const isPlainMethod = node.kind === 'method';\n\n if (isModified || isDecorated || !isPlainMethod) return true;\n\n const hasNoBody = node.value.body === null;\n const isLifecycleHook = lifecycleHooks.has(node.key.name);\n\n if (hasNoBody || isLifecycleHook) return true;\n\n const isImplemented = implementedMethods.has(node.key.name);\n\n if (isImplemented) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nexport const implementedFormsMethods = (\n node: AngularClassNode\n): Set<string> => {\n const methods = new Set<string>();\n\n for (const heritage of node.implements) {\n if (heritage.expression.type !== TSESTree.AST_NODE_TYPES.Identifier) {\n continue;\n }\n\n for (const name of formsInterfaceMethods[heritage.expression.name] ?? []) {\n methods.add(name);\n }\n }\n\n return methods;\n};\n\nexport const fieldCandidate = (\n node: TSESTree.ClassElement,\n options: FieldCandidateOptions\n): MemberCandidate | null => {\n const isField = isInstanceField(node);\n\n if (!isField) return null;\n\n const { localPrivateOnly, sourceCode } = options;\n const isExcluded = isExcludedField(node, localPrivateOnly, sourceCode);\n\n if (isExcluded) return null;\n\n const isManaged = isManagedField(\n node,\n options.imports,\n options.allowEffectFields,\n sourceCode\n );\n\n if (isManaged) return null;\n\n const unusedFieldCandidate: MemberCandidate | null = {\n messageId: 'unusedField',\n name: node.key.name,\n node\n };\n\n return unusedFieldCandidate;\n};\n\nexport const methodCandidate = (\n node: TSESTree.ClassElement,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): MemberCandidate | null => {\n const isMethod = isInstanceMethod(node);\n\n if (!isMethod) return null;\n\n const isExcluded = isExcludedMethod(\n node,\n localPrivateOnly,\n implementedMethods\n );\n\n if (isExcluded) return null;\n\n const unusedMethodCandidate: MemberCandidate | null = {\n messageId: 'unusedMethod',\n name: node.key.name,\n node\n };\n\n return unusedMethodCandidate;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularName, isImportBinding } from './angular-imports.ts';\nimport type {\n AngularImports,\n InstanceField\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst managedApis: ReadonlySet<string> = new Set([\n 'input',\n 'model',\n 'output',\n 'viewChild',\n 'viewChildren',\n 'contentChild',\n 'contentChildren'\n]);\n\nconst hasAutomaticEffectCleanup = (node: TSESTree.CallExpression): boolean => {\n const options = node.arguments.at(1);\n\n if (options === undefined) return true;\n\n if (options.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n return options.properties.every((property) => {\n if (\n property.type !== TSESTree.AST_NODE_TYPES.Property ||\n property.computed\n ) {\n return false;\n }\n\n const manualCleanup =\n (property.key.type === TSESTree.AST_NODE_TYPES.Identifier &&\n property.key.name === 'manualCleanup') ||\n (property.key.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.key.value === 'manualCleanup');\n\n return (\n !manualCleanup ||\n (property.value.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.value.value === false)\n );\n });\n};\n\nconst angularCoreImportedName = (\n definition: TSESLint.Scope.Definition | undefined\n): string | null => {\n if (definition?.type !== 'ImportBinding') return null;\n\n if (definition.node.type !== TSESTree.AST_NODE_TYPES.ImportSpecifier) {\n return null;\n }\n\n if (definition.parent.type !== TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n return null;\n }\n\n if (definition.parent.source.value !== '@angular/core') return null;\n\n const { imported } = definition.node;\n\n if (imported.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imported.name;\n }\n\n return imported.value;\n};\n\nexport const isAngularComponentRefField = (\n node: InstanceField,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const type = node.typeAnnotation?.typeAnnotation;\n\n if (\n type?.type !== TSESTree.AST_NODE_TYPES.TSTypeReference ||\n type.typeName.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return false;\n }\n\n const reference = sourceCode\n .getScope(type.typeName)\n .references.find(({ identifier }) => identifier === type.typeName);\n const definition = reference?.resolved?.defs[0];\n\n return angularCoreImportedName(definition) === 'ComponentRef';\n};\n\nexport const isManagedField = (\n node: InstanceField,\n imports: AngularImports,\n allowEffectFields: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n if (node.value?.type !== TSESTree.AST_NODE_TYPES.CallExpression) return false;\n\n const name = angularName(node.value.callee, imports);\n const isString = typeof name === 'string';\n\n if (!isString) return false;\n\n const isManagedApi = managedApis.has(name);\n\n if (isManagedApi) return true;\n\n if (!allowEffectFields) return false;\n\n if (name !== 'effect') return false;\n\n const isImported = isImportBinding(node.value.callee, sourceCode);\n\n if (!isImported) return false;\n\n return hasAutomaticEffectCleanup(node.value);\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport { TSESTree } from '@typescript-eslint/utils';\n\nimport { key, metadataValue, text } from './angular-metadata-literals.ts';\nimport {\n expressionReads,\n externalTemplateReads,\n templateReads\n} from './angular-template-parsing.ts';\nimport type { MetadataReadsOptions } from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst addReads = (target: Set<string>, source: Set<string> | null): boolean => {\n if (!source) return false;\n\n for (const name of source) {\n target.add(name);\n }\n\n return true;\n};\n\nconst hostPropertyReads = (\n property: TSESTree.Property,\n reads: Set<string>,\n filename: string\n): boolean => {\n const name = key(property);\n const expression = text(property.value);\n\n if (name === null || expression === null) return false;\n\n const isPropertyBinding = name.startsWith('[');\n\n if (isPropertyBinding) {\n return addReads(reads, expressionReads(expression, filename, false));\n }\n\n const isEventBinding = name.startsWith('(');\n\n if (isEventBinding) {\n return addReads(reads, expressionReads(expression, filename, true));\n }\n\n return true;\n};\n\nconst hostReads = (\n host: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!host) return true;\n\n if (host.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n const hasUnreadableKey = host.properties.some(\n (property) => key(property) === null\n );\n\n if (hasUnreadableKey) return false;\n\n for (const property of host.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) return false;\n\n const hasPropertyReads = hostPropertyReads(property, reads, filename);\n\n if (!hasPropertyReads) return false;\n }\n\n return true;\n};\n\nconst inlineTemplateReads = (\n template: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!template) return true;\n\n const source = text(template);\n\n return source !== null && addReads(reads, templateReads(source, filename));\n};\n\nconst externalTemplatePropertyReads = (\n templateUrl: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!templateUrl) return true;\n\n const url = text(templateUrl);\n\n return (\n url !== null &&\n addReads(reads, externalTemplateReads(resolve(dirname(filename), url)))\n );\n};\n\nconst componentTemplateReads = (\n metadata: TSESTree.ObjectExpression,\n reads: Set<string>,\n filename: string\n): boolean => {\n const template = metadataValue(metadata, 'template');\n const templateUrl = metadataValue(metadata, 'templateUrl');\n\n return (\n inlineTemplateReads(template, reads, filename) &&\n externalTemplatePropertyReads(templateUrl, reads, filename)\n );\n};\n\n/**\n * Names read by a class's host bindings and, for components, its template.\n * Returns null when the metadata cannot be read statically; with\n * `requireTemplate` false an unreadable template keeps the host reads\n * instead, for callers that resolve template reads elsewhere.\n */\nexport const metadataReads = (\n options: MetadataReadsOptions\n): Set<string> | null => {\n const { filename, metadata } = options;\n const isUnreadableKey = (\n property: TSESTree.ObjectLiteralElement\n ): boolean => {\n return key(property) === null;\n };\n const hasUnreadableKey = metadata.properties.some(isUnreadableKey);\n\n if (hasUnreadableKey) return null;\n\n const reads = new Set<string>();\n const hostValue = metadataValue(metadata, 'host');\n const hasHostReads = hostReads(hostValue, reads, filename);\n\n if (!hasHostReads) return null;\n\n if (!options.component) return reads;\n\n const isRead = (name: string): boolean => reads.has(name);\n const hasRemainingReads = options.remainingNames.every(isRead);\n\n if (hasRemainingReads) return reads;\n\n const hasTemplateReads = componentTemplateReads(metadata, reads, filename);\n\n if (hasTemplateReads) return reads;\n\n if (!options.requireTemplate) return reads;\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nexport const text = (node: TSESTree.Node | null | undefined): string | null => {\n if (\n node?.type === TSESTree.AST_NODE_TYPES.Literal &&\n typeof node.value === 'string'\n ) {\n return node.value;\n }\n\n if (node?.type !== TSESTree.AST_NODE_TYPES.TemplateLiteral) return null;\n\n const hasExpressions = node.expressions.length > 0;\n\n if (hasExpressions) return null;\n\n return node.quasis[0].value.cooked;\n};\n\nexport const key = (property: TSESTree.ObjectLiteralElement): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n return text(property.key);\n};\n\nexport const metadataValue = (\n metadata: TSESTree.ObjectExpression,\n name: string\n): TSESTree.Property['value'] | undefined => {\n for (const property of metadata.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) continue;\n\n const propertyKey = key(property);\n\n if (propertyKey === name) return property.value;\n }\n\n return undefined;\n};\n", "import {\n Lexer,\n ParseLocation,\n ParseSourceFile,\n ParseSourceSpan,\n Parser,\n R3TargetBinder,\n parseTemplate\n} from '@angular/compiler';\nimport type { ASTWithSource, DirectiveMeta } from '@angular/compiler';\n\nimport { readFileSync, statSync } from 'node:fs';\n\nimport { collectAngularExpressionReads } from './angular-expression-reads.ts';\n\ntype ExternalTemplateCache = {\n readonly reads: Set<string> | null;\n readonly version: string;\n};\n\nconst externalTemplates = new Map<string, ExternalTemplateCache>();\nconst parser = new Parser(new Lexer());\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\n\nexport const templateReads = (\n template: string,\n filename: string\n): Set<string> | null => {\n try {\n const result = parseTemplate(template, filename);\n\n if (result.errors?.length) return null;\n\n return collectAngularExpressionReads(\n result.nodes,\n templateBinder.bind({ template: result.nodes }),\n false\n );\n } catch {\n return null;\n }\n};\n\nexport const externalTemplateReads = (filename: string): Set<string> | null => {\n try {\n const stats = statSync(filename, { bigint: true });\n const version = `${stats.mtimeNs}:${stats.size}`;\n const cached = externalTemplates.get(filename);\n\n if (cached?.version === version) return cached.reads;\n\n const reads = templateReads(readFileSync(filename, 'utf8'), filename);\n\n externalTemplates.set(filename, { reads, version });\n\n return reads;\n } catch {\n return null;\n }\n};\n\nconst parseExpression = (\n expression: string,\n span: ParseSourceSpan,\n action: boolean\n): ASTWithSource => {\n if (action) return parser.parseAction(expression, span, 0);\n\n return parser.parseBinding(expression, span, 0);\n};\n\nexport const expressionReads = (\n expression: string,\n filename: string,\n action: boolean\n): Set<string> | null => {\n try {\n const file = new ParseSourceFile(expression, filename);\n const start = new ParseLocation(file, 0, 0, 0);\n const span = new ParseSourceSpan(start, start.moveBy(expression.length));\n const result = parseExpression(expression, span, action);\n\n if (result.errors.length > 0) return null;\n\n return collectAngularExpressionReads([result], undefined, action);\n } catch {\n return null;\n }\n};\n", "import {\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n SafeKeyedRead,\n ThisReceiver\n} from '@angular/compiler';\nimport type {\n Binary,\n BoundTarget,\n DirectiveMeta,\n PropertyRead,\n SafePropertyRead\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\n\ntype VisitableNode = Parameters<CombinedRecursiveAstVisitor['visit']>[0];\n\nclass ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads = new Set<string>();\n private readonly boundTarget: BoundTarget<DirectiveMeta> | undefined;\n private readonly action: boolean;\n\n public constructor(\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n ) {\n super();\n this.boundTarget = boundTarget;\n this.action = action;\n }\n\n private record(node: PropertyRead | SafePropertyRead): void {\n if (node.receiver instanceof ThisReceiver) {\n this.reads.add(node.name);\n\n return;\n }\n\n if (!(node.receiver instanceof ImplicitReceiver)) return;\n\n const isBindableName = !this.action || node.name !== '$event';\n\n if (!isBindableName) return;\n\n const expressionTarget = this.boundTarget?.getExpressionTarget(node);\n\n if (expressionTarget) return;\n\n this.reads.add(node.name);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n\nexport const collectAngularExpressionReads = (\n nodes: VisitableNode[],\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n): Set<string> => {\n const collector = new ReadCollector(boundTarget, action);\n\n for (const node of nodes) {\n collector.visit(node);\n }\n\n return collector.reads;\n};\n", "import {\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead\n} from '@angular/compiler';\nimport type { AST } from '@angular/compiler';\n\nexport const isReadTarget = (\n node: AST\n): node is PropertyRead | SafePropertyRead | KeyedRead | SafeKeyedRead => {\n const isPropertyRead = node instanceof PropertyRead;\n const isSafePropertyRead = node instanceof SafePropertyRead;\n const isKeyedRead = node instanceof KeyedRead;\n const isSafeKeyedRead = node instanceof SafeKeyedRead;\n\n return isPropertyRead || isSafePropertyRead || isKeyedRead || isSafeKeyedRead;\n};\n", "import type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularClassMetadata } from './angular-imports.ts';\nimport {\n fieldCandidate,\n implementedFormsMethods,\n methodCandidate\n} from './angular-member-candidates.ts';\nimport { metadataReads } from './angular-metadata-reads.ts';\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n ClassEntry,\n FieldCandidateOptions,\n MemberCandidate,\n MessageIds,\n MetadataReadsOptions,\n ReportContext,\n ReportUnusedMembersOptions\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype ClassReportOptions = {\n readonly localTemplates: boolean;\n readonly options: ReportUnusedMembersOptions;\n readonly projectAnalysis: boolean;\n};\n\nconst memberCandidates = (\n node: AngularClassNode,\n options: FieldCandidateOptions\n): MemberCandidate[] => {\n const implementedMethods = implementedFormsMethods(node);\n const members: MemberCandidate[] = [];\n\n for (const element of node.body.body) {\n const candidate =\n fieldCandidate(element, options) ??\n methodCandidate(element, options.localPrivateOnly, implementedMethods);\n\n if (candidate) {\n members.push(candidate);\n }\n }\n\n return members;\n};\n\nconst reportMember = (\n context: ReportContext,\n candidate: MemberCandidate\n): void => {\n const data = { name: candidate.name };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n data,\n messageId: candidate.messageId,\n node: candidate.node.key\n };\n\n context.report(report);\n};\n\nconst reportUnreadMembers = (\n members: MemberCandidate[],\n reads: Set<string>,\n options: ReportUnusedMembersOptions\n): void => {\n for (const candidate of members) {\n const isTemplateRead = reads.has(candidate.name);\n\n if (isTemplateRead) continue;\n\n const isProjectUsed = options.projectMemberUsed?.(candidate.node) === true;\n\n if (isProjectUsed) continue;\n\n reportMember(options.context, candidate);\n }\n};\n\nconst reportClassMembers = (\n entry: ClassEntry,\n ngClass: AngularClassMetadata,\n report: ClassReportOptions\n): void => {\n const { options, projectAnalysis } = report;\n const isLocalOnlyClass = !ngClass.component || entry.node.abstract === true;\n const candidateOptions: FieldCandidateOptions = {\n allowEffectFields: options.allowEffectFields,\n imports: options.imports,\n localPrivateOnly: !projectAnalysis && isLocalOnlyClass,\n sourceCode: options.context.sourceCode\n };\n const members = memberCandidates(entry.node, candidateOptions);\n const unreadMembers = members.filter(\n (candidate) => !entry.reads.has(candidate.name)\n );\n\n if (unreadMembers.length === 0) return;\n\n const remainingNames = unreadMembers.map((candidate) => candidate.name);\n const readsOptions: MetadataReadsOptions = {\n component: ngClass.component && report.localTemplates,\n filename: options.context.filename,\n metadata: ngClass.metadata,\n remainingNames,\n requireTemplate: !projectAnalysis\n };\n const reads = metadataReads(readsOptions);\n\n if (!reads) return;\n\n reportUnreadMembers(unreadMembers, reads, options);\n};\n\nexport const reportUnusedMembers = (\n options: ReportUnusedMembersOptions\n): void => {\n const projectAnalysis = options.projectMemberUsed !== undefined;\n const localTemplates = !projectAnalysis || !options.projectIndexed();\n const report: ClassReportOptions = {\n localTemplates,\n options,\n projectAnalysis\n };\n\n for (const entry of options.classes) {\n const ngClass = angularClassMetadata(entry.node, options.imports);\n const isDynamicClass = options.dynamicClasses.has(entry);\n\n if (!ngClass || isDynamicClass) continue;\n\n reportClassMembers(entry, ngClass, report);\n }\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n destructuredThisReads,\n isThisExpression\n} from './typescript-field-reads.ts';\nimport { lexicalThisVisitor } from './typescript-lexical-this.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type {\n AngularClassNode,\n ClassEntry,\n DynamicClasses\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\nconst enterClass = (\n node: AngularClassNode,\n classes: ClassEntry[],\n stack: ClassEntry[],\n thisStack: boolean[]\n): void => {\n const entry: ClassEntry = {\n node,\n reads: new Set<string>()\n };\n\n classes.push(entry);\n stack.push(entry);\n thisStack.push(true);\n};\n\nconst trackMemberRead = (\n node: TSESTree.MemberExpression,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const receiverIsThis = isThisExpression(node.object);\n\n if (node.computed && receiverIsThis) {\n dynamicClasses.add(current);\n }\n\n if (!receiverIsThis || node.computed) return;\n\n const isWriteOnlyTarget = isWriteOnly(node);\n\n if (isWriteOnlyTarget) return;\n\n if (node.property.type === TSESTree.AST_NODE_TYPES.Identifier) {\n current.reads.add(node.property.name);\n }\n};\n\nconst trackDestructuringRead = (\n node: DestructuringNode,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const reads = destructuredThisReads(node);\n\n if (reads === undefined) return;\n\n if (reads === null) {\n dynamicClasses.add(current);\n\n return;\n }\n\n for (const name of reads) {\n current.reads.add(name);\n }\n};\n\nexport const classReadVisitor = (\n classes: ClassEntry[],\n stack: ClassEntry[],\n dynamicClasses: DynamicClasses\n): TSESLint.RuleListener => {\n const thisStack: boolean[] = [];\n\n const listeners: TSESLint.RuleListener = {\n ClassDeclaration(node: TSESTree.ClassDeclaration): void {\n enterClass(node, classes, stack, thisStack);\n },\n ClassExpression(node: TSESTree.ClassExpression): void {\n enterClass(node, classes, stack, thisStack);\n },\n 'ClassDeclaration:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n 'ClassExpression:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n ...lexicalThisVisitor(thisStack),\n AssignmentExpression(node: TSESTree.AssignmentExpression): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n },\n MemberExpression(node: TSESTree.MemberExpression): void {\n trackMemberRead(node, stack, thisStack, dynamicClasses);\n },\n VariableDeclarator(node: TSESTree.VariableDeclarator): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\ntype TypeScriptExpressionWrapper =\n | TSESTree.TSAsExpression\n | TSESTree.TSInstantiationExpression\n | TSESTree.TSNonNullExpression\n | TSESTree.TSSatisfiesExpression\n | TSESTree.TSTypeAssertion;\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\ntype DestructuringParts = {\n readonly pattern: TSESTree.BindingName | TSESTree.Expression;\n readonly source: TSESTree.Expression | null;\n};\n\nconst expressionWrapperTypes: ReadonlySet<TSESTree.AST_NODE_TYPES> = new Set([\n TSESTree.AST_NODE_TYPES.TSAsExpression,\n TSESTree.AST_NODE_TYPES.TSInstantiationExpression,\n TSESTree.AST_NODE_TYPES.TSNonNullExpression,\n TSESTree.AST_NODE_TYPES.TSSatisfiesExpression,\n TSESTree.AST_NODE_TYPES.TSTypeAssertion\n]);\n\nexport const isTypeScriptExpressionWrapper = (\n node: TSESTree.Node\n): node is TypeScriptExpressionWrapper => {\n return expressionWrapperTypes.has(node.type);\n};\n\nconst unwrapTypeScriptExpression = (\n node: TSESTree.Expression | null\n): TSESTree.Expression | null => {\n let current = node;\n\n while (current && isTypeScriptExpressionWrapper(current)) {\n current = current.expression;\n }\n\n return current;\n};\n\nexport const isThisExpression = (node: TSESTree.Expression | null): boolean => {\n const unwrapped = unwrapTypeScriptExpression(node);\n\n return unwrapped?.type === TSESTree.AST_NODE_TYPES.ThisExpression;\n};\n\nconst destructuringParts = (\n node: DestructuringNode\n): DestructuringParts | null => {\n if (node.type === TSESTree.AST_NODE_TYPES.VariableDeclarator) {\n const variableParts: DestructuringParts | null = {\n pattern: node.id,\n source: node.init\n };\n\n return variableParts;\n }\n\n if (node.operator === '=') {\n const assignmentParts: DestructuringParts | null = {\n pattern: node.left,\n source: node.right\n };\n\n return assignmentParts;\n }\n\n return null;\n};\n\nconst propertyName = (\n property: TSESTree.Property | TSESTree.RestElement\n): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n const { value } = property.key;\n\n if (typeof value !== 'string') return null;\n\n return value;\n};\n\nexport const destructuredThisReads = (\n node: DestructuringNode\n): string[] | null | undefined => {\n const parts = destructuringParts(node);\n\n if (!parts) return undefined;\n\n if (parts.pattern.type !== TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return undefined;\n }\n\n const isThisSource = isThisExpression(parts.source);\n\n if (!isThisSource) return undefined;\n\n const reads: string[] = [];\n\n for (const property of parts.pattern.properties) {\n const name = propertyName(property);\n\n if (name === null) return null;\n\n reads.push(name);\n }\n\n return reads;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype FunctionNode =\n | TSESTree.ArrowFunctionExpression\n | TSESTree.FunctionDeclaration\n | TSESTree.FunctionExpression;\n\nconst componentThis = (node: FunctionNode, thisStack: boolean[]): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.ArrowFunctionExpression) {\n return thisStack.at(-1) ?? false;\n }\n\n const { parent } = node;\n\n if (parent.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return !parent.static;\n};\n\nexport const lexicalThisVisitor = (\n thisStack: boolean[]\n): TSESLint.RuleListener => {\n const listeners: TSESLint.RuleListener = {\n FunctionDeclaration(node: TSESTree.FunctionDeclaration): void {\n thisStack.push(componentThis(node, thisStack));\n },\n FunctionExpression(node: TSESTree.FunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n 'FunctionDeclaration:exit'(): void {\n thisStack.pop();\n },\n 'FunctionExpression:exit'(): void {\n thisStack.pop();\n },\n 'ArrowFunctionExpression:exit'(): void {\n thisStack.pop();\n },\n StaticBlock(): void {\n thisStack.push(false);\n },\n 'StaticBlock:exit'(): void {\n thisStack.pop();\n },\n PropertyDefinition(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.push(false);\n }\n },\n 'PropertyDefinition:exit'(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.pop();\n }\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nimport { isTypeScriptExpressionWrapper } from './typescript-field-reads.ts';\n\nconst parentOf = (node: TSESTree.Node): TSESTree.Node | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Program) return undefined;\n\n return node.parent;\n};\n\nconst isPatternTarget = (\n parent: TSESTree.Node | undefined,\n child: TSESTree.Node\n): boolean => {\n if (parent === undefined) return false;\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ArrayPattern) {\n return parent.elements.some((element) => element === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parent.left === child;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return parent.properties.some((property) => property === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.Property) {\n const isObjectPattern =\n parent.parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern;\n\n return parent.value === child && isObjectPattern;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.RestElement) {\n return parent.argument === child;\n }\n\n return false;\n};\n\nconst isSimpleAssignmentTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n if (parent?.type !== TSESTree.AST_NODE_TYPES.AssignmentExpression) {\n return false;\n }\n\n return parent.left === current && parent.operator === '=';\n};\n\nconst isLoopTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n const isForIn = parent?.type === TSESTree.AST_NODE_TYPES.ForInStatement;\n const isForOf = parent?.type === TSESTree.AST_NODE_TYPES.ForOfStatement;\n const isLoop = isForIn || isForOf;\n\n if (!isLoop) return false;\n\n return parent.left === current;\n};\n\nconst isWrapping = (parent: TSESTree.Node, child: TSESTree.Node): boolean => {\n const isWrapper = isTypeScriptExpressionWrapper(parent);\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isDirectWrite = (node: TSESTree.MemberExpression): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n\n while (\n parent &&\n isTypeScriptExpressionWrapper(parent) &&\n parent.expression === current\n ) {\n current = parent;\n parent = parentOf(parent);\n }\n\n const isDeleteExpression =\n parent?.type === TSESTree.AST_NODE_TYPES.UnaryExpression &&\n parent.operator === 'delete';\n const isAssignment = isSimpleAssignmentTarget(parent, current);\n\n return isAssignment || isDeleteExpression;\n};\n\nconst isDestructuringOrLoopTarget = (\n node: TSESTree.MemberExpression\n): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n let patternTarget = false;\n\n while (parent) {\n const wrapper = isWrapping(parent, current);\n const pattern = isPatternTarget(parent, current);\n\n if (!wrapper && !pattern) break;\n\n if (pattern) {\n patternTarget = true;\n }\n\n current = parent;\n parent = parentOf(parent);\n }\n\n const isSimpleTarget = isSimpleAssignmentTarget(parent, current);\n const isAssignedPattern = patternTarget && isSimpleTarget;\n\n return isAssignedPattern || isLoopTarget(parent, current);\n};\n\nexport const isWriteOnly = (node: TSESTree.MemberExpression): boolean => {\n const isWrite = isDirectWrite(node);\n\n if (isWrite) return true;\n\n return isDestructuringOrLoopTarget(node);\n};\n", "import { isClassElement, isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { Node, Program } from 'typescript';\n\nimport { buildDirectiveIndex } from './angular/angular-directive-index.ts';\nimport type {\n ProjectIndex,\n ProjectUsageIndex\n} from './common/project-index.type.ts';\nimport { reconcile } from './project-index-reconciliation.ts';\n\nconst indexes = new Map<string, ProjectIndex>();\n\nconst memberName = (node: Node): string | null => {\n const isMember = isClassElement(node);\n\n if (!isMember) return null;\n\n if (!node.name) return null;\n\n const isIdentifierName = isIdentifier(node.name);\n const isStringName = isStringLiteralLike(node.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (!isNamedMember) return null;\n\n return node.name.text;\n};\n\nconst usageOf = (index: ProjectIndex): ProjectUsageIndex => {\n if (index.usage !== undefined) return index.usage;\n\n const declarations = new Set<Node>();\n const fallbackNames = new Set<string>();\n\n for (const entry of index.entries.values()) {\n for (const declaration of entry.declarations) {\n declarations.add(declaration);\n }\n\n for (const name of entry.fallbackNames) {\n fallbackNames.add(name);\n }\n }\n\n index.usage = {\n has: (node): boolean => {\n const hasDeclaration = declarations.has(node);\n\n if (hasDeclaration) return true;\n\n if (fallbackNames.size === 0) return false;\n\n const name = memberName(node);\n\n return name !== null && fallbackNames.has(name);\n }\n };\n\n return index.usage;\n};\n\nconst createIndex = (): ProjectIndex => {\n const emptyIndex: ProjectIndex = {\n candidateNames: new Set(),\n classes: new Map(),\n directives: buildDirectiveIndex([]),\n directiveShape: '',\n entries: new Map(),\n program: null,\n templateCheckDuration: 0,\n templateCheckedAt: 0,\n usage: undefined\n };\n\n return emptyIndex;\n};\n\n/**\n * True when the index already reflects this exact Program, so callers can\n * skip local work the index duplicates (such as parsing a component's own\n * template) without ever triggering a build.\n */\nexport const projectUsageIsCurrent = (program: Program): boolean => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n return (\n typeof configFilePath === 'string' &&\n indexes.get(configFilePath)?.program === program\n );\n};\n\n/**\n * Member declarations read anywhere in the Program's non-spec TypeScript\n * and Angular templates, or null when the project cannot be indexed\n * reliably. Indexes are kept per tsconfig and updated incrementally: a new\n * Program (an edit in the editor) only re-indexes the files that changed\n * and the files whose resolutions depended on them.\n */\nexport const projectUsage = (program: Program): ProjectUsageIndex | null => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n if (typeof configFilePath !== 'string') return null;\n\n let index = indexes.get(configFilePath);\n\n if (!index) {\n index = createIndex();\n indexes.set(configFilePath, index);\n }\n\n try {\n reconcile(index, program);\n\n return usageOf(index);\n } catch {\n indexes.delete(configFilePath);\n\n return null;\n }\n};\n", "import { CssSelector, SelectorMatcher } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport type {\n AngularClass,\n DirectiveIndex\n} from '../common/project-usage.type.ts';\n\n/**\n * A description of every directive's selector and exportAs; when it changes\n * between programs, cached template reference resolutions are stale.\n */\nconst classShape = ({\n component,\n declaration,\n exportAs,\n hostDirectives,\n name,\n selector\n}: AngularClass): string => {\n const fields = [\n declaration.getSourceFile().fileName,\n name,\n String(component),\n String(hostDirectives),\n selector ?? '',\n exportAs.join(',')\n ];\n\n return fields.join('\\0');\n};\n\nexport const directiveShape = (classes: Iterable<AngularClass>): string => {\n const shapes = [...classes].map(classShape);\n\n return shapes.sort().join('\\n');\n};\n\nconst parseSelector = (selector: string): CssSelector[] | null => {\n try {\n return CssSelector.parse(selector);\n } catch {\n return null;\n }\n};\n\nexport const buildDirectiveIndex = (\n classes: Iterable<AngularClass>\n): DirectiveIndex => {\n const byDeclaration = new Map<ClassLikeDeclaration, AngularClass>();\n const byExportAs = new Map<string, ClassLikeDeclaration[]>();\n const componentMatcher = new SelectorMatcher<ClassLikeDeclaration[]>();\n\n for (const angularClass of classes) {\n const { component, declaration, exportAs, selector } = angularClass;\n\n byDeclaration.set(declaration, angularClass);\n\n for (const name of exportAs) {\n const declarations = byExportAs.get(name) ?? [];\n\n declarations.push(declaration);\n byExportAs.set(name, declarations);\n }\n\n if (component && selector !== null) {\n const selectors = parseSelector(selector);\n\n if (selectors) {\n componentMatcher.addSelectables(selectors, [declaration]);\n }\n }\n }\n\n const directiveIndex: DirectiveIndex = {\n byDeclaration,\n byExportAs,\n componentMatcher\n };\n\n return directiveIndex;\n};\n", "import { readFileSync, statSync } from 'node:fs';\n\nimport { isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { ClassElement, ClassLikeDeclaration } from 'typescript';\n\nimport { addTemplateReads } from './angular-template-read-resolution.ts';\nimport type {\n TemplateFileVersion,\n TemplateReads\n} from '../common/project-index.type.ts';\nimport type {\n AngularClass,\n CandidateNames,\n CollectTemplateReadsOptions,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype TemplateSource = {\n readonly fileName: string;\n readonly source: string;\n};\n\nconst memberNameOf = (member: ClassElement): string[] => {\n const name = member.name;\n\n if (!name) return [];\n\n const isIdentifierName = isIdentifier(name);\n const isStringName = isStringLiteralLike(name);\n const isTextName = isIdentifierName || isStringName;\n\n if (!isTextName) return [];\n\n const names = [name.text];\n\n return names;\n};\n\nconst memberNames = (declaration: ClassLikeDeclaration): string[] => {\n return declaration.members.flatMap(memberNameOf);\n};\n\n/**\n * What a template we cannot read might reference: the component's own\n * members and those of every class in its scope, or every candidate name\n * when the scope is unknown.\n */\nconst unknownTemplateNames = (\n { declaration, scope }: AngularClass,\n allNames: CandidateNames\n): Iterable<string> => {\n if (scope === null) return allNames;\n\n const scopeNames = scope.flatMap(memberNames);\n const names = [...memberNames(declaration), ...scopeNames];\n\n return names;\n};\n\nconst templateFileVersion = (fileName: string): TemplateFileVersion => {\n const { mtimeNs, size } = statSync(fileName, { bigint: true });\n\n const version: TemplateFileVersion = { fileName, mtimeNs, size };\n\n return version;\n};\n\nexport const templateFileIsCurrent = (\n version: TemplateFileVersion\n): boolean => {\n try {\n const current = statSync(version.fileName, { bigint: true });\n\n return current.mtimeNs === version.mtimeNs && current.size === version.size;\n } catch {\n return false;\n }\n};\n\nconst templateSourceOf = (\n angularClass: AngularClass,\n allNames: CandidateNames,\n sink: ReadSink,\n versions: TemplateFileVersion[]\n): TemplateSource | null => {\n const { declaration, template, valid } = angularClass;\n const fileName = declaration.getSourceFile().fileName;\n const className = declaration.name?.text ?? '(anonymous)';\n\n if (!valid) {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: metadata of ${className} is not static (template, templateUrl)`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n\n if (!template) return null;\n\n if (template.kind === 'inline') {\n const inlineSource: TemplateSource = { fileName, source: template.source };\n\n return inlineSource;\n }\n\n const templateFileName = template.fileName;\n\n try {\n versions.push(templateFileVersion(templateFileName));\n\n const source = readFileSync(templateFileName, 'utf8');\n const externalSource: TemplateSource = {\n fileName: templateFileName,\n source\n };\n\n return externalSource;\n } catch {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: templateUrl of ${className} cannot be read (${templateFileName})`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n};\n\n/** Reads made by the templates of the components declared in one file. */\nexport const collectAngularTemplateReads = ({\n allNames,\n checker,\n classes,\n directives,\n sink\n}: CollectTemplateReadsOptions): TemplateReads => {\n const templateVersions: TemplateFileVersion[] = [];\n let usedDirectiveIndex = false;\n\n for (const angularClass of classes) {\n const template = templateSourceOf(\n angularClass,\n allNames,\n sink,\n templateVersions\n );\n\n if (template === null) continue;\n\n const result = addTemplateReads({\n angularClass,\n checker,\n directives,\n fileName: template.fileName,\n sink,\n source: template.source\n });\n\n usedDirectiveIndex ||= result.usedDirectiveIndex;\n }\n\n const templateReads: TemplateReads = {\n templateVersions,\n usedDirectiveIndex\n };\n\n return templateReads;\n};\n", "import {\n R3TargetBinder,\n ThisReceiver,\n TmplAstReference,\n parseTemplate\n} from '@angular/compiler';\nimport type {\n BoundTarget,\n DirectiveMeta,\n TemplateEntity\n} from '@angular/compiler';\n\nimport { addResolvedPath } from './angular-resolved-path.ts';\nimport { ReadCollector } from './angular-template-read-chains.ts';\nimport { addReferenceRead } from './angular-template-references.ts';\nimport type {\n ReadChain,\n ReadSegment,\n ResolvedPathOptions,\n TemplateReadContext,\n TemplateReadsOptions\n} from '../common/project-usage.type.ts';\nimport { chainText } from '../utils/read-chain-text.util.ts';\n\ntype TemplateReadResult = {\n /** True when a `#reference` was resolved through the directive index. */\n readonly usedDirectiveIndex: boolean;\n};\n\n/** Every identifier-like token in a text: a superset of what it can read. */\nconst identifierNames = (text: string): Set<string> => {\n const matches = text.match(/[A-Za-z_$][\\w$]*/gu) ?? [];\n\n return new Set(matches);\n};\n\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\n\nconst unparsedTemplateReads = (\n context: TemplateReadContext,\n source: string,\n error: string | undefined\n): TemplateReadResult => {\n const names = identifierNames(source);\n const message = error ?? 'unknown error';\n const reason = `${context.fileName}: template of ${context.className} does not parse (${message})`;\n\n context.sink.addFallbackNames(names, reason);\n\n const unparsedReads: TemplateReadResult = { usedDirectiveIndex: false };\n\n return unparsedReads;\n};\n\nconst addComponentRead = (\n context: TemplateReadContext,\n names: ReadSegment[]\n): void => {\n const { checker, className, declaration, fileName, sink } = context;\n const options: ResolvedPathOptions = {\n allowMissingRoot: true,\n checker,\n declaration,\n names,\n sink\n };\n const isResolved = addResolvedPath(options);\n\n if (isResolved) return;\n\n const fallbackNames = names.map((segment) => segment.name);\n const reason = `${fileName}: cannot resolve '${chainText(names)}' on ${className}`;\n\n sink.addFallbackNames(fallbackNames, reason);\n};\n\nconst chainEntity = (\n boundTarget: BoundTarget<DirectiveMeta>,\n chain: ReadChain\n): TemplateEntity | null => {\n const isThisRead = chain.root.receiver instanceof ThisReceiver;\n\n if (isThisRead) return null;\n\n return boundTarget.getExpressionTarget(chain.root);\n};\n\nconst addChainRead = (\n context: TemplateReadContext,\n reads: ReadCollector,\n boundTarget: BoundTarget<DirectiveMeta>,\n chain: ReadChain\n): boolean => {\n const entity = chainEntity(boundTarget, chain);\n\n if (entity === null) {\n addComponentRead(context, chain.names);\n\n return false;\n }\n\n if (!(entity instanceof TmplAstReference)) return false;\n\n const owner = reads.referenceOwners.get(entity);\n const names = chain.names.slice(1);\n\n addReferenceRead(context, entity, owner, names);\n\n return true;\n};\n\nexport const addTemplateReads = ({\n angularClass,\n checker,\n directives,\n fileName,\n sink,\n source\n}: TemplateReadsOptions): TemplateReadResult => {\n const { declaration, scope } = angularClass;\n const className = declaration.name?.text ?? '(anonymous)';\n const context: TemplateReadContext = {\n checker,\n className,\n declaration,\n directives,\n fileName,\n scope,\n sink\n };\n const parsed = parseTemplate(source, fileName);\n\n if (parsed.errors?.length) {\n const error = parsed.errors[0]?.msg;\n\n return unparsedTemplateReads(context, source, error);\n }\n\n const boundTarget = templateBinder.bind({ template: parsed.nodes });\n const reads = new ReadCollector();\n\n for (const node of parsed.nodes) {\n reads.visit(node);\n }\n\n let usedDirectiveIndex = false;\n\n for (const chain of reads.reads) {\n const usedIndex = addChainRead(context, reads, boundTarget, chain);\n\n usedDirectiveIndex ||= usedIndex;\n }\n\n const templateReads: TemplateReadResult = { usedDirectiveIndex };\n\n return templateReads;\n};\n", "import { SignatureKind, TypeFlags } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport type {\n ReadSink,\n ResolvedPathOptions\n} from '../common/project-usage.type.ts';\nimport {\n stringIndexTypes,\n symbolsForName\n} from '../utils/type-property-symbols.util.ts';\n\nconst hasAnyOrUnknownFlag = (type: { flags: TypeFlags }): boolean => {\n const anyOrUnknown = TypeFlags.Any | TypeFlags.Unknown;\n\n return (type.flags & anyOrUnknown) !== 0;\n};\n\nconst isAnyOrUnknown = (types: { flags: TypeFlags }[]): boolean => {\n return types.some(hasAnyOrUnknownFlag);\n};\n\nconst addTypes = (sink: ReadSink, types: Type[]): void => {\n for (const type of types) {\n sink.addType(type);\n }\n};\n\nconst callReturnTypes = (checker: TypeChecker, type: Type): Type[] => {\n const signatures = checker.getSignaturesOfType(type, SignatureKind.Call);\n\n return signatures.map((signature) => signature.getReturnType());\n};\n\nconst memberTypes = (\n symbols: Set<Symbol>,\n declaration: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): Type[] => {\n const types: Type[] = [];\n\n for (const symbol of symbols) {\n for (const memberDeclaration of symbol.declarations ?? []) {\n sink.addDeclaration(memberDeclaration);\n }\n\n types.push(checker.getTypeOfSymbolAtLocation(symbol, declaration));\n }\n\n return types;\n};\n\nexport const addResolvedPath = ({\n allowMissingRoot,\n checker,\n declaration,\n names,\n sink\n}: ResolvedPathOptions): boolean => {\n let types = [checker.getTypeAtLocation(declaration)];\n const indexTypesOf = (type: Type): Type[] => stringIndexTypes(checker, type);\n const returnTypesOf = (type: Type): Type[] => callReturnTypes(checker, type);\n\n for (const [index, segment] of names.entries()) {\n addTypes(sink, types);\n\n const symbolsOf = (type: Type): Symbol[] => {\n return symbolsForName(checker, type, segment.name);\n };\n const symbols = new Set(types.flatMap(symbolsOf));\n\n if (symbols.size === 0) {\n const indexedTypes = types.flatMap(indexTypesOf);\n\n if (indexedTypes.length > 0) {\n types = indexedTypes;\n continue;\n }\n\n const isAnyOrUnknownType = isAnyOrUnknown(types);\n\n if (isAnyOrUnknownType) return true;\n\n return index === 0 && allowMissingRoot;\n }\n\n types = memberTypes(symbols, declaration, checker, sink);\n\n if (segment.called) {\n const returnTypes = types.flatMap(returnTypesOf);\n\n if (returnTypes.length === 0) return isAnyOrUnknown(types);\n\n types = returnTypes;\n }\n }\n\n return true;\n};\n", "import { IndexKind } from 'typescript';\nimport type { Symbol, Type, TypeChecker } from 'typescript';\n\nexport const symbolsForName = (\n checker: TypeChecker,\n type: Type,\n name: string\n): Symbol[] => {\n const symbol = checker.getPropertyOfType(checker.getApparentType(type), name);\n\n if (symbol) return [symbol];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const symbols = new Set<Symbol>();\n\n for (const member of type.types) {\n for (const memberSymbol of symbolsForName(checker, member, name)) {\n symbols.add(memberSymbol);\n }\n }\n\n return [...symbols];\n};\n\nexport const stringIndexTypes = (checker: TypeChecker, type: Type): Type[] => {\n const indexedType = checker.getIndexTypeOfType(\n checker.getApparentType(type),\n IndexKind.String\n );\n\n if (indexedType) return [indexedType];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const indexedTypes = new Set<Type>();\n\n for (const member of type.types) {\n for (const memberIndexedType of stringIndexTypes(checker, member)) {\n indexedTypes.add(memberIndexedType);\n }\n }\n\n return [...indexedTypes];\n};\n", "import type {\n AST,\n Binary,\n TmplAstComponent,\n TmplAstDirective,\n TmplAstElement,\n TmplAstReference,\n TmplAstTemplate\n} from '@angular/compiler';\nimport {\n Call,\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead,\n ThisReceiver\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\nimport type {\n ReadChain,\n ReadSegment,\n ReferenceOwner\n} from '../common/project-usage.type.ts';\n\ntype ChainStep = {\n readonly called: boolean;\n readonly next: PropertyRead | SafePropertyRead;\n};\n\nconst isPropertyReadLike = (\n node: AST\n): node is PropertyRead | SafePropertyRead => {\n const isPlainRead = node instanceof PropertyRead;\n const isSafeRead = node instanceof SafePropertyRead;\n\n return isPlainRead || isSafeRead;\n};\n\nconst isRootRead = (read: PropertyRead | SafePropertyRead): boolean => {\n const isImplicitReceiver = read.receiver instanceof ImplicitReceiver;\n const isThisReceiver = read.receiver instanceof ThisReceiver;\n\n return isImplicitReceiver || isThisReceiver;\n};\n\nconst chainStep = (read: PropertyRead | SafePropertyRead): ChainStep | null => {\n const receiver = read.receiver;\n const isReadReceiver = isPropertyReadLike(receiver);\n\n if (isReadReceiver) {\n const readStep: ChainStep = { called: false, next: receiver };\n\n return readStep;\n }\n\n const isCallReceiver = receiver instanceof Call;\n\n if (!isCallReceiver) return null;\n\n const target = receiver.receiver;\n const isReadLikeTarget = isPropertyReadLike(target);\n\n if (!isReadLikeTarget) return null;\n\n const calledStep: ChainStep = { called: true, next: target };\n\n return calledStep;\n};\n\nconst readChain = (node: PropertyRead | SafePropertyRead): ReadChain | null => {\n const leaf: ReadSegment = { called: false, name: node.name };\n const names: ReadSegment[] = [leaf];\n let current = node;\n\n while (!isRootRead(current)) {\n const step = chainStep(current);\n\n if (step === null) return null;\n\n current = step.next;\n names.unshift({ called: step.called, name: current.name });\n }\n\n if (!(current instanceof PropertyRead)) return null;\n\n const chain: ReadChain = { names, root: current };\n\n return chain;\n};\n\nexport class ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads: ReadChain[] = [];\n public readonly referenceOwners = new Map<TmplAstReference, ReferenceOwner>();\n\n private record(node: PropertyRead | SafePropertyRead): void {\n const chain = readChain(node);\n\n if (chain) {\n this.reads.push(chain);\n }\n }\n\n private recordReferences(owner: ReferenceOwner): void {\n for (const reference of owner.references) {\n this.referenceOwners.set(reference, owner);\n }\n }\n\n public override visitElement(element: TmplAstElement): void {\n this.recordReferences(element);\n super.visitElement(element);\n }\n\n public override visitTemplate(template: TmplAstTemplate): void {\n this.recordReferences(template);\n super.visitTemplate(template);\n }\n\n public override visitComponent(component: TmplAstComponent): void {\n this.recordReferences(component);\n super.visitComponent(component);\n }\n\n public override visitDirective(directive: TmplAstDirective): void {\n this.recordReferences(directive);\n super.visitDirective(directive);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n", "import { TmplAstElement, createCssSelectorFromNode } from '@angular/compiler';\nimport type { TmplAstReference } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport { addResolvedPath } from './angular-resolved-path.ts';\nimport type {\n DirectiveIndex,\n ReadSegment,\n ReferenceOwner,\n ResolvedPathOptions,\n TemplateReadContext\n} from '../common/project-usage.type.ts';\nimport { chainText } from '../utils/read-chain-text.util.ts';\n\n/**\n * Classes a `#reference` can resolve to. Candidates come from the whole\n * Program and are narrowed to the component's standalone `imports` when\n * that scope is known; a scope member with `hostDirectives` may expose\n * exportAs names that are not modelled, so it keeps the wider set. Extra\n * candidates only add reads.\n */\nconst referenceTargets = (\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n directives: DirectiveIndex,\n scope: ClassLikeDeclaration[] | null\n): ClassLikeDeclaration[] => {\n const exportAs = reference.value.trim();\n let targets: ClassLikeDeclaration[] = [];\n\n if (exportAs !== '') {\n const exportedTargets = directives.byExportAs.get(exportAs) ?? [];\n\n targets = [...exportedTargets];\n } else if (owner instanceof TmplAstElement) {\n directives.componentMatcher.match(\n createCssSelectorFromNode(owner),\n (_selector, declarations) => {\n targets.push(...declarations);\n }\n );\n }\n\n const scoped =\n scope !== null &&\n !scope.some(\n (declaration) => directives.byDeclaration.get(declaration)?.hostDirectives\n );\n\n if (!scoped) return targets;\n\n const scopedTargets = targets.filter((target) => scope.includes(target));\n\n return scopedTargets;\n};\n\n/** Reads made on the classes a template `#reference` resolves to. */\nexport const addReferenceRead = (\n context: TemplateReadContext,\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n names: ReadSegment[]\n): void => {\n const { checker, className, directives, fileName, scope, sink } = context;\n const targets = referenceTargets(reference, owner, directives, scope);\n const isTargetResolved = (target: ClassLikeDeclaration): boolean => {\n const options: ResolvedPathOptions = {\n allowMissingRoot: false,\n checker,\n declaration: target,\n names,\n sink\n };\n\n return addResolvedPath(options);\n };\n const resolved = targets.map(isTargetResolved);\n const hasResolvedTarget = resolved.includes(true);\n\n if (resolved.length === 0) return;\n\n if (hasResolvedTarget) return;\n\n const fallbackNames = names.map((segment) => segment.name);\n const reason = `${fileName}: cannot resolve '#${reference.name}.${chainText(names)}' in ${className}`;\n\n sink.addFallbackNames(fallbackNames, reason);\n};\n", "import type { ReadSegment } from '../common/project-usage.type.ts';\n\nconst segmentText = (segment: ReadSegment): string => {\n const call = segment.called ? '()' : '';\n\n return `${segment.name}${call}`;\n};\n\n/** A read chain rendered the way it appeared in the template. */\nexport const chainText = (names: ReadSegment[]): string => {\n const texts = names.map(segmentText);\n\n return texts.join('.');\n};\n", "import {\n forEachChild,\n isClassLike,\n isElementAccessExpression,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ElementAccessExpression,\n Node,\n PropertyAccessExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { collectAngularInterfaceMethods } from './typescript-angular-interface-methods.ts';\nimport { collectDestructuringReads } from './typescript-destructuring-reads.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n literalPropertyNames\n} from './typescript-symbol-reads.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type { CandidateNames, ReadSink } from '../common/project-usage.type.ts';\n\nconst addPropertyAccessRead = (\n node: PropertyAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const isCandidateName = candidateNames.has(node.name.text);\n\n if (!isCandidateName) return;\n\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n sink.addType(checker.getTypeAtLocation(node.expression));\n\n const symbol = checker.getSymbolAtLocation(node.name);\n\n if (symbol) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n};\n\nconst addElementAccessRead = (\n node: ElementAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n const argumentType = checker.getTypeAtLocation(node.argumentExpression);\n const names = literalPropertyNames(argumentType);\n\n if (names) {\n const hasCandidateName = names.some((name) => candidateNames.has(name));\n\n if (!hasCandidateName) return;\n }\n\n const targetType = checker.getTypeAtLocation(node.expression);\n\n addNamedProperties(checker, targetType, names, sink);\n};\n\nexport const collectTypeScriptReads = (\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const visit = (node: Node): void => {\n const isPropertyAccess = isPropertyAccessExpression(node);\n const isElementAccess = isElementAccessExpression(node);\n const isClass = isClassLike(node);\n\n if (isPropertyAccess) {\n addPropertyAccessRead(node, checker, sink, candidateNames);\n } else if (isElementAccess) {\n addElementAccessRead(node, checker, sink, candidateNames);\n } else if (isClass) {\n collectAngularInterfaceMethods(node, checker, sink);\n }\n\n collectDestructuringReads(node, checker, sink, candidateNames);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n};\n", "import { SyntaxKind, isMethodSignature } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport { addSymbolDeclarations } from './typescript-symbol-reads.ts';\nimport type { ReadSink } from '../common/project-usage.type.ts';\n\nconst isAngularMethodSignature = (declaration: Declaration): boolean => {\n const isMethod = isMethodSignature(declaration);\n\n if (!isMethod) return false;\n\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/');\n};\n\nconst isAngularInterfaceMethod = (symbol: Symbol): boolean => {\n const declarations = symbol.declarations ?? [];\n\n return declarations.some(isAngularMethodSignature);\n};\n\nconst addImplementations = (\n heritageType: Type,\n classType: Type,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n for (const interfaceMethod of heritageType.getProperties()) {\n const isInterfaceMethod = isAngularInterfaceMethod(interfaceMethod);\n\n if (!isInterfaceMethod) continue;\n\n const implementation = classType.getProperty(interfaceMethod.name);\n\n if (implementation) {\n addSymbolDeclarations(checker, implementation, sink);\n }\n }\n};\n\n/**\n * Angular calls lifecycle and forms methods through the interfaces a class\n * implements, so an implementation of one counts as read.\n */\nexport const collectAngularInterfaceMethods = (\n node: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n const heritageClauses = node.heritageClauses ?? [];\n const implementsClauses = heritageClauses.filter(\n (clause) => clause.token === SyntaxKind.ImplementsKeyword\n );\n\n if (implementsClauses.length === 0) return;\n\n const classType = checker.getTypeAtLocation(node);\n\n for (const clause of implementsClauses) {\n for (const heritageType of clause.types) {\n const type = checker.getTypeAtLocation(heritageType);\n\n sink.addType(type);\n addImplementations(type, classType, checker, sink);\n }\n }\n};\n", "import {\n SymbolFlags,\n isBigIntLiteral,\n isIdentifier,\n isNumericLiteral,\n isPrivateIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { PropertyName, Symbol, Type, TypeChecker } from 'typescript';\n\nimport type { ReadSink } from '../common/project-usage.type.ts';\nimport { symbolsForName } from '../utils/type-property-symbols.util.ts';\n\nconst aliasTarget = (checker: TypeChecker, symbol: Symbol): Symbol => {\n const isAlias = (symbol.flags & SymbolFlags.Alias) !== 0;\n\n if (!isAlias) return symbol;\n\n return checker.getAliasedSymbol(symbol);\n};\n\nexport const addSymbolDeclarations = (\n checker: TypeChecker,\n symbol: Symbol,\n sink: ReadSink\n): void => {\n const resolved = aliasTarget(checker, symbol);\n\n for (const declaration of resolved.declarations ?? []) {\n sink.addDeclaration(declaration);\n }\n};\n\nexport const allPropertySymbols = (\n checker: TypeChecker,\n type: Type\n): Symbol[] => {\n const symbols = new Set(\n checker.getPropertiesOfType(checker.getApparentType(type))\n );\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n for (const symbol of allPropertySymbols(checker, member)) {\n symbols.add(symbol);\n }\n }\n }\n\n return [...symbols];\n};\n\nconst namedPropertySymbols = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null\n): Symbol[] => {\n if (names === null) return allPropertySymbols(checker, type);\n\n return names.flatMap((name) => symbolsForName(checker, type, name));\n};\n\nexport const addNamedProperties = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null,\n sink: ReadSink\n): Symbol[] => {\n sink.addType(type);\n\n const symbols = namedPropertySymbols(checker, type, names);\n\n for (const symbol of symbols) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n\n return symbols;\n};\n\nexport const literalPropertyNames = (type: Type): string[] | null => {\n const isStringLiteral = type.isStringLiteral();\n const isNumberLiteral = type.isNumberLiteral();\n const isLiteralType = isStringLiteral || isNumberLiteral;\n\n if (isLiteralType) return [String(type.value)];\n\n const isUnion = type.isUnion();\n\n if (!isUnion) return null;\n\n const names: string[] = [];\n\n for (const member of type.types) {\n const memberNames = literalPropertyNames(member);\n\n if (!memberNames) return null;\n\n names.push(...memberNames);\n }\n\n return names;\n};\n\nexport const propertyName = (\n checker: TypeChecker,\n node: PropertyName\n): string[] | null => {\n const isIdentifierName = isIdentifier(node);\n const isPrivateName = isPrivateIdentifier(node);\n const isStringName = isStringLiteralLike(node);\n const isNumericName = isNumericLiteral(node);\n const isBigIntName = isBigIntLiteral(node);\n const isLiteralName =\n isIdentifierName ||\n isPrivateName ||\n isStringName ||\n isNumericName ||\n isBigIntName;\n\n if (isLiteralName) return [node.text];\n\n return literalPropertyNames(checker.getTypeAtLocation(node.expression));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isBinaryExpression,\n isBindingElement,\n isObjectLiteralExpression,\n isVariableDeclaration\n} from 'typescript';\nimport type { Node, Type, TypeChecker } from 'typescript';\n\nimport { assignmentPatternElements } from './typescript-assignment-pattern-elements.ts';\nimport {\n bindingPatternElements,\n isBindingPattern\n} from './typescript-binding-pattern-elements.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n allPropertySymbols\n} from './typescript-symbol-reads.ts';\nimport type {\n CandidateNames,\n DestructuringPattern,\n PatternElementRead,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype LazyType = () => Type;\n\ntype PatternReadContext = {\n readonly checker: TypeChecker;\n readonly sink: ReadSink;\n readonly candidateNames: CandidateNames;\n};\n\nconst lazyType = (compute: () => Type): LazyType => {\n let type: Type | undefined;\n\n return () => (type ??= compute());\n};\n\nconst isSkippable = (\n read: PatternElementRead,\n candidateNames: CandidateNames\n): boolean => {\n if (read.nested !== null) return false;\n\n if (read.names === null) return false;\n\n const hasCandidateName = read.names.some((name) => candidateNames.has(name));\n\n return !hasCandidateName;\n};\n\nconst patternElements = (\n pattern: DestructuringPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isBinding = isBindingPattern(pattern);\n\n if (isBinding) return bindingPatternElements(pattern, checker);\n\n return assignmentPatternElements(pattern, checker);\n};\n\nconst addRestReads = (\n type: Type,\n consumed: Set<string>,\n context: PatternReadContext\n): void => {\n context.sink.addType(type);\n\n for (const symbol of allPropertySymbols(context.checker, type)) {\n const isConsumed = consumed.has(symbol.name);\n\n if (isConsumed) continue;\n\n addSymbolDeclarations(context.checker, symbol, context.sink);\n }\n};\n\nconst collectPatternReads = (\n pattern: DestructuringPattern,\n type: LazyType,\n context: PatternReadContext\n): void => {\n const { checker, sink, candidateNames } = context;\n const consumed = new Set<string>();\n const reads = patternElements(pattern, checker);\n\n for (const read of reads) {\n if (read.rest) {\n addRestReads(type(), consumed, context);\n continue;\n }\n\n for (const name of read.names ?? []) {\n consumed.add(name);\n }\n\n const skip = isSkippable(read, candidateNames);\n\n if (skip) continue;\n\n const symbols = addNamedProperties(checker, type(), read.names, sink);\n const nested = read.nested;\n\n if (nested === null) continue;\n\n for (const symbol of symbols) {\n const nestedType = lazyType(() => {\n return checker.getTypeOfSymbolAtLocation(symbol, read.location);\n });\n\n collectPatternReads(nested, nestedType, context);\n }\n }\n};\n\nconst collectBindingReads = (node: Node, context: PatternReadContext): void => {\n const isBinding = isBindingPattern(node);\n\n if (!isBinding) return;\n\n const isBindingElementParent = isBindingElement(node.parent);\n const isNestedBindingName =\n isBindingElementParent && node.parent.name === node;\n\n if (isNestedBindingName) return;\n\n const declaration = node.parent;\n const isDeclaration = isVariableDeclaration(declaration);\n const isInitializedDeclaration =\n isDeclaration && declaration.initializer !== undefined;\n const source = isInitializedDeclaration\n ? declaration.initializer\n : declaration;\n const sourceTypeOf = (): Type => context.checker.getTypeAtLocation(source);\n const sourceType = lazyType(sourceTypeOf);\n\n collectPatternReads(node, sourceType, context);\n};\n\nconst collectAssignmentReads = (\n node: Node,\n context: PatternReadContext\n): void => {\n const isBinary = isBinaryExpression(node);\n\n if (!isBinary) return;\n\n const isEqualsAssignment = node.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (!isEqualsAssignment) return;\n\n const isArrayTarget = isArrayLiteralExpression(node.left);\n const isObjectTarget = isObjectLiteralExpression(node.left);\n const isDestructuringAssignment = isArrayTarget || isObjectTarget;\n\n if (!isDestructuringAssignment) return;\n\n const rightTypeOf = (): Type => context.checker.getTypeAtLocation(node.right);\n const sourceType = lazyType(rightTypeOf);\n\n collectPatternReads(node.left, sourceType, context);\n};\n\nexport const collectDestructuringReads = (\n node: Node,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const context: PatternReadContext = { checker, sink, candidateNames };\n\n collectBindingReads(node, context);\n collectAssignmentReads(node, context);\n};\n", "import {\n isArrayLiteralExpression,\n isObjectLiteralExpression,\n isOmittedExpression,\n isPropertyAssignment,\n isSpreadAssignment,\n isSpreadElement\n} from 'typescript';\nimport type {\n Expression,\n ObjectLiteralElementLike,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n AssignmentPattern,\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nconst nestedPattern = (expression: Expression): DestructuringPattern | null => {\n const isArrayLiteral = isArrayLiteralExpression(expression);\n const isObjectLiteral = isObjectLiteralExpression(expression);\n const isNested = isArrayLiteral || isObjectLiteral;\n\n if (!isNested) return null;\n\n return expression;\n};\n\nconst nestedPropertyPattern = (\n property: ObjectLiteralElementLike\n): DestructuringPattern | null => {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) return null;\n\n return nestedPattern(property.initializer);\n};\n\nconst arrayElementRead = (\n element: Expression,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = isSpreadElement(element);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst propertyRead = (\n property: ObjectLiteralElementLike,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestProperty = isSpreadAssignment(property);\n\n if (isRestProperty) {\n const restRead: PatternElementRead = {\n location: property,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: property,\n names: propertyName(checker, property.name),\n nested: nestedPropertyPattern(property),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one destructuring assignment target. */\nexport const assignmentPatternElements = (\n pattern: AssignmentPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayLiteralExpression(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.properties.map((property) => propertyRead(property, checker));\n};\n", "import {\n isArrayBindingPattern,\n isIdentifier,\n isObjectBindingPattern,\n isOmittedExpression\n} from 'typescript';\nimport type {\n ArrayBindingElement,\n BindingElement,\n BindingPattern,\n Node,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nexport const isBindingPattern = (node: Node): node is BindingPattern => {\n const isArrayPattern = isArrayBindingPattern(node);\n const isObjectPattern = isObjectBindingPattern(node);\n\n return isArrayPattern || isObjectPattern;\n};\n\nconst nestedPattern = (\n element: BindingElement\n): DestructuringPattern | null => {\n const isNested = isBindingPattern(element.name);\n\n if (!isNested) return null;\n\n return element.name;\n};\n\nconst bindingNames = (\n checker: TypeChecker,\n element: BindingElement\n): string[] | null => {\n if (element.propertyName) return propertyName(checker, element.propertyName);\n\n const isIdentifierName = isIdentifier(element.name);\n\n if (!isIdentifierName) return null;\n\n return [element.name.text];\n};\n\nconst arrayElementRead = (\n element: ArrayBindingElement,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = Boolean(element.dotDotDotToken);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst objectElementRead = (\n element: BindingElement,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestElement = Boolean(element.dotDotDotToken);\n\n if (isRestElement) {\n const restRead: PatternElementRead = {\n location: element,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: element,\n names: bindingNames(checker, element),\n nested: nestedPattern(element),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one array or object binding pattern. */\nexport const bindingPatternElements = (\n pattern: BindingPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayBindingPattern(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.elements.map((element) => objectElementRead(element, checker));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isAsExpression,\n isBinaryExpression,\n isDeleteExpression,\n isForInStatement,\n isForOfStatement,\n isNonNullExpression,\n isObjectLiteralExpression,\n isParenthesizedExpression,\n isPropertyAssignment,\n isSatisfiesExpression,\n isSpreadAssignment,\n isTypeAssertionExpression\n} from 'typescript';\nimport type { Expression, Node } from 'typescript';\n\nconst isExpressionWrapper = (parent: Node, child: Node): boolean => {\n const isParenthesized = isParenthesizedExpression(parent);\n const isAs = isAsExpression(parent);\n const isTypeAssertion = isTypeAssertionExpression(parent);\n const isNonNull = isNonNullExpression(parent);\n const isSatisfies = isSatisfiesExpression(parent);\n const isCast = isAs || isTypeAssertion || isSatisfies;\n const isWrapper = isParenthesized || isNonNull || isCast;\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isPatternContainer = (parent: Node, child: Node): boolean => {\n const isArrayLiteral = isArrayLiteralExpression(parent);\n\n if (isArrayLiteral) {\n return parent.elements.some((element) => element === child);\n }\n\n const isObjectLiteral = isObjectLiteralExpression(parent);\n\n if (isObjectLiteral) {\n return parent.properties.some((property) => property === child);\n }\n\n const isAssignment = isPropertyAssignment(parent);\n\n if (isAssignment) return parent.initializer === child;\n\n const isSpread = isSpreadAssignment(parent);\n\n if (!isSpread) return false;\n\n return parent.expression === child;\n};\n\nconst isWriteTarget = (parent: Node, current: Node): boolean => {\n const isBinary = isBinaryExpression(parent);\n const isBinaryTarget =\n isBinary &&\n parent.left === current &&\n parent.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (isBinaryTarget) return true;\n\n const isDelete = isDeleteExpression(parent);\n const isDeleteTarget = isDelete && parent.expression === current;\n\n if (isDeleteTarget) return true;\n\n const isForIn = isForInStatement(parent);\n const isForOf = isForOfStatement(parent);\n const isIteration = isForIn || isForOf;\n\n return isIteration && parent.initializer === current;\n};\n\n/**\n * True when every use of `node` up through its wrapping expressions and\n * destructuring patterns writes to it rather than reading it.\n */\nexport const isWriteOnly = (node: Expression): boolean => {\n let current: Node = node;\n let parent = node.parent;\n\n while (\n isExpressionWrapper(parent, current) ||\n isPatternContainer(parent, current)\n ) {\n current = parent;\n parent = parent.parent;\n }\n\n return isWriteTarget(parent, current);\n};\n", "import { ObjectFlags, TypeFlags } from 'typescript';\nimport type {\n InterfaceType,\n ObjectType,\n SourceFile,\n Type,\n TypeChecker,\n TypeReference\n} from 'typescript';\n\nconst isObjectType = (type: Type): type is ObjectType => {\n return (type.flags & TypeFlags.Object) !== 0;\n};\n\nconst isTypeReference = (type: ObjectType): type is TypeReference => {\n return (type.objectFlags & ObjectFlags.Reference) !== 0;\n};\n\nconst isInterfaceType = (type: ObjectType): type is InterfaceType => {\n return (type.objectFlags & ObjectFlags.ClassOrInterface) !== 0;\n};\n\nconst addDeclarationFiles = (\n type: Type,\n dependencies: Set<SourceFile>\n): void => {\n for (const symbol of [type.getSymbol(), type.aliasSymbol]) {\n const declarations = symbol?.declarations ?? [];\n\n for (const declaration of declarations) {\n dependencies.add(declaration.getSourceFile());\n }\n }\n};\n\nconst baseTypesOf = (checker: TypeChecker, type: Type): Type[] => {\n const isObject = isObjectType(type);\n\n if (!isObject) return [];\n\n const isReference = isTypeReference(type);\n const target = isReference ? type.target : type;\n const isClassOrInterface = isInterfaceType(target);\n\n if (!isClassOrInterface) return [];\n\n return checker.getBaseTypes(target);\n};\n\nexport const addTypeDependencies = (\n checker: TypeChecker,\n type: Type,\n dependencies: Set<SourceFile>,\n seen: Set<Type>\n): void => {\n const isSeen = seen.has(type);\n\n if (isSeen) return;\n\n seen.add(type);\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n addTypeDependencies(checker, member, dependencies, seen);\n }\n\n return;\n }\n\n addDeclarationFiles(type, dependencies);\n\n const isTypeParameter = (type.flags & TypeFlags.TypeParameter) !== 0;\n\n if (isTypeParameter) {\n const constraint = checker.getBaseConstraintOfType(type);\n\n if (constraint) {\n addTypeDependencies(checker, constraint, dependencies, seen);\n }\n\n return;\n }\n\n for (const base of baseTypesOf(checker, type)) {\n addTypeDependencies(checker, base, dependencies, seen);\n }\n};\n", "import type { Node, SourceFile, Type, TypeChecker } from 'typescript';\n\nimport { collectAngularTemplateReads } from './angular/angular-template-reads.ts';\nimport type {\n FileEntry,\n ProjectIndex,\n TemplateReads\n} from './common/project-index.type.ts';\nimport type { ReadSink } from './common/project-usage.type.ts';\nimport { collectTypeScriptReads } from './typescript/typescript-reads.ts';\nimport { addTypeDependencies } from './typescript/typescript-type-dependencies.ts';\n\nconst failureText = (error: unknown): string => {\n if (error instanceof Error) return error.message;\n\n return String(error);\n};\n\nconst collectFileReads = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink\n): TemplateReads => {\n try {\n collectTypeScriptReads(sourceFile, checker, sink, index.candidateNames);\n\n const classes = index.classes.get(sourceFile.fileName)?.classes ?? [];\n\n return collectAngularTemplateReads({\n allNames: index.candidateNames,\n checker,\n classes,\n directives: index.directives,\n sink\n });\n } catch (error) {\n const errorMessage = failureText(error);\n\n sink.addFallbackNames(\n index.candidateNames,\n `${sourceFile.fileName}: indexing failed (${errorMessage})`\n );\n\n const noTemplateReads: TemplateReads = {\n templateVersions: [],\n usedDirectiveIndex: false\n };\n\n return noTemplateReads;\n }\n};\n\nexport const computeEntry = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker\n): FileEntry => {\n const declarations = new Set<Node>();\n const dependencies = new Set<SourceFile>();\n const fallbackNames = new Set<string>();\n const seenTypes = new Set<Type>();\n const sink: ReadSink = {\n addDeclaration: (declaration) => {\n declarations.add(declaration);\n dependencies.add(declaration.getSourceFile());\n },\n addFallbackNames: (names) => {\n for (const name of names) {\n fallbackNames.add(name);\n }\n },\n addType: (type) => {\n addTypeDependencies(checker, type, dependencies, seenTypes);\n }\n };\n const reads = collectFileReads(index, sourceFile, checker, sink);\n\n dependencies.delete(sourceFile);\n\n const fileEntry: FileEntry = {\n ...reads,\n declarations,\n dependencies,\n fallbackNames,\n sourceFile\n };\n\n return fileEntry;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isCallExpression,\n isClassLike,\n isObjectLiteralExpression\n} from 'typescript';\nimport type {\n CallExpression,\n ClassLikeDeclaration,\n Node,\n ObjectLiteralExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { scopeOf } from './angular-component-scope.ts';\nimport { angularDecoratorKind } from './angular-decorator-kind.ts';\nimport {\n exportAsOf,\n metadataProperty,\n stringValue,\n templateOf\n} from './angular-metadata-values.ts';\nimport type {\n AngularClass,\n DiscoveredClasses,\n Discovery\n} from '../common/project-usage.type.ts';\n\ntype UndecidedClass = Omit<AngularClass, 'valid'>;\n\nconst describedClass = (\n base: UndecidedClass,\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): AngularClass => {\n const selector = metadataProperty(metadata, 'selector');\n const described = {\n ...base,\n exportAs: exportAsOf(metadata, discovery),\n hostDirectives: metadataProperty(metadata, 'hostDirectives') !== undefined,\n selector: stringValue(selector, discovery)\n };\n\n if (!base.component) {\n const directiveDiscovery: AngularClass = { ...described, valid: true };\n\n return directiveDiscovery;\n }\n\n const fileName = base.declaration.getSourceFile().fileName;\n const template = templateOf(metadata, fileName, discovery);\n const componentDiscovery: AngularClass = {\n ...described,\n scope: scopeOf(metadata, discovery),\n template: template ?? null,\n valid: template !== undefined\n };\n\n return componentDiscovery;\n};\n\nconst decoratedClass = (\n declaration: ClassLikeDeclaration,\n call: CallExpression,\n discovery: Discovery\n): AngularClass | null => {\n const kind = angularDecoratorKind(call.expression, discovery);\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n const component = kind === 'Component';\n const base: UndecidedClass = {\n component,\n declaration,\n exportAs: [],\n hostDirectives: false,\n name: declaration.name?.text ?? '',\n scope: null,\n selector: null,\n template: null\n };\n const metadata = call.arguments.at(0);\n\n if (metadata === undefined) {\n const bareDiscovery: AngularClass = { ...base, valid: !component };\n\n return bareDiscovery;\n }\n\n const isMetadataObject = isObjectLiteralExpression(metadata);\n\n if (!isMetadataObject) {\n const invalidDiscovery: AngularClass = { ...base, valid: false };\n\n return invalidDiscovery;\n }\n\n return describedClass(base, metadata, discovery);\n};\n\nconst angularClass = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): AngularClass | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const found = decoratedClass(declaration, decorator.expression, discovery);\n\n if (found) return found;\n }\n\n return null;\n};\n\n/** Angular components and directives declared in one source file. */\nexport const angularClasses = (\n sourceFile: SourceFile,\n checker: TypeChecker\n): DiscoveredClasses => {\n const classes: AngularClass[] = [];\n const discovery: Discovery = { checker, dependencies: new Set() };\n\n const visit = (node: Node): void => {\n const isClass = isClassLike(node);\n\n if (isClass) {\n const found = angularClass(node, discovery);\n\n if (found) {\n classes.push(found);\n }\n }\n\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n discovery.dependencies.delete(sourceFile);\n\n const discovered: DiscoveredClasses = {\n classes,\n dependencies: discovery.dependencies\n };\n\n return discovered;\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isClassLike,\n isIdentifier,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Expression,\n ObjectLiteralExpression,\n Symbol\n} from 'typescript';\n\nimport { classDecoratorKind, resolveAlias } from './angular-decorator-kind.ts';\nimport { metadataProperty } from './angular-metadata-values.ts';\nimport type { Discovery } from '../common/project-usage.type.ts';\n\nconst booleanValue = (node: Expression | undefined): boolean | undefined => {\n if (!node) return undefined;\n\n if (node.kind === SyntaxKind.TrueKeyword) return true;\n\n if (node.kind === SyntaxKind.FalseKeyword) return false;\n\n return undefined;\n};\n\nconst classesOf = (\n symbol: Symbol,\n discovery: Discovery\n): ClassLikeDeclaration[] => {\n const resolved = resolveAlias(symbol, discovery);\n const declarations = resolved.declarations ?? [];\n\n return declarations.filter(isClassLike);\n};\n\nconst scopedClasses = (\n classes: ClassLikeDeclaration[],\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const scoped: ClassLikeDeclaration[] = [];\n\n for (const declaration of classes) {\n if (declaration.getSourceFile().isDeclarationFile) continue;\n\n const kind = classDecoratorKind(declaration, discovery);\n\n if (kind === 'Pipe') continue;\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n scoped.push(declaration);\n }\n\n return scoped;\n};\n\nconst importedClasses = (\n element: Expression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const isIdentifierElement = isIdentifier(element);\n const isPropertyAccessElement = isPropertyAccessExpression(element);\n\n if (!isIdentifierElement && !isPropertyAccessElement) return null;\n\n const target = isIdentifierElement ? element : element.name;\n const symbol = discovery.checker.getSymbolAtLocation(target);\n\n if (!symbol) return null;\n\n const classes = classesOf(symbol, discovery);\n\n if (classes.length === 0) return null;\n\n return scopedClasses(classes, discovery);\n};\n\n/**\n * Resolves a standalone component's `imports` to program classes. Library\n * classes and pipes are skipped; anything that cannot be classified (an\n * NgModule, a spread, a `forwardRef`) makes the scope unknown.\n */\nexport const scopeOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const standalone = booleanValue(metadataProperty(metadata, 'standalone'));\n const imports = metadataProperty(metadata, 'imports');\n const isModuleDeclared = standalone === undefined && !imports;\n\n if (standalone === false || isModuleDeclared) return null;\n\n if (!imports) return [];\n\n const isImportsArray = isArrayLiteralExpression(imports);\n\n if (!isImportsArray) return null;\n\n const scope: ClassLikeDeclaration[] = [];\n\n for (const element of imports.elements) {\n const classes = importedClasses(element, discovery);\n\n if (classes === null) return null;\n\n scope.push(...classes);\n }\n\n return scope;\n};\n", "import {\n SymbolFlags,\n canHaveDecorators,\n getDecorators,\n isCallExpression,\n isImportDeclaration,\n isStringLiteralLike\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Expression,\n Node,\n Symbol\n} from 'typescript';\n\nimport type { DecoratorKind, Discovery } from '../common/project-usage.type.ts';\n\nconst decoratorKinds: DecoratorKind[] = [\n 'Component',\n 'Directive',\n 'NgModule',\n 'Pipe'\n];\n\nconst isDecoratorKind = (name: string): name is DecoratorKind => {\n return decoratorKinds.some((kind) => kind === name);\n};\n\nconst isAngularCoreFile = (declaration: Declaration): boolean => {\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/core/');\n};\n\nconst parentOf = (node: Node): Node | undefined => {\n return node.parent;\n};\n\nconst importedFromAngularCore = (declaration: Declaration): boolean => {\n let current = parentOf(declaration);\n\n while (current) {\n if (isImportDeclaration(current)) {\n return (\n isStringLiteralLike(current.moduleSpecifier) &&\n current.moduleSpecifier.text === '@angular/core'\n );\n }\n\n current = parentOf(current);\n }\n\n return false;\n};\n\n/**\n * Follows an alias one hop at a time so every re-exporting file on the way\n * to the target becomes a dependency of the discovery result.\n */\nexport const resolveAlias = (symbol: Symbol, discovery: Discovery): Symbol => {\n let current = symbol;\n\n for (let hop = 0; hop < 32; hop += 1) {\n for (const declaration of current.declarations ?? []) {\n discovery.dependencies.add(declaration.getSourceFile());\n }\n\n if ((current.flags & SymbolFlags.Alias) === 0) return current;\n\n const next = discovery.checker.getImmediateAliasedSymbol(current);\n\n if (!next || next === current) return current;\n\n current = next;\n }\n\n return current;\n};\n\nexport const angularDecoratorKind = (\n expression: Expression,\n discovery: Discovery\n): DecoratorKind | null => {\n const unresolved = discovery.checker.getSymbolAtLocation(expression);\n\n if (!unresolved) return null;\n\n const symbol = resolveAlias(unresolved, discovery);\n const name = symbol.getName();\n const isKind = isDecoratorKind(name);\n\n if (!isKind) return null;\n\n const unresolvedDeclarations = unresolved.declarations ?? [];\n const symbolDeclarations = symbol.declarations ?? [];\n const isCoreImport = unresolvedDeclarations.some(importedFromAngularCore);\n const isCoreDeclaration = symbolDeclarations.some(isAngularCoreFile);\n const fromAngularCore = isCoreImport || isCoreDeclaration;\n\n if (!fromAngularCore) return null;\n\n return name;\n};\n\nexport const classDecoratorKind = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): DecoratorKind | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const kind = angularDecoratorKind(\n decorator.expression.expression,\n discovery\n );\n\n if (kind !== null) return kind;\n }\n\n return null;\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport {\n isIdentifier,\n isNumericLiteral,\n isPropertyAccessExpression,\n isPropertyAssignment,\n isStringLiteralLike\n} from 'typescript';\nimport type { Expression, ObjectLiteralExpression } from 'typescript';\n\nimport { resolveAlias } from './angular-decorator-kind.ts';\nimport type {\n AngularTemplate,\n Discovery\n} from '../common/project-usage.type.ts';\n\n/**\n * The string an expression evaluates to: a literal, or a constant whose\n * type is a single string literal (`const URL = './x.html'`, imported or\n * not). The constant's declaration file becomes a dependency.\n */\nexport const stringValue = (\n node: Expression | undefined,\n discovery: Discovery\n): string | null => {\n if (!node) return null;\n\n const isStringLiteral = isStringLiteralLike(node);\n\n if (isStringLiteral) return node.text;\n\n const isIdentifierNode = isIdentifier(node);\n const isPropertyAccessNode = isPropertyAccessExpression(node);\n\n if (isIdentifierNode || isPropertyAccessNode) {\n const symbol = discovery.checker.getSymbolAtLocation(\n isIdentifier(node) ? node : node.name\n );\n\n if (symbol) {\n resolveAlias(symbol, discovery);\n }\n }\n\n const type = discovery.checker.getTypeAtLocation(node);\n\n return type.isStringLiteral() ? type.value : null;\n};\n\nexport const metadataProperty = (\n metadata: ObjectLiteralExpression,\n name: string\n): Expression | undefined => {\n for (const property of metadata.properties) {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) continue;\n\n const isIdentifierName = isIdentifier(property.name);\n const isStringName = isStringLiteralLike(property.name);\n const isNumericName = isNumericLiteral(property.name);\n const isLiteralName = isIdentifierName || isStringName || isNumericName;\n const isPropertyNamed = isLiteralName && property.name.text === name;\n\n if (isPropertyNamed) return property.initializer;\n }\n\n return undefined;\n};\n\nexport const templateOf = (\n metadata: ObjectLiteralExpression,\n fileName: string,\n discovery: Discovery\n): AngularTemplate | null | undefined => {\n const inline = metadataProperty(metadata, 'template');\n\n if (inline) {\n const source = stringValue(inline, discovery);\n\n if (source === null) return undefined;\n\n const inlineTemplate: AngularTemplate = { kind: 'inline', source };\n\n return inlineTemplate;\n }\n\n const url = metadataProperty(metadata, 'templateUrl');\n\n if (url) {\n const text = stringValue(url, discovery);\n\n if (text === null) return undefined;\n\n const externalFileName = resolve(dirname(fileName), text);\n const externalTemplate: AngularTemplate = {\n fileName: externalFileName,\n kind: 'external'\n };\n\n return externalTemplate;\n }\n\n return null;\n};\n\nexport const exportAsOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): string[] => {\n const exportAsProperty = metadataProperty(metadata, 'exportAs');\n const exportAs = stringValue(exportAsProperty, discovery) ?? '';\n const names = exportAs.split(',').map((name) => name.trim());\n\n return names.filter(Boolean);\n};\n", "const specFilePattern = /\\.spec\\.[cm]?[tj]sx?$/u;\n\nexport const isSpecFile = (fileName: string): boolean => {\n return specFilePattern.test(fileName);\n};\n", "import type { Program, SourceFile } from 'typescript';\n\nimport { templateFileIsCurrent } from './angular/angular-template-reads.ts';\nimport type {\n FileEntry,\n ProjectIndex,\n SourceFileMaps,\n TemplateFileVersion\n} from './common/project-index.type.ts';\nimport { isSpecFile } from './utils/spec-file.util.ts';\n\nconst typeScriptFilePattern = /\\.(?:[cm]?ts|tsx)$/u;\n\nconst isIndexable = (program: Program, sourceFile: SourceFile): boolean => {\n if (sourceFile.isDeclarationFile) return false;\n\n const isExternal = program.isSourceFileFromExternalLibrary(sourceFile);\n\n if (isExternal) return false;\n\n const isSpec = isSpecFile(sourceFile.fileName);\n\n if (isSpec) return false;\n\n return typeScriptFilePattern.test(sourceFile.fileName);\n};\n\nexport const indexableSourceFiles = (program: Program): SourceFile[] => {\n const sourceFiles = program.getSourceFiles();\n\n return sourceFiles.filter((sourceFile) => isIndexable(program, sourceFile));\n};\n\nexport const sourceFileMaps = (program: Program): SourceFileMaps => {\n const all = new Map<string, SourceFile>();\n const current = new Map<string, SourceFile>();\n\n for (const sourceFile of program.getSourceFiles()) {\n all.set(sourceFile.fileName, sourceFile);\n }\n\n for (const sourceFile of indexableSourceFiles(program)) {\n current.set(sourceFile.fileName, sourceFile);\n }\n\n const maps: SourceFileMaps = { all, current };\n\n return maps;\n};\n\nexport const dropEntries = (\n index: ProjectIndex,\n stale: (entry: FileEntry) => boolean\n): void => {\n for (const [fileName, entry] of index.entries) {\n const isStale = stale(entry);\n\n if (isStale) {\n index.entries.delete(fileName);\n }\n }\n};\n\nexport const isReplaced = (\n sourceFile: SourceFile,\n dependencies: ReadonlySet<SourceFile>,\n maps: SourceFileMaps\n): boolean => {\n const indexedSourceFile = maps.current.get(sourceFile.fileName);\n\n if (indexedSourceFile !== sourceFile) return true;\n\n for (const dependency of dependencies) {\n const indexedDependency = maps.all.get(dependency.fileName);\n\n if (indexedDependency !== dependency) return true;\n }\n\n return false;\n};\n\nexport const dropReplacedEntries = (\n index: ProjectIndex,\n maps: SourceFileMaps\n): void => {\n const isEntryReplaced = (entry: FileEntry): boolean => {\n return isReplaced(entry.sourceFile, entry.dependencies, maps);\n };\n\n dropEntries(index, isEntryReplaced);\n};\n\nexport const dropEntriesMentioning = (\n index: ProjectIndex,\n names: ReadonlySet<string>\n): void => {\n if (names.size === 0) return;\n\n if (index.entries.size === 0) return;\n\n const nameList = [...names];\n const mentionsName = (entry: FileEntry): boolean => {\n return nameList.some((name) => entry.sourceFile.text.includes(name));\n };\n\n dropEntries(index, mentionsName);\n};\n\nconst templateVersionChecker = (): ((\n version: TemplateFileVersion\n) => boolean) => {\n const checked = new Map<string, boolean>();\n\n return (version: TemplateFileVersion): boolean => {\n const key = `${version.fileName}\\0${version.mtimeNs}\\0${version.size}`;\n const known = checked.get(key);\n\n if (known !== undefined) return known;\n\n const current = templateFileIsCurrent(version);\n\n checked.set(key, current);\n\n return current;\n };\n};\n\nexport const dropStaleTemplateEntries = (\n index: ProjectIndex,\n force: boolean\n): void => {\n const now = performance.now();\n const sinceLastCheck = now - index.templateCheckedAt;\n const isThrottled =\n !force && sinceLastCheck < index.templateCheckDuration * 100;\n\n if (isThrottled) return;\n\n const isCurrent = templateVersionChecker();\n const hasStaleTemplate = (entry: FileEntry): boolean => {\n return !entry.templateVersions.every(isCurrent);\n };\n\n dropEntries(index, hasStaleTemplate);\n\n index.templateCheckedAt = now;\n index.templateCheckDuration = performance.now() - now;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isClassLike,\n isIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { ClassLikeDeclaration, Node, SourceFile } from 'typescript';\n\nconst isDecoratedClass = (node: ClassLikeDeclaration): boolean => {\n const isDecoratable = canHaveDecorators(node);\n\n if (!isDecoratable) return false;\n\n const decorators = getDecorators(node);\n const decoratorCount = decorators?.length ?? 0;\n\n return decoratorCount > 0;\n};\n\nconst addMemberNames = (node: Node, names: Set<string>): void => {\n const isClass = isClassLike(node);\n\n if (!isClass) return;\n\n const isDecorated = isDecoratedClass(node);\n\n if (!isDecorated) return;\n\n for (const member of node.members) {\n if (!member.name) continue;\n\n const isIdentifierName = isIdentifier(member.name);\n const isStringName = isStringLiteralLike(member.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (isNamedMember) {\n names.add(member.name.text);\n }\n }\n};\n\n/** Names of members declared by decorated classes in one source file. */\nexport const collectCandidateNames = (sourceFile: SourceFile): Set<string> => {\n const names = new Set<string>();\n\n const visit = (node: Node): void => {\n addMemberNames(node, names);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return names;\n};\n", "import type { SourceFile } from 'typescript';\n\nimport { angularClasses } from './angular/angular-component-discovery.ts';\nimport {\n buildDirectiveIndex,\n directiveShape\n} from './angular/angular-directive-index.ts';\nimport type {\n FileClasses,\n LazyChecker,\n ProjectIndex,\n SourceFileMaps\n} from './common/project-index.type.ts';\nimport { dropEntries, isReplaced } from './project-index-staleness.ts';\nimport { collectCandidateNames } from './typescript/typescript-candidate-names.ts';\n\nconst dropReplacedClasses = (\n index: ProjectIndex,\n maps: SourceFileMaps\n): boolean => {\n let changed = false;\n\n for (const [fileName, fileClasses] of index.classes) {\n const replaced = isReplaced(\n fileClasses.sourceFile,\n fileClasses.dependencies,\n maps\n );\n\n if (!replaced) continue;\n\n index.classes.delete(fileName);\n changed = true;\n }\n\n return changed;\n};\n\nconst addCandidateNames = (\n index: ProjectIndex,\n candidateNames: ReadonlySet<string>,\n newNames: Set<string>\n): void => {\n for (const name of candidateNames) {\n const isKnownName = index.candidateNames.has(name);\n\n if (isKnownName) continue;\n\n index.candidateNames.add(name);\n newNames.add(name);\n }\n};\n\nconst indexFileClasses = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: LazyChecker,\n newNames: Set<string>\n): void => {\n const candidateNames = collectCandidateNames(sourceFile);\n\n addCandidateNames(index, candidateNames, newNames);\n\n const { classes, dependencies } = angularClasses(sourceFile, checker());\n const fileClasses: FileClasses = {\n candidateNames,\n classes,\n dependencies,\n sourceFile\n };\n\n index.classes.set(sourceFile.fileName, fileClasses);\n index.entries.delete(sourceFile.fileName);\n};\n\nconst indexNewClasses = (\n index: ProjectIndex,\n current: ReadonlyMap<string, SourceFile>,\n checker: LazyChecker,\n newNames: Set<string>\n): boolean => {\n let changed = false;\n\n for (const [fileName, sourceFile] of current) {\n const isIndexed = index.classes.has(fileName);\n\n if (isIndexed) continue;\n\n indexFileClasses(index, sourceFile, checker, newNames);\n changed = true;\n }\n\n return changed;\n};\n\nconst rebuildDirectives = (index: ProjectIndex): void => {\n const fileClasses = [...index.classes.values()];\n const classes = fileClasses.flatMap((entry) => entry.classes);\n const shape = directiveShape(classes);\n\n index.directives = buildDirectiveIndex(classes);\n\n if (shape === index.directiveShape) return;\n\n index.directiveShape = shape;\n dropEntries(index, (entry) => entry.usedDirectiveIndex);\n};\n\n/** Re-index changed files' classes; returns member names never seen before. */\nexport const reconcileClasses = (\n index: ProjectIndex,\n maps: SourceFileMaps,\n checker: LazyChecker\n): Set<string> => {\n const newNames = new Set<string>();\n const droppedClasses = dropReplacedClasses(index, maps);\n const addedClasses = indexNewClasses(index, maps.current, checker, newNames);\n const changed = droppedClasses || addedClasses;\n\n if (changed) {\n rebuildDirectives(index);\n }\n\n return newNames;\n};\n", "import type { Program, SourceFile, TypeChecker } from 'typescript';\n\nimport type { LazyChecker, ProjectIndex } from './common/project-index.type.ts';\nimport { computeEntry } from './project-file-entry.ts';\nimport { reconcileClasses } from './project-index-classes.ts';\nimport {\n dropEntriesMentioning,\n dropReplacedEntries,\n dropStaleTemplateEntries,\n indexableSourceFiles,\n sourceFileMaps\n} from './project-index-staleness.ts';\n\nconst lazyChecker = (program: Program): LazyChecker => {\n let typeChecker: TypeChecker | undefined;\n\n return () => (typeChecker ??= program.getTypeChecker());\n};\n\nconst indexMissingEntries = (\n index: ProjectIndex,\n sourceFiles: Iterable<SourceFile>,\n checker: LazyChecker\n): void => {\n for (const sourceFile of sourceFiles) {\n const isEntryIndexed = index.entries.has(sourceFile.fileName);\n\n if (isEntryIndexed) continue;\n\n const entry = computeEntry(index, sourceFile, checker());\n\n index.entries.set(sourceFile.fileName, entry);\n }\n};\n\nconst reindexProgram = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const maps = sourceFileMaps(program);\n\n dropReplacedEntries(index, maps);\n\n const newNames = reconcileClasses(index, maps, checker);\n\n dropEntriesMentioning(index, newNames);\n\n index.program = program;\n index.usage = undefined;\n dropStaleTemplateEntries(index, true);\n indexMissingEntries(index, maps.current.values(), checker);\n};\n\nconst refreshTemplateEntries = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const entryCount = index.entries.size;\n\n dropStaleTemplateEntries(index, false);\n\n const isUnchanged = index.entries.size === entryCount;\n\n if (isUnchanged) return;\n\n index.usage = undefined;\n indexMissingEntries(index, indexableSourceFiles(program), checker);\n};\n\nexport const reconcile = (index: ProjectIndex, program: Program): void => {\n const checker = lazyChecker(program);\n const isNewProgram = index.program !== program;\n\n if (isNewProgram) {\n reindexProgram(index, program, checker);\n\n return;\n }\n\n refreshTemplateEntries(index, program, checker);\n};\n", "import { defineConfig } from 'eslint/config';\n\nimport { baseLimits } from './base-limits.ts';\nimport { basePractices } from './base-practices.ts';\nimport { baseRecommended } from './base-recommended.ts';\n\nexport const base = defineConfig([\n ...baseRecommended,\n ...basePractices,\n ...baseLimits\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const baseLimits = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts',\n '**/*.html'\n ],\n rules: {\n 'max-lines': [\n 'error',\n {\n max: 150,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n 'max-lines-per-function': 'off',\n complexity: ['warn', { max: 3 }],\n 'max-lines': [\n 'error',\n {\n max: 300,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n 'max-classes-per-file': 'off'\n }\n },\n {\n files: ['**/*.state.ts'],\n rules: {\n 'class-methods-use-this': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const basePractices = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'no-param-reassign': 'error',\n 'no-alert': 'error',\n 'no-console': ['warn', { allow: ['warn', 'error'] }],\n 'no-debugger': 'error',\n eqeqeq: ['error', 'always', { null: 'ignore' }],\n curly: ['error', 'multi-line'],\n 'prefer-const': ['error', { destructuring: 'all' }],\n 'no-var': 'error',\n 'object-shorthand': 'error',\n 'prefer-arrow-callback': 'error',\n 'no-useless-concat': 'error',\n 'prefer-template': 'error',\n 'no-nested-ternary': 'error',\n 'no-useless-assignment': 'error', // NEW: Catch unused assignments (ESLint v9)\n 'no-object-constructor': 'error', // Disallow new Object() without arguments\n 'no-else-return': ['error', { allowElseIf: false }], // Prefer early returns\n 'no-multi-assign': 'error', // Disallow chaining assignments\n radix: 'error', // Require radix parameter for parseInt()\n yoda: 'error', // Disallow yoda conditions (`if (\"red\" === color)`)\n complexity: ['warn', 10], // Warn if function complexity is high\n 'max-depth': ['warn', 4], // Warn on deeply nested blocks\n 'max-lines-per-function': [\n 'warn',\n { max: 50, skipBlankLines: true, skipComments: true }\n ], // Warn on long functions\n 'max-params': ['warn', 4], // Warn on functions with many parameters\n 'no-lonely-if': 'error', // Disallow if statements as the only statement in an else block\n 'grouped-accessor-pairs': ['error', 'getBeforeSet'], // Enforce consistency for getters/setters\n 'class-methods-use-this': 'error',\n 'no-underscore-dangle': 'error',\n 'max-len': [\n 'error',\n {\n code: 135,\n ignoreComments: true\n }\n ],\n 'spaced-comment': [\n 2,\n 'always',\n {\n block: {\n exceptions: ['*']\n }\n }\n ],\n '@stylistic/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n prev: 'export',\n next: ['export', 'const']\n },\n {\n blankLine: 'always',\n prev: ['const', 'let', 'var'],\n next: '*'\n },\n {\n blankLine: 'any',\n prev: ['const', 'let', 'var'],\n next: ['const', 'let', 'var']\n },\n {\n blankLine: 'always',\n prev: '*',\n next: [\n 'for',\n 'if',\n 'return',\n 'throw',\n 'switch',\n 'try',\n 'class',\n 'function'\n ]\n }\n ],\n '@stylistic/comma-dangle': ['error', 'never'],\n '@stylistic/indent': [\n 'error',\n 2,\n {\n offsetTernaryExpressions: true,\n SwitchCase: 1,\n ignoredNodes: [\n 'TSTypeParameterInstantiation',\n 'FunctionExpression > .params > :matches(Decorator, :not(:first-child))'\n ]\n }\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n allowSeparatedGroups: true\n }\n ]\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport stylistic from '@stylistic/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\n\nexport const baseRecommended = defineConfig([\n { extends: [...configs['flat/base']] },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [importPluginX.flatConfigs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [stylistic.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport boundariesPlugin from 'eslint-plugin-boundaries';\n\nexport const boundaries = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n boundaries: boundariesPlugin\n },\n settings: {\n 'boundaries/elements': [\n {\n type: 'feature',\n pattern: '**/feature/**'\n },\n {\n type: 'data-access',\n pattern: '**/data-access/**'\n },\n {\n type: 'domain-logic',\n pattern: '**/domain-logic/**'\n },\n {\n type: 'ui',\n pattern: '**/ui/**'\n },\n {\n type: 'common',\n pattern: '**/common/**'\n },\n {\n type: 'utils',\n pattern: '**/utils/**'\n }\n ],\n 'import/resolver': {\n typescript: {\n alwaysTryTypes: true\n }\n }\n },\n rules: {\n ...boundariesPlugin.configs.recommended.rules,\n 'boundaries/dependencies': [\n 'error',\n {\n default: 'disallow',\n message:\n '{{to.element.types}} is not allowed to be imported in {{from.element.types}}',\n policies: [\n {\n from: { element: { type: 'feature' } },\n allow: [\n { to: { element: { type: 'feature' } } },\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'domain-logic' } },\n allow: [\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'data-access' } },\n allow: [\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'ui' } },\n allow: [\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'utils' } },\n allow: [\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'common' } },\n allow: [{ to: { element: { type: 'common' } } }]\n }\n ]\n }\n ]\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n 'boundaries/dependencies': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxJavascript: CompatibleConfigArray = configs['flat/javascript'];\n\nexport const javascript = defineConfig({\n files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],\n extends: nxJavascript\n});\n", "import jsonPlugin from '@eslint/json';\nimport { defineConfig } from 'eslint/config';\n\nexport const json = defineConfig([\n {\n plugins: { json: jsonPlugin }\n },\n {\n files: ['**/*.json'],\n language: 'json/json',\n extends: [jsonPlugin.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport playwrightEslint from 'eslint-plugin-playwright';\n\nexport const playwright = defineConfig([\n {\n ...playwrightEslint.configs['flat/recommended'],\n files: ['**/*.e2e.ts', '**/*.e2e.js'],\n rules: {\n ...playwrightEslint.configs['flat/recommended'].rules,\n // Locator best practices\n 'playwright/prefer-locator': 'error',\n 'playwright/prefer-native-locators': 'error',\n 'playwright/no-nth-methods': 'warn',\n // Matcher improvements\n 'playwright/prefer-to-be': 'error',\n 'playwright/prefer-to-have-count': 'error',\n 'playwright/prefer-to-have-length': 'error',\n 'playwright/prefer-comparison-matcher': 'error',\n // Test structure\n 'playwright/prefer-hooks-on-top': 'error',\n 'playwright/require-top-level-describe': 'warn'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport eslintConfigPrettier from 'eslint-config-prettier';\n\nexport const prettier = defineConfig([eslintConfigPrettier]);\n", "import rxjsEslint from '@smarttools/eslint-plugin-rxjs';\nimport { defineConfig } from 'eslint/config';\n\nexport const rxjs = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n extends: [rxjsEslint.configs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n rxjs: rxjsEslint\n }\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'rxjs/prefer-observer': 'error',\n 'rxjs/finnish': 'warn',\n 'rxjs/no-ignored-subscription': 'warn',\n 'rxjs/no-ignored-error': 'warn',\n 'rxjs/no-unsafe-switchmap': 'error',\n 'rxjs/no-unsafe-takeuntil': 'error',\n 'rxjs/no-unsafe-catch': 'error',\n 'rxjs/no-unsafe-first': 'error',\n 'rxjs/no-topromise': 'error',\n 'rxjs/throw-error': 'error',\n 'rxjs/no-async-subscribe': 'off',\n 'rxjs/no-exposed-subjects': 'error', // Enforce subject encapsulation\n 'rxjs/no-cyclic-action': 'error', // Prevent infinite loops in NgRx effects\n 'rxjs/no-subscribe-handlers': 'warn' // Prefer observer objects (complements prefer-observer)\n }\n },\n {\n files: ['**/*.spec.ts', '**/*.test.ts', '**/*.spec.js', '**/*.test.js'],\n rules: {\n 'rxjs/no-ignored-subscription': 'off',\n 'rxjs/no-subscribe-handlers': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport storybookEslint from 'eslint-plugin-storybook';\n\nexport const storybook = defineConfig([\n {\n ignores: ['!.storybook'],\n files: ['**/*.stories.ts'],\n extends: [storybookEslint.configs['flat/recommended']],\n rules: {\n 'storybook/csf-component': 'warn', // Ensure component property is set\n 'storybook/no-stories-of': 'error' // Prevent deprecated storiesOf API\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { typescriptConsistency } from './typescript-consistency.ts';\nimport { typescriptImports } from './typescript-imports.ts';\nimport { typescriptOverrides } from './typescript-overrides.ts';\nimport { typescriptRecommended } from './typescript-recommended.ts';\nimport { typescriptSafety } from './typescript-safety.ts';\n\nexport { localPlugin } from './typescript-local-plugin.ts';\n\nexport const typescript = defineConfig([\n ...typescriptRecommended,\n ...typescriptSafety,\n ...typescriptConsistency,\n ...typescriptImports,\n ...typescriptOverrides\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptConsistency = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': [\n 'error',\n { assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }\n ],\n '@typescript-eslint/consistent-type-definitions': ['error', 'type'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n { prefer: 'type-imports', fixStyle: 'separate-type-imports' }\n ],\n '@typescript-eslint/naming-convention': [\n 'error',\n {\n selector: ['objectLiteralProperty', 'objectLiteralMethod'],\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'objectLiteralMethod',\n format: ['camelCase', 'PascalCase']\n },\n {\n selector: 'objectLiteralProperty',\n format: ['camelCase', 'snake_case', 'PascalCase']\n },\n {\n selector: 'parameter',\n format: ['camelCase'],\n leadingUnderscore: 'allow'\n },\n { selector: 'default', format: ['camelCase'] },\n { selector: 'variable', format: ['camelCase', 'UPPER_CASE'] },\n { selector: 'function', format: ['camelCase'] },\n { selector: 'typeLike', format: ['PascalCase'] },\n {\n selector: 'property',\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'property',\n format: ['camelCase', 'PascalCase', 'snake_case']\n }\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';\n\nconst pathGroups = [\n { pattern: '@angular/**', group: 'builtin', position: 'before' },\n { pattern: '@nestjs/**', group: 'builtin', position: 'before' },\n { pattern: '@shared/**', group: 'internal', position: 'before' },\n { pattern: '@backend/**', group: 'internal', position: 'before' },\n { pattern: '@frontend/**', group: 'internal', position: 'before' },\n { pattern: '@*/shared/**', group: 'internal', position: 'before' },\n { pattern: '@*/frontend/**', group: 'internal', position: 'after' },\n { pattern: '@*/backend/**', group: 'internal', position: 'after' }\n];\n\nexport const typescriptImports = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n 'import-x/order': [\n 'error',\n {\n groups: [\n 'builtin',\n 'external',\n 'internal',\n ['parent', 'sibling'],\n 'index',\n 'unknown'\n ],\n pathGroups,\n pathGroupsExcludedImportTypes: ['builtin'],\n 'newlines-between': 'always',\n alphabetize: { order: 'asc', caseInsensitive: true }\n }\n ],\n // TypeScript already checks these four; import-x would re-parse every import with a parser resolved by name, which fails under pnpm.\n 'import-x/namespace': 'off',\n 'import-x/default': 'off',\n 'import-x/no-named-as-default': 'off',\n 'import-x/no-named-as-default-member': 'off',\n 'import-x/no-unresolved': 'error',\n 'import-x/no-duplicates': 'error',\n 'import-x/prefer-default-export': 'off',\n 'import-x/no-useless-path-segments': ['error', { noUselessIndex: true }],\n 'import-x/newline-after-import': 'error',\n 'import-x/first': 'error',\n 'import-x/no-mutable-exports': 'error',\n 'import-x/no-self-import': 'error',\n 'import-x/no-cycle': ['error', { maxDepth: 2, ignoreExternal: true }],\n 'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],\n 'import-x/no-anonymous-default-export': 'error'\n },\n settings: {\n 'import-x/resolver-next': [\n createTypeScriptImportResolver({\n alwaysTryTypes: true\n })\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptOverrides = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n rules: {\n '@typescript-eslint/prefer-readonly': 'error'\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n '@typescript-eslint/no-namespace': 'off',\n '@typescript-eslint/no-extraneous-class': 'off'\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/unbound-method': 'off',\n '@typescript-eslint/consistent-type-assertions': 'off'\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': 'off',\n '@typescript-eslint/naming-convention': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxTypescript: CompatibleConfigArray = configs['flat/typescript'];\n\nexport const typescriptRecommended = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n extends: [importPluginX.flatConfigs.typescript, ...nxTypescript]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { localPlugin } from './typescript-local-plugin.ts';\n\nexport const typescriptSafety = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n plugins: { local: localPlugin },\n rules: {\n 'local/explicit-accessibility': 'error',\n 'local/readonly-type-properties': 'error',\n 'local/no-inline-object-types': 'error',\n '@typescript-eslint/explicit-function-return-type': 'error',\n '@typescript-eslint/no-empty-function': 'error',\n '@typescript-eslint/no-unused-vars': 'error',\n '@typescript-eslint/no-use-before-define': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n '@typescript-eslint/no-unsafe-assignment': 'error',\n '@typescript-eslint/no-unsafe-call': 'error',\n '@typescript-eslint/no-unsafe-member-access': 'error',\n '@typescript-eslint/no-unsafe-return': 'error',\n '@typescript-eslint/no-unsafe-argument': 'error',\n '@typescript-eslint/no-empty-object-type': 'error',\n '@typescript-eslint/no-unsafe-function-type': 'error',\n '@typescript-eslint/no-wrapper-object-types': 'error',\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-non-null-assertion': 'error',\n '@typescript-eslint/prefer-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-optional-chain': 'error',\n '@typescript-eslint/no-floating-promises': [\n 'error',\n { ignoreVoid: true }\n ],\n '@typescript-eslint/no-misused-promises': 'warn',\n '@typescript-eslint/promise-function-async': 'error',\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-inferrable-types': 'warn',\n '@typescript-eslint/no-require-imports': 'error',\n '@typescript-eslint/only-throw-error': 'error',\n '@typescript-eslint/no-array-delete': 'error',\n '@typescript-eslint/return-await': ['error', 'in-try-catch'],\n '@typescript-eslint/require-await': 'error',\n '@typescript-eslint/restrict-template-expressions': [\n 'error',\n { allowNumber: true, allowBoolean: true }\n ],\n '@typescript-eslint/restrict-plus-operands': 'error',\n '@typescript-eslint/prefer-as-const': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/switch-exhaustiveness-check': 'error',\n '@typescript-eslint/no-unused-expressions': [\n 'error',\n { allowShortCircuit: true, allowTernary: true }\n ],\n '@typescript-eslint/no-useless-constructor': 'error',\n '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],\n '@typescript-eslint/no-unnecessary-condition': 'error',\n '@typescript-eslint/no-confusing-void-expression': [\n 'error',\n { ignoreArrowShorthand: true, ignoreVoidOperator: true }\n ],\n '@typescript-eslint/no-dynamic-delete': 'error',\n '@typescript-eslint/no-extraneous-class': [\n 'error',\n { allowWithDecorator: true }\n ],\n '@typescript-eslint/no-invalid-void-type': 'error',\n '@typescript-eslint/unified-signatures': 'error',\n '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-find': 'error',\n '@typescript-eslint/prefer-for-of': 'error',\n '@typescript-eslint/prefer-includes': 'error',\n '@typescript-eslint/prefer-string-starts-ends-with': 'error',\n '@typescript-eslint/prefer-regexp-exec': 'error'\n }\n }\n]);\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n accessibilities,\n defaultOptions,\n meta\n} from './common/explicit-accessibility.const.ts';\nimport type {\n Accessibility,\n AutoFix,\n Fix,\n FixAccessibility,\n Member,\n MessageIds,\n Options\n} from './common/explicit-accessibility.type.ts';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#explicit-accessibility'\n);\n\nconst isPrivateMember = (node: Member): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.TSParameterProperty) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.PrivateIdentifier;\n};\n\nconst isConstructor = (node: Member): boolean => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.kind === 'constructor';\n};\n\nconst reportTarget = (node: Member): TSESTree.Node => {\n if (node.type !== TSESTree.AST_NODE_TYPES.TSParameterProperty) {\n return node.key;\n }\n\n const { parameter } = node;\n\n if (parameter.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parameter.left;\n }\n\n return parameter;\n};\n\nconst memberName = (\n target: TSESTree.Node,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (target.type === TSESTree.AST_NODE_TYPES.Identifier) return target.name;\n\n return sourceCode.getText(target);\n};\n\nconst modifierToken = (\n node: Member,\n sourceCode: TSESLint.SourceCode\n): TSESTree.Token | null => {\n const lastDecorator = node.decorators.at(-1);\n\n if (!lastDecorator) return sourceCode.getFirstToken(node);\n\n return sourceCode.getTokenAfter(lastDecorator);\n};\n\nconst insertModifier = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): Fix => {\n const token = modifierToken(node, sourceCode);\n\n if (!token) return () => null;\n\n const lastDecorator = node.decorators.at(-1);\n const adjacentToDecorator = lastDecorator?.range[1] === token.range[0];\n const text = `${adjacentToDecorator ? ' ' : ''}${accessibility} `;\n\n return (fixer) => fixer.insertTextBefore(token, text);\n};\n\nconst autoFixOf = (\n node: Member,\n accessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): AutoFix => {\n if (accessibility === 'none') {\n const noAutoFix: AutoFix = {};\n\n return noAutoFix;\n }\n\n const fix = insertModifier(node, accessibility, sourceCode);\n const autoFix: AutoFix = { fix };\n\n return autoFix;\n};\n\nconst suggestionOf = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const data = { accessibility };\n const fix = insertModifier(node, accessibility, sourceCode);\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'setAccessibility',\n data,\n fix\n };\n\n return suggestion;\n};\n\nconst suggestionsOf = (\n node: Member,\n fixAccessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds>[] => {\n const isOtherAccessibility = (accessibility: Accessibility): boolean => {\n return accessibility !== fixAccessibility;\n };\n\n const suggestionFor = (\n accessibility: Accessibility\n ): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n return suggestionOf(node, accessibility, sourceCode);\n };\n\n return accessibilities.filter(isOtherAccessibility).map(suggestionFor);\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'explicit-accessibility',\n meta,\n defaultOptions,\n create(context, [{ defaultAccessibility = 'public' }]) {\n const { sourceCode } = context;\n\n const check = (node: Member): void => {\n const isPrivate = isPrivateMember(node);\n\n if (node.accessibility || isPrivate) return;\n\n const target = reportTarget(node);\n const isConstructorMember = isConstructor(node);\n const usesPublic = isConstructorMember && defaultAccessibility !== 'none';\n const fixAccessibility: FixAccessibility = usesPublic\n ? 'public'\n : defaultAccessibility;\n const autoFix = autoFixOf(node, fixAccessibility, sourceCode);\n const name = memberName(target, sourceCode);\n const data = { name };\n const suggest = suggestionsOf(node, fixAccessibility, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: target,\n messageId: 'missingAccessibility',\n data,\n ...autoFix,\n suggest\n };\n\n context.report(report);\n };\n\n const listeners: TSESLint.RuleListener = {\n AccessorProperty: check,\n MethodDefinition: check,\n PropertyDefinition: check,\n TSAbstractAccessorProperty: check,\n TSAbstractMethodDefinition: check,\n TSAbstractPropertyDefinition: check,\n TSParameterProperty: check\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type {\n Accessibility,\n MessageIds,\n Options\n} from './explicit-accessibility.type.ts';\n\nexport const accessibilities: readonly Accessibility[] = [\n 'public',\n 'private',\n 'protected'\n];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description: 'Require explicit accessibility modifiers on class members'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingAccessibility:\n \"Class member '{{ name }}' is missing an explicit accessibility modifier (public/private/protected).\",\n setAccessibility: \"Add the '{{ accessibility }}' modifier.\"\n};\n\nconst defaultAccessibilitySchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['public', 'private', 'protected', 'none'],\n description:\n \"The accessibility modifier inserted by the auto-fix; constructors always get public. 'none' reports without an auto-fix and offers all three levels as suggestions.\"\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n defaultAccessibility: defaultAccessibilitySchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n hasSuggestions: true,\n schema,\n messages\n};\n\nexport const defaultOptions: Options = [{ defaultAccessibility: 'public' }];\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'inlineObjectType';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require nested object types inside a type alias to be extracted to a named type alias'\n};\n\nconst messages: Record<MessageIds, string> = {\n inlineObjectType:\n 'Inline object type must be extracted to a named type alias.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-inline-object-types'\n);\n\nconst enclosingTypeAlias = (\n node: TSESTree.Node\n): TSESTree.TSTypeAliasDeclaration | undefined => {\n let current: TSESTree.Node | undefined = node.parent;\n\n while (current && current.type !== TSESTree.AST_NODE_TYPES.Program) {\n if (current.type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration) {\n return current;\n }\n\n current = current.parent;\n }\n\n return undefined;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-inline-object-types',\n meta,\n defaultOptions: [],\n create(context) {\n const listeners: TSESLint.RuleListener = {\n TSTypeLiteral(node): void {\n const isAliasBody =\n node.parent.type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration;\n\n if (isAliasBody) return;\n\n const enclosingAlias = enclosingTypeAlias(node);\n\n if (!enclosingAlias) return;\n\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'inlineObjectType'\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'missingReadonly';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require readonly on primitive-typed type and interface properties'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingReadonly:\n \"Type property '{{ name }}' should be readonly. Disable this rule on the line if mutation is required.\"\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#readonly-type-properties'\n);\n\nconst propertyName = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (node.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return node.key.name;\n }\n\n return sourceCode.getText(node.key);\n};\n\nconst PRIMITIVE_KEYWORDS = new Set([\n TSESTree.AST_NODE_TYPES.TSStringKeyword,\n TSESTree.AST_NODE_TYPES.TSNumberKeyword,\n TSESTree.AST_NODE_TYPES.TSBooleanKeyword,\n TSESTree.AST_NODE_TYPES.TSBigIntKeyword,\n TSESTree.AST_NODE_TYPES.TSSymbolKeyword,\n TSESTree.AST_NODE_TYPES.TSNullKeyword,\n TSESTree.AST_NODE_TYPES.TSUndefinedKeyword\n]);\n\nconst isPrimitive = (type: TSESTree.TypeNode): boolean => {\n const isPrimitiveKeyword = PRIMITIVE_KEYWORDS.has(type.type);\n\n if (isPrimitiveKeyword) return true;\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSLiteralType ||\n type.type === TSESTree.AST_NODE_TYPES.TSTemplateLiteralType\n ) {\n return true;\n }\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSUnionType ||\n type.type === TSESTree.AST_NODE_TYPES.TSIntersectionType\n ) {\n return type.types.every(isPrimitive);\n }\n\n return false;\n};\n\nconst readonlyFix = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): TSESLint.ReportFixFunction => {\n return (fixer) => {\n const firstToken = sourceCode.getFirstToken(node);\n\n if (!firstToken) return null;\n\n return fixer.insertTextBefore(firstToken, 'readonly ');\n };\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'readonly-type-properties',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n TSPropertySignature(node): void {\n if (node.readonly || !node.typeAnnotation) return;\n\n const isPrimitiveType = isPrimitive(node.typeAnnotation.typeAnnotation);\n\n if (!isPrimitiveType) return;\n\n const name = propertyName(node, sourceCode);\n const data = { name };\n const fix = readonlyFix(node, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: node.key,\n messageId: 'missingReadonly',\n data,\n fix\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { definePlugin } from './rules/define-plugin.util.ts';\nimport explicitAccessibilityRule from './rules/explicit-accessibility/explicit-accessibility.ts';\nimport noInlineObjectTypesRule from './rules/no-inline-object-types/no-inline-object-types.ts';\nimport readonlyTypePropertiesRule from './rules/readonly-type-properties/readonly-type-properties.ts';\n\nexport const localPlugin = definePlugin('local', {\n 'explicit-accessibility': explicitAccessibilityRule,\n 'readonly-type-properties': readonlyTypePropertiesRule,\n 'no-inline-object-types': noInlineObjectTypesRule\n});\n", "import vitestEslint from '@vitest/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\n\nconst vitestPlugin = {\n vitest: vitestEslint\n};\n\nexport const vitest = defineConfig([\n {\n files: ['**/*.spec.ts', '**/*.spec.js', '**/*.test.ts', '**/*.test.js'],\n plugins: vitestPlugin,\n rules: {\n ...vitestEslint.configs.recommended.rules,\n 'vitest/max-nested-describe': ['error', { max: 3 }],\n // Matcher improvements\n 'vitest/prefer-to-be': 'error',\n 'vitest/prefer-to-contain': 'error',\n 'vitest/prefer-to-have-length': 'error',\n 'vitest/prefer-comparison-matcher': 'error',\n 'vitest/prefer-strict-equal': 'warn',\n // Test quality\n 'vitest/prefer-spy-on': 'error',\n 'vitest/prefer-hooks-on-top': 'error',\n 'vitest/prefer-each': 'warn',\n 'vitest/no-test-return-statement': 'error',\n 'vitest/prefer-mock-promise-shorthand': 'error'\n }\n }\n]);\n", "import type { ConfigArray } from 'typescript-eslint';\n\nimport { angularTemplate } from './lib/angular-template.ts';\nimport { angular } from './lib/angular.ts';\nimport { base } from './lib/base.ts';\nimport { boundaries } from './lib/boundaries.ts';\nimport { javascript } from './lib/javascript.ts';\nimport { json } from './lib/json.ts';\nimport { playwright } from './lib/playwright.ts';\nimport { prettier } from './lib/prettier.ts';\nimport { rxjs } from './lib/rxjs.ts';\nimport { storybook } from './lib/storybook.ts';\nimport { typescript } from './lib/typescript.ts';\nimport { vitest } from './lib/vitest.ts';\n\nexport const recommended: ConfigArray = [\n ...base,\n ...javascript,\n ...typescript,\n ...json,\n ...boundaries,\n ...prettier // Must be last to disable formatting rules that conflict with Prettier\n];\n\nexport {\n base,\n javascript,\n typescript,\n angular,\n angularTemplate,\n rxjs,\n json,\n boundaries,\n storybook,\n vitest,\n playwright,\n prettier\n};\n"],
5
- "mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAEtB,IAAM,kBAAkB,aAAa;AAAA,EAC1C;AAAA,IACE,OAAO,CAAC,WAAW;AAAA,IACnB,SAAS,CAAC,GAAG,QAAQ,uBAAuB,GAAG,QAAQ,mBAAmB;AAAA,IAC1E,OAAO;AAAA,MACL,oDAAoD;AAAA,MACpD,mCAAmC;AAAA,MACnC,oDAAoD;AAAA,MACpD,4CAA4C;AAAA,MAC5C,iDAAiD;AAAA,MACjD,uCAAuC;AAAA,MACvC,qCAAqC;AAAA,MACrC,6CAA6C;AAAA,MAC7C,yDAAyD;AAAA,MACzD,yDAAyD;AAAA,MACzD,wCAAwC;AAAA,MACxC,yCAAyC;AAAA,MACzC,oDAAoD;AAAA,MACpD,gDAAgD;AAAA,MAChD,qDAAqD;AAAA,MACrD,yCAAyC;AAAA,MACzC,kDAAkD;AAAA,MAClD,2DAA2D;AAAA,MAC3D,2C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AAA,EACnB,QAAQ;AACV;AAEO,IAAM,SAASA,eAAa;AAAA,EACjC;AAAA,IACE,OAAO,CAAC,gBAAgB,gBAAgB,gBAAgB,cAAc;AAAA,IACtE,SAAS;AAAA,IACT,OAAO;AAAA,MACL,GAAG,aAAa,QAAQ,YAAY;AAAA,MACpC,8BAA8B,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;AAAA;AAAA,MAElD,uBAAuB;AAAA,MACvB,4BAA4B;AAAA,MAC5B,gCAAgC;AAAA,MAChC,oCAAoC;AAAA,MACpC,8BAA8B;AAAA;AAAA,MAE9B,wBAAwB;AAAA,MACxB,8BAA8B;AAAA,MAC9B,sBAAsB;AAAA,MACtB,mCAAmC;AAAA,MACnC,wCAAwC;AAAA,IAC1C;AAAA,EACF;AACF,CAAC;;;ACbM,IAAM,cAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AACL;",
6
- "names": ["configs", "defineConfig", "meta", "isIdentifier", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "KeyedRead", "SafeKeyedRead", "KeyedRead", "SafeKeyedRead", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "isDeleteExpression", "TSESTree", "isIdentifier", "isStringLiteralLike", "angularClass", "readFileSync", "statSync", "R3TargetBinder", "ThisReceiver", "parseTemplate", "CombinedRecursiveAstVisitor", "ImplicitReceiver", "KeyedRead", "PropertyRead", "SafeKeyedRead", "SafePropertyRead", "ThisReceiver", "PropertyRead", "SafePropertyRead", "ImplicitReceiver", "ThisReceiver", "ReadCollector", "CombinedRecursiveAstVisitor", "KeyedRead", "SafeKeyedRead", "text", "templateBinder", "R3TargetBinder", "ThisReceiver", "angularClass", "parseTemplate", "ReadCollector", "templateReads", "statSync", "angularClass", "readFileSync", "templateReads", "isIdentifier", "isStringLiteralLike", "memberNames", "propertyName", "isIdentifier", "isStringLiteralLike", "SyntaxKind", "isArrayLiteralExpression", "isObjectLiteralExpression", "propertyName", "isIdentifier", "isOmittedExpression", "nestedPattern", "propertyName", "isIdentifier", "arrayElementRead", "isOmittedExpression", "SyntaxKind", "isArrayLiteralExpression", "isObjectLiteralExpression", "SyntaxKind", "isArrayLiteralExpression", "isBinaryExpression", "isObjectLiteralExpression", "isPropertyAssignment", "isSpreadAssignment", "isWriteOnly", "isWriteTarget", "isWriteOnly", "TypeFlags", "base", "canHaveDecorators", "forEachChild", "getDecorators", "isCallExpression", "isClassLike", "isObjectLiteralExpression", "SyntaxKind", "isArrayLiteralExpression", "isClassLike", "isIdentifier", "isPropertyAccessExpression", "SymbolFlags", "isStringLiteralLike", "parentOf", "dirname", "resolve", "isIdentifier", "isNumericLiteral", "isPropertyAccessExpression", "isPropertyAssignment", "isStringLiteralLike", "isStringLiteralLike", "isIdentifier", "isPropertyAccessExpression", "isPropertyAssignment", "isNumericLiteral", "text", "resolve", "dirname", "SyntaxKind", "isClassLike", "isIdentifier", "isPropertyAccessExpression", "isArrayLiteralExpression", "base", "isObjectLiteralExpression", "canHaveDecorators", "getDecorators", "isCallExpression", "isClassLike", "forEachChild", "key", "canHaveDecorators", "forEachChild", "getDecorators", "isClassLike", "isIdentifier", "isStringLiteralLike", "isIdentifier", "isStringLiteralLike", "defineConfig", "configs", "defineConfig", "defineConfig", "defineConfig", "configs", "defineConfig", "defineConfig", "defineConfig", "configs", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "configs", "defineConfig", "importPluginX", "defineConfig", "ESLintUtils", "TSESTree", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "defaultOptions", "createRule", "ESLintUtils", "TSESTree", "memberName", "text", "meta", "defaultOptions", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "propertyName", "defineConfig", "defineConfig", "defineConfig"]
3
+ "sources": ["../../../../packages/lint-suite/src/lib/angular-template.ts", "../../../../packages/lint-suite/src/lib/rules/define-plugin.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/no-unstyled-classes.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/component-stylesheets.ts", "../../../../packages/lint-suite/src/lib/rules/component-metadata.ts", "../../../../packages/lint-suite/src/lib/rules/file-cache.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/linked-stylesheets.ts", "../../../../packages/lint-suite/src/lib/rules/utils/template-links.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/stylesheet-classes.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/stylesheet-imports.ts", "../../../../packages/lint-suite/src/lib/rules/selector-classes.ts", "../../../../packages/lint-suite/src/lib/rules/utils/resolved-rules.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/stylesheet-collection.ts", "../../../../packages/lint-suite/src/lib/rules/utils/to-regexp.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/template-stylesheets.ts", "../../../../packages/lint-suite/src/lib/rules/utils/template-classes.util.ts", "../../../../packages/lint-suite/src/lib/rules/utils/class-expression-literals.util.ts", "../../../../packages/lint-suite/src/lib/angular.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-imports.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-member-candidates.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-managed-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-literals.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-template-parsing.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-expression-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/utils/angular-read-target.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-class-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-class-read-visitor.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-field-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-lexical-this.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-write-targets.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-usage.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-directive-index.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-reconciliation.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-resolution.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-resolved-path.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/class-members.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/type-property-symbols.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-chains.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-references.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/read-chain-text.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-angular-interface-methods.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-symbol-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-destructuring-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-assignment-pattern-elements.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-binding-pattern-elements.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-write-targets.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-type-dependencies.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-file-entry.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-component-discovery.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-component-scope.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-decorator-kind.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-metadata-values.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/spec-file.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-staleness.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-candidate-names.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-classes.ts", "../../../../packages/lint-suite/src/lib/base.ts", "../../../../packages/lint-suite/src/lib/base-limits.ts", "../../../../packages/lint-suite/src/lib/base-practices.ts", "../../../../packages/lint-suite/src/lib/line-length.const.ts", "../../../../packages/lint-suite/src/lib/base-recommended.ts", "../../../../packages/lint-suite/src/lib/boundaries.ts", "../../../../packages/lint-suite/src/lib/javascript.ts", "../../../../packages/lint-suite/src/lib/json.ts", "../../../../packages/lint-suite/src/lib/playwright.ts", "../../../../packages/lint-suite/src/lib/prettier.ts", "../../../../packages/lint-suite/src/lib/rxjs.ts", "../../../../packages/lint-suite/src/lib/storybook.ts", "../../../../packages/lint-suite/src/lib/typescript.ts", "../../../../packages/lint-suite/src/lib/typescript-consistency.ts", "../../../../packages/lint-suite/src/lib/typescript-imports.ts", "../../../../packages/lint-suite/src/lib/typescript-overrides.ts", "../../../../packages/lint-suite/src/lib/typescript-recommended.ts", "../../../../packages/lint-suite/src/lib/typescript-safety.ts", "../../../../packages/lint-suite/src/lib/rules/arrow-body-fits-line/arrow-body-fits-line.ts", "../../../../packages/lint-suite/src/lib/rules/chain-fits-line/chain-fits-line.ts", "../../../../packages/lint-suite/src/lib/rules/chain-receiver-is-name/chain-receiver-is-name.ts", "../../../../packages/lint-suite/src/lib/rules/utils/indent-of.util.ts", "../../../../packages/lint-suite/src/lib/rules/explicit-accessibility/explicit-accessibility.ts", "../../../../packages/lint-suite/src/lib/rules/explicit-accessibility/common/explicit-accessibility.const.ts", "../../../../packages/lint-suite/src/lib/rules/max-condition-operands/max-condition-operands.ts", "../../../../packages/lint-suite/src/lib/rules/no-call-in-condition/no-call-in-condition.ts", "../../../../packages/lint-suite/src/lib/rules/no-call-in-condition/common/no-call-in-condition.const.ts", "../../../../packages/lint-suite/src/lib/rules/no-call-in-condition/utils/call-exemptions.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-call-in-condition/utils/condition-calls.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-grouped-condition/no-grouped-condition.ts", "../../../../packages/lint-suite/src/lib/rules/no-inline-object-types/no-inline-object-types.ts", "../../../../packages/lint-suite/src/lib/rules/no-inline-return-object/no-inline-return-object.ts", "../../../../packages/lint-suite/src/lib/rules/no-nested-object-value/no-nested-object-value.ts", "../../../../packages/lint-suite/src/lib/rules/utils/glob-matcher.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-nested-object-value/common/no-nested-object-value.const.ts", "../../../../packages/lint-suite/src/lib/rules/no-nested-object-value/utils/decorator-config.util.ts", "../../../../packages/lint-suite/src/lib/rules/utils/enclosing-statement.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-spread-expression/no-spread-expression.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/no-unused-exports.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/common/no-unused-exports.const.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/export-index.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/export-usage.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/aggregate-update.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/file-changes.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/module-edges.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/export-edges.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/exported-names.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/module-target.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/public-exports.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/utils/export-nodes.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-exports/report-unused-exports.ts", "../../../../packages/lint-suite/src/lib/rules/one-line-guard/one-line-guard.ts", "../../../../packages/lint-suite/src/lib/rules/readonly-type-properties/readonly-type-properties.ts", "../../../../packages/lint-suite/src/lib/rules/ternary-branch-shape/ternary-branch-shape.ts", "../../../../packages/lint-suite/src/lib/rules/test-file-shape/test-file-shape.ts", "../../../../packages/lint-suite/src/lib/rules/test-file-shape/common/test-file-shape.const.ts", "../../../../packages/lint-suite/src/lib/rules/test-file-shape/mock-exports.ts", "../../../../packages/lint-suite/src/lib/rules/test-file-shape/stub-exports.ts", "../../../../packages/lint-suite/src/lib/rules/type-placement/type-placement.ts", "../../../../packages/lint-suite/src/lib/rules/type-placement/common/type-placement.const.ts", "../../../../packages/lint-suite/src/lib/rules/util-purity/util-purity.ts", "../../../../packages/lint-suite/src/lib/rules/util-purity/common/util-purity.const.ts", "../../../../packages/lint-suite/src/lib/typescript-local-plugin.ts", "../../../../packages/lint-suite/src/lib/vitest.ts", "../../../../packages/lint-suite/src/eslint.ts"],
4
+ "sourcesContent": ["import { configs } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\n\nimport { definePlugin } from './rules/define-plugin.util.ts';\nimport noUnstyledClassesRule from './rules/no-unstyled-classes/no-unstyled-classes.ts';\n\nconst lintSuiteAngularTemplatePlugin = definePlugin(\n 'lint-suite-angular-template',\n { 'no-unstyled-classes': noUnstyledClassesRule }\n);\n\nexport const angularTemplate = defineConfig([\n {\n files: ['**/*.html'],\n extends: [...configs.templateAccessibility, ...configs.templateRecommended],\n plugins: {\n 'lint-suite-angular-template': lintSuiteAngularTemplatePlugin\n },\n rules: {\n 'max-lines': [\n 'error',\n { max: 150, skipBlankLines: true, skipComments: true }\n ],\n // A template class name no stylesheet of the component selects is\n // reported.\n // Bad: class=\"ghost\" with no .ghost rule\n // Good: add .ghost, or drop the class\n 'lint-suite-angular-template/no-unstyled-classes': 'error',\n '@angular-eslint/template/prefer-template-literal': 'error',\n '@angular-eslint/template/no-any': 'error',\n '@angular-eslint/template/no-duplicate-attributes': 'error',\n '@angular-eslint/template/button-has-type': 'error',\n '@angular-eslint/template/no-positive-tabindex': 'error',\n '@angular-eslint/template/valid-aria': 'error',\n '@angular-eslint/template/alt-text': 'error',\n '@angular-eslint/template/elements-content': 'error',\n '@angular-eslint/template/click-events-have-key-events': 'error',\n '@angular-eslint/template/mouse-events-have-key-events': 'error',\n '@angular-eslint/template/table-scope': 'error',\n '@angular-eslint/template/no-autofocus': 'error',\n '@angular-eslint/template/no-distracting-elements': 'error',\n '@angular-eslint/template/prefer-control-flow': 'error',\n '@angular-eslint/template/prefer-self-closing-tags': 'error',\n '@angular-eslint/template/prefer-ngsrc': 'error',\n '@angular-eslint/template/prefer-built-in-pipes': 'error',\n '@angular-eslint/template/no-interpolation-in-attributes': 'error',\n '@angular-eslint/template/no-nested-tags': 'error',\n '@angular-eslint/template/use-track-by-function': 'error',\n '@angular-eslint/template/label-has-associated-control': 'error',\n '@angular-eslint/template/prefer-at-else': 'error', // v21: @if/@else syntax\n '@angular-eslint/template/prefer-at-empty': 'error', // v21: @for/@empty syntax\n '@angular-eslint/template/prefer-contextual-for-variables': 'error', // v21: Use $index, $first, etc.\n '@angular-eslint/template/no-empty-control-flow': 'error', // v21: Catch incomplete refactoring\n '@angular-eslint/template/prefer-class-binding': 'error', // v21.2.0: Prefer [class] over ngClass\n '@angular-eslint/template/prefer-static-string-properties': 'error', // Reduce change detection\n '@angular-eslint/template/no-non-null-assertion': 'error', // Forbid `!` assertions in templates\n '@angular-eslint/template/no-inline-styles': 'error', // Forbid inline style=\"...\" attributes\n '@angular-eslint/template/conditional-complexity': [\n 'warn',\n { maxComplexity: 5 }\n ], // Template readability\n '@angular-eslint/template/attributes-order': [\n 'error',\n {\n alphabetical: true,\n order: [\n 'STRUCTURAL_DIRECTIVE', // e.g. `*ngIf=\"true\"`, `*ngFor=\"let item of items\"`\n 'TEMPLATE_REFERENCE', // e.g. `<input #inputRef>`\n 'INPUT_BINDING', // e.g. `[id]=\"3\"`, `[attr.colspan]=\"colspan\"`, [style.width.%]=\"100\", [@triggerName]=\"expression\", `bind-id=\"handleChange()\"`\n 'TWO_WAY_BINDING', // e.g. `[(id)]=\"id\"`, `bindon-id=\"id\"\n 'ATTRIBUTE_BINDING', // e.g. `<input required>`, `id=\"3\"`\n 'OUTPUT_BINDING' // e.g. `(idChange)=\"handleChange()\"`, `on-id=\"handleChange()\"`\n ]\n }\n ]\n }\n }\n]);\n", "import type { TSESLint } from '@typescript-eslint/utils';\nimport type { CompatiblePlugin } from 'typescript-eslint';\n\ntype Rules = NonNullable<TSESLint.FlatConfig.Plugin['rules']>;\n\nexport const definePlugin = (name: string, rules: Rules): CompatiblePlugin => {\n const meta = { name };\n const plugin = { meta, rules };\n\n return plugin;\n};\n", "import type { TmplAstElement } from '@angular/compiler';\n\nimport { ESLintUtils } from '@typescript-eslint/utils';\nimport type { JSONSchema, TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n MessageIds,\n RuleOptions,\n TemplateParserServices\n} from './common/no-unstyled-classes.type.ts';\nimport { templateStylesheets } from './styles/template-stylesheets.ts';\nimport { templateClasses } from '../utils/template-classes.util.ts';\nimport { toRegExp } from '../utils/to-regexp.util.ts';\n\ntype Options = [RuleOptions];\n\nconst PARSER_REQUIRED =\n \"no-unstyled-classes requires '@angular-eslint/template-parser'.\";\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow template class names that no stylesheet of the component selects'\n};\n\nconst messages: Record<MessageIds, string> = {\n unstyledClass:\n \"Class '{{name}}' is not selected by any stylesheet of this template.\"\n};\n\nconst stringItems: JSONSchema.JSONSchema4 = { type: 'string' };\n\nconst ignoreClassPatternsSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: stringItems,\n description: 'Regular expressions for class names that are never reported.'\n};\n\nconst globalStylesSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: stringItems,\n description: 'Stylesheets merged into the known classes of every template.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n ignoreClassPatterns: ignoreClassPatternsSchema,\n globalStyles: globalStylesSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = {\n ignoreClassPatterns: ['^(js|qa|mat|cdk|mdc)-'],\n globalStyles: []\n};\n\nconst defaultOptions: Options = [ruleDefaults];\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-unstyled-classes'\n);\n\nconst isTemplateServices = (\n services: object\n): services is TemplateParserServices => {\n if (!('convertNodeSourceSpanToLoc' in services)) return false;\n\n return typeof services.convertNodeSourceSpanToLoc === 'function';\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-unstyled-classes',\n meta,\n defaultOptions,\n create(context, [options]): TSESLint.RuleListener {\n const { parserServices } = context.sourceCode;\n\n if (parserServices === undefined) throw new Error(PARSER_REQUIRED);\n\n if (!isTemplateServices(parserServices)) throw new Error(PARSER_REQUIRED);\n\n const ignored = options.ignoreClassPatterns.map(toRegExp);\n const stylesheets = templateStylesheets(\n context.filename,\n context.sourceCode.text,\n context.cwd,\n options.globalStyles\n );\n const listeners: TSESLint.RuleListener = {\n Element(node: TmplAstElement): void {\n const isCustomElement = node.name.includes('-');\n\n if (isCustomElement) return;\n\n const classes = templateClasses(node);\n\n if (classes.length === 0) return;\n\n const known = stylesheets();\n\n if (known.size === 0) return;\n\n for (const { name, span } of classes) {\n const isIgnored = ignored.some((pattern) => pattern.test(name));\n\n if (isIgnored) continue;\n\n const isStyled = known.has(name);\n\n if (isStyled) continue;\n\n const loc = parserServices.convertNodeSourceSpanToLoc(span);\n const data = { name };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n loc,\n messageId: 'unstyledClass',\n data\n };\n\n context.report(report);\n }\n }\n };\n\n return listeners;\n }\n});\n", "import { existsSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\n\nimport type { ComponentDescriptor } from '../../common/class-usage.type.ts';\nimport { componentMetadata } from '../../component-metadata.ts';\nimport type { StylesheetSource } from '../common/no-unstyled-classes.type.ts';\n\nconst SIBLING_EXTENSIONS = ['.scss', '.css'];\nconst HTML_EXTENSION = /\\.html$/iu;\n\nconst matchesTemplate = (\n metadata: ComponentDescriptor,\n directory: string,\n templateFilename: string\n): boolean => {\n const { templateUrl } = metadata;\n\n if (templateUrl === null) return false;\n\n const declared = resolve(directory, templateUrl);\n const linted = resolve(templateFilename);\n\n return declared === linted;\n};\n\nconst templateMetadata = (\n componentPath: string,\n templateFilename: string\n): ComponentDescriptor | null => {\n const components = componentMetadata(componentPath);\n const directory = dirname(componentPath);\n const matches = (metadata: ComponentDescriptor): boolean => {\n return matchesTemplate(metadata, directory, templateFilename);\n };\n const matched = components.find(matches);\n\n if (matched !== undefined) return matched;\n\n const isOnly = components.length === 1;\n\n if (!isOnly) return null;\n\n const [only] = components;\n\n return only ?? null;\n};\n\nexport const stylesheetFiles = (\n paths: string[],\n directory: string\n): StylesheetSource[] => {\n const sources: StylesheetSource[] = [];\n\n for (const path of paths) {\n const resolved = resolve(directory, path);\n const isPresent = existsSync(resolved);\n\n if (!isPresent) continue;\n\n const source: StylesheetSource = { kind: 'file', path: resolved };\n\n sources.push(source);\n }\n\n return sources;\n};\n\nconst inlineSources = (\n styles: string[],\n componentPath: string\n): StylesheetSource[] => {\n const sourceOf = (style: string): StylesheetSource => {\n const source: StylesheetSource = {\n kind: 'inline',\n source: style,\n path: componentPath\n };\n\n return source;\n };\n\n return styles.map(sourceOf);\n};\n\nconst metadataSources = (\n componentPath: string,\n templateFilename: string\n): StylesheetSource[] => {\n const metadata = templateMetadata(componentPath, templateFilename);\n\n if (metadata === null) return [];\n\n const directory = dirname(componentPath);\n const files = stylesheetFiles(metadata.styleUrls, directory);\n const inline = inlineSources(metadata.styles, componentPath);\n\n return [...files, ...inline];\n};\n\nconst siblingSources = (templateFilename: string): StylesheetSource[] => {\n const base = templateFilename.replace(HTML_EXTENSION, '');\n const candidateOf = (extension: string): string => `${base}${extension}`;\n const candidates = SIBLING_EXTENSIONS.map(candidateOf);\n\n return stylesheetFiles(candidates, dirname(templateFilename));\n};\n\nexport const componentStylesheets = (\n templateFilename: string\n): StylesheetSource[] => {\n const componentPath = templateFilename.replace(HTML_EXTENSION, '.ts');\n const sources = metadataSources(componentPath, templateFilename);\n\n if (sources.length > 0) return sources;\n\n return siblingSources(templateFilename);\n};\n", "import {\n ScriptTarget,\n canHaveDecorators,\n createSourceFile,\n forEachChild,\n getDecorators,\n isArrayLiteralExpression,\n isCallExpression,\n isIdentifier,\n isObjectLiteralExpression,\n isPropertyAssignment,\n isStringLiteralLike\n} from 'typescript';\nimport type {\n Decorator,\n Expression,\n Node,\n ObjectLiteralExpression\n} from 'typescript';\n\nimport type { ComponentDescriptor } from './common/class-usage.type.ts';\nimport { createFileCache, readCached } from './file-cache.ts';\n\nconst COMPONENT_MARKER = '@Component';\n\nconst cache = createFileCache<ComponentDescriptor[]>('component-metadata');\n\nconst componentArgument = (\n decorator: Decorator\n): ObjectLiteralExpression | null => {\n const { expression } = decorator;\n\n if (!isCallExpression(expression)) return null;\n\n if (!isIdentifier(expression.expression)) return null;\n\n const isComponent = expression.expression.text === 'Component';\n\n if (!isComponent) return null;\n\n const [argument] = expression.arguments;\n\n if (argument === undefined) return null;\n\n if (!isObjectLiteralExpression(argument)) return null;\n\n return argument;\n};\n\nconst decoratedMetadata = (node: Node): ObjectLiteralExpression | null => {\n if (!canHaveDecorators(node)) return null;\n\n const decorators = getDecorators(node) ?? [];\n\n for (const decorator of decorators) {\n const metadata = componentArgument(decorator);\n\n if (metadata !== null) return metadata;\n }\n\n return null;\n};\n\nconst literalText = (node: Expression): string | null => {\n if (!isStringLiteralLike(node)) return null;\n\n return node.text;\n};\n\nconst literalTexts = (node: Expression): string[] => {\n const single = literalText(node);\n\n if (single !== null) return [single];\n\n if (!isArrayLiteralExpression(node)) return [];\n\n const texts: string[] = [];\n\n for (const element of node.elements) {\n const text = literalText(element);\n\n if (text !== null) texts.push(text);\n }\n\n return texts;\n};\n\nconst metadataValue = (\n metadata: ObjectLiteralExpression,\n name: string\n): Expression | null => {\n for (const property of metadata.properties) {\n if (!isPropertyAssignment(property)) continue;\n\n if (!isIdentifier(property.name)) continue;\n\n const isMatch = property.name.text === name;\n\n if (isMatch) return property.initializer;\n }\n\n return null;\n};\n\nconst metadataTexts = (\n metadata: ObjectLiteralExpression,\n name: string\n): string[] => {\n const value = metadataValue(metadata, name);\n\n if (value === null) return [];\n\n return literalTexts(value);\n};\n\nconst toDescriptor = (\n metadata: ObjectLiteralExpression\n): ComponentDescriptor => {\n const [templateUrl] = metadataTexts(metadata, 'templateUrl');\n const [template] = metadataTexts(metadata, 'template');\n const styleUrl = metadataTexts(metadata, 'styleUrl');\n const listedStyleUrls = metadataTexts(metadata, 'styleUrls');\n const styleUrls = [...styleUrl, ...listedStyleUrls];\n const styles = metadataTexts(metadata, 'styles');\n const descriptor: ComponentDescriptor = {\n templateUrl: templateUrl ?? null,\n template: template ?? null,\n styleUrls,\n styles\n };\n\n return descriptor;\n};\n\nconst parseComponentMetadata = (\n text: string,\n path: string\n): ComponentDescriptor[] => {\n const found: ComponentDescriptor[] = [];\n const hasComponent = text.includes(COMPONENT_MARKER);\n\n if (!hasComponent) return found;\n\n const visit = (node: Node): void => {\n const metadata = decoratedMetadata(node);\n\n if (metadata !== null) found.push(toDescriptor(metadata));\n\n forEachChild(node, visit);\n };\n\n const source = createSourceFile(path, text, ScriptTarget.Latest, true);\n\n forEachChild(source, visit);\n\n return found;\n};\n\nexport const componentMetadata = (path: string): ComponentDescriptor[] => {\n return readCached(cache, path, parseComponentMetadata) ?? [];\n};\n", "import {\n mkdirSync,\n readFileSync,\n renameSync,\n statSync,\n writeFileSync\n} from 'node:fs';\nimport { dirname, join } from 'node:path';\n\nimport type { CachedFile, FileCache } from './common/file-cache.type.ts';\n\ntype FileParser<T> = (text: string, path: string) => T;\n\nconst CACHE_FORMAT_VERSION = 1;\n\nconst caches = new Set<FileCache<unknown>>();\n\nlet isFlushRegistered = false;\n\nconst cacheDirectory = (): string | null => {\n const { LINT_SUITE_CACHE, LINT_SUITE_CACHE_DIR } = process.env;\n const isDisabled = LINT_SUITE_CACHE === '0';\n\n if (isDisabled) return null;\n\n if (LINT_SUITE_CACHE_DIR) return LINT_SUITE_CACHE_DIR;\n\n return join(process.cwd(), 'node_modules', '.cache', 'lint-suite');\n};\n\nconst cacheFile = (name: string): string | null => {\n const directory = cacheDirectory();\n\n if (directory === null) return null;\n\n return join(directory, `${name}.v${CACHE_FORMAT_VERSION}.json`);\n};\n\nconst isCachedFile = <T>(value: unknown): value is CachedFile<T> => {\n const isObject = typeof value === 'object' && value !== null;\n\n if (!isObject) return false;\n\n const hasVersion = 'version' in value && typeof value.version === 'string';\n\n return hasVersion && 'value' in value;\n};\n\nconst storedEntries = <T>(text: string): Map<string, CachedFile<T>> => {\n const entries = new Map<string, CachedFile<T>>();\n const parsed: unknown = JSON.parse(text);\n const isRecord = typeof parsed === 'object' && parsed !== null;\n\n if (!isRecord) return entries;\n\n for (const [path, entry] of Object.entries(parsed)) {\n if (isCachedFile<T>(entry)) entries.set(path, entry);\n }\n\n return entries;\n};\n\nconst load = <T>(cache: FileCache<T>): void => {\n cache.loaded = true;\n\n const file = cacheFile(cache.name);\n\n if (file === null) return;\n\n try {\n const stored = storedEntries<T>(readFileSync(file, 'utf8'));\n\n for (const [path, entry] of stored) cache.entries.set(path, entry);\n } catch {\n return;\n }\n};\n\nconst write = (cache: FileCache<unknown>): void => {\n const file = cacheFile(cache.name);\n\n if (file === null) return;\n\n try {\n mkdirSync(dirname(file), { recursive: true });\n\n const temporary = `${file}.${process.pid}.tmp`;\n const stored = Object.fromEntries(cache.entries);\n\n writeFileSync(temporary, JSON.stringify(stored));\n renameSync(temporary, file);\n } catch {\n return;\n }\n};\n\n/** Writes every cache that parsed something this run; runs at process exit. */\n// eslint-disable-next-line local/no-unused-exports -- read by file-cache.spec.ts\nexport const flushFileCaches = (): void => {\n for (const cache of caches) {\n if (!cache.dirty) continue;\n\n write(cache);\n cache.dirty = false;\n }\n};\n\nconst registerFlush = (): void => {\n if (isFlushRegistered) return;\n\n isFlushRegistered = true;\n process.once('exit', flushFileCaches);\n};\n\n/**\n * A cache of parsed files keyed by path and mtime, mirrored to\n * `node_modules/.cache/lint-suite/<name>.v<format>.json` (or\n * `LINT_SUITE_CACHE_DIR`; `LINT_SUITE_CACHE=0` disables the disk copy).\n * Values must survive JSON.\n */\nexport const createFileCache = <T>(name: string): FileCache<T> => {\n const cache: FileCache<T> = {\n name,\n entries: new Map(),\n loaded: false,\n dirty: false\n };\n\n caches.add(cache);\n registerFlush();\n\n return cache;\n};\n\nexport const readCached = <T>(\n cache: FileCache<T>,\n path: string,\n parse: FileParser<T>\n): T | null => {\n if (!cache.loaded) load(cache);\n\n try {\n const stats = statSync(path, { bigint: true });\n const version = `${stats.mtimeNs}:${stats.size}`;\n const cached = cache.entries.get(path);\n\n if (cached?.version === version) return cached.value;\n\n const value = parse(readFileSync(path, 'utf8'), path);\n const fresh: CachedFile<T> = { value, version };\n\n cache.entries.set(path, fresh);\n cache.dirty = true;\n\n return value;\n } catch {\n return null;\n }\n};\n", "import { dirname } from 'node:path';\n\nimport { stylesheetFiles } from './component-stylesheets.ts';\nimport { linkedStylesheetHrefs } from '../../utils/template-links.util.ts';\nimport type { StylesheetSource } from '../common/no-unstyled-classes.type.ts';\n\nexport const linkedStylesheets = (\n template: string,\n templateFilename: string\n): StylesheetSource[] => {\n const hrefs = linkedStylesheetHrefs(template);\n\n return stylesheetFiles(hrefs, dirname(templateFilename));\n};\n", "const LINK_TAG = /<link\\b[^>]*>/giu;\nconst STYLESHEET_REL = /\\brel\\s*=\\s*[\"']stylesheet[\"']/iu;\nconst HREF = /\\bhref\\s*=\\s*[\"']([^\"']*)[\"']/iu;\nconst UNRESOLVABLE = /^(?:\\/|[^:/?#]+:)/u;\n\nconst hrefOf = (tag: string): string | null => {\n const isStylesheet = STYLESHEET_REL.test(tag);\n\n if (!isStylesheet) return null;\n\n const href = HREF.exec(tag)?.[1] ?? '';\n const isUnresolvable = UNRESOLVABLE.test(href);\n const isLocal = href.length > 0 && !isUnresolvable;\n\n return isLocal ? href : null;\n};\n\nexport const linkedStylesheetHrefs = (template: string): string[] => {\n const tags = template.match(LINK_TAG) ?? [];\n\n return tags.map(hrefOf).filter((href) => href !== null);\n};\n", "import { dirname } from 'node:path';\n\nimport { parse } from 'postcss-scss';\n\nimport { collectStylesheet } from './stylesheet-collection.ts';\nimport { createFileCache, readCached } from '../../file-cache.ts';\nimport { classMatcher } from '../../selector-classes.ts';\nimport { toRegExp } from '../../utils/to-regexp.util.ts';\nimport type {\n StylesheetClasses,\n StylesheetEntry,\n StylesheetSource\n} from '../common/no-unstyled-classes.type.ts';\n\ntype MergedChain = {\n readonly chain: StylesheetEntry[];\n readonly classes: StylesheetClasses;\n};\n\nconst EMPTY_ENTRY: StylesheetEntry = { classes: [], patterns: [], imports: [] };\n\nconst stylesheets = createFileCache<StylesheetEntry>('stylesheets');\nconst inlineStylesheets = new Map<string, StylesheetEntry>();\nconst merged = new Map<string, MergedChain>();\n\nconst parseStylesheet = (source: string, path: string): StylesheetEntry => {\n try {\n const root = parse(source, { from: path });\n\n return collectStylesheet(root, dirname(path));\n } catch {\n return EMPTY_ENTRY;\n }\n};\n\nconst fileEntry = (path: string): StylesheetEntry => {\n return readCached(stylesheets, path, parseStylesheet) ?? EMPTY_ENTRY;\n};\n\nconst inlineEntry = (source: string, path: string): StylesheetEntry => {\n const key = `${path}\\0${source}`;\n const cached = inlineStylesheets.get(key);\n\n if (cached !== undefined) return cached;\n\n const entry = parseStylesheet(source, path);\n\n inlineStylesheets.set(key, entry);\n\n return entry;\n};\n\nconst collectImports = (\n entry: StylesheetEntry,\n chain: StylesheetEntry[],\n visited: Set<string>\n): void => {\n for (const imported of entry.imports) {\n const isVisited = visited.has(imported);\n\n if (isVisited) continue;\n\n visited.add(imported);\n\n const importedEntry = fileEntry(imported);\n\n chain.push(importedEntry);\n collectImports(importedEntry, chain, visited);\n }\n};\n\nconst entryOf = (source: StylesheetSource): StylesheetEntry => {\n if (source.kind === 'file') return fileEntry(source.path);\n\n return inlineEntry(source.source, source.path);\n};\n\nconst collectChain = (\n source: StylesheetSource,\n chain: StylesheetEntry[],\n visited: Set<string>\n): void => {\n if (source.kind === 'file') {\n const isVisited = visited.has(source.path);\n\n if (isVisited) return;\n\n visited.add(source.path);\n }\n\n const entry = entryOf(source);\n\n chain.push(entry);\n collectImports(entry, chain, visited);\n};\n\nconst mergeChain = (chain: StylesheetEntry[]): StylesheetClasses => {\n const exact = new Set<string>();\n const patterns: string[] = [];\n\n for (const entry of chain) {\n for (const name of entry.classes) exact.add(name);\n\n patterns.push(...entry.patterns);\n }\n\n const compiled = patterns.map(toRegExp);\n const has = classMatcher(exact, compiled);\n const size = exact.size + compiled.length;\n const classes: StylesheetClasses = { has, size };\n\n return classes;\n};\n\nconst isCurrentChain = (\n cached: MergedChain | undefined,\n chain: StylesheetEntry[]\n): cached is MergedChain => {\n if (cached === undefined) return false;\n\n if (cached.chain.length !== chain.length) return false;\n\n return cached.chain.every((entry, position) => entry === chain[position]);\n};\n\nconst sourceKey = (source: StylesheetSource): string => {\n if (source.kind === 'file') return source.path;\n\n return `${source.path}\\0${source.source}`;\n};\n\nconst keyOf = (sources: StylesheetSource[]): string => {\n return sources.map(sourceKey).join('\\n');\n};\n\nexport const stylesheetClasses = (\n sources: StylesheetSource[]\n): StylesheetClasses => {\n const chain: StylesheetEntry[] = [];\n const visited = new Set<string>();\n\n for (const source of sources) collectChain(source, chain, visited);\n\n const key = keyOf(sources);\n const cached = merged.get(key);\n\n if (isCurrentChain(cached, chain)) return cached.classes;\n\n const classes = mergeChain(chain);\n const fresh: MergedChain = { chain, classes };\n\n merged.set(key, fresh);\n\n return classes;\n};\n", "import { existsSync } from 'node:fs';\nimport { basename, dirname, join, resolve } from 'node:path';\n\nconst QUOTED = /'([^']*)'|\"([^\"]*)\"/u;\nconst SKIPPED_PREFIXES = ['sass:', 'http', 'url('];\n\nconst specifierOf = (params: string): string | null => {\n const match = QUOTED.exec(params);\n\n if (!match) return null;\n\n return match[1] ?? match[2] ?? null;\n};\n\nconst isResolvable = (specifier: string): boolean => {\n const isEmpty = specifier.length === 0;\n\n if (isEmpty) return false;\n\n const isSkipped = SKIPPED_PREFIXES.some((prefix) =>\n specifier.startsWith(prefix)\n );\n\n if (isSkipped) return false;\n\n return !specifier.endsWith('.css');\n};\n\nconst candidatesOf = (path: string): string[] => {\n const isStylesheet = path.endsWith('.scss');\n\n if (isStylesheet) return [path, join(dirname(path), `_${basename(path)}`)];\n\n const partial = join(dirname(path), `_${basename(path)}.scss`);\n\n return [\n `${path}.scss`,\n partial,\n join(path, 'index.scss'),\n join(path, '_index.scss')\n ];\n};\n\nexport const resolveStylesheetImport = (\n params: string,\n directory: string\n): string | null => {\n const specifier = specifierOf(params);\n\n if (specifier === null) return null;\n\n const isCandidate = isResolvable(specifier);\n\n if (!isCandidate) return null;\n\n const path = resolve(directory, specifier);\n const candidates = candidatesOf(path);\n const existing = candidates.find((candidate) => existsSync(candidate));\n\n return existing ?? null;\n};\n", "import selectorParser from 'postcss-selector-parser';\nimport type { Node } from 'postcss-selector-parser';\n\nimport type { ClassMatcher, SelectorClasses } from './common/class-usage.type.ts';\n\ntype SelectorClassNode = { readonly value: string };\n\nconst INTERPOLATION_TOKEN = 'zzinterpzz';\nconst PARENT_TOKEN = 'zzparentzz';\nconst UNKNOWN_PARENT_SELECTOR = `.${PARENT_TOKEN}`;\nconst UNKNOWN_PARTS = new RegExp(\n `${INTERPOLATION_TOKEN}|${PARENT_TOKEN}`,\n 'gu'\n);\nconst INTERPOLATION = /#\\{[^}]*\\}/gu;\nconst DEEP_COMBINATORS = new Set(['/deep/', '>>>']);\nconst HOST_PSEUDOS = new Set([':host', ':host-context']);\nconst NG_DEEP_PSEUDO = '::ng-deep';\nconst REGEXP_META = /[.*+?^${}()|[\\]\\\\]/gu;\n\nconst escapeRegExp = (part: string): string => {\n return part.replaceAll(REGEXP_META, '\\\\$&');\n};\n\nexport const classNamePattern = (value: string): string => {\n const literals = value.split(UNKNOWN_PARTS).map(escapeRegExp);\n const joined = literals.join('.*');\n\n return `^${joined}$`;\n};\n\nconst withoutParent = (selector: string): string => {\n return selector.replaceAll('&', UNKNOWN_PARENT_SELECTOR);\n};\n\nconst withParent = (selector: string, parent: string): string => {\n const hasNesting = selector.includes('&');\n\n if (hasNesting) return selector.replaceAll('&', parent);\n\n return `${parent} ${selector}`;\n};\n\nexport const resolveSelectors = (\n selectors: string[],\n parents: string[]\n): string[] => {\n const hasParents = parents.length > 0;\n\n if (!hasParents) return selectors.map(withoutParent);\n\n const resolved: string[] = [];\n\n for (const parent of parents) {\n for (const selector of selectors) {\n resolved.push(withParent(selector, parent));\n }\n }\n\n return resolved;\n};\n\nexport const selectorClasses = (selector: string): SelectorClasses => {\n const exact: string[] = [];\n const patterns: string[] = [];\n const normalized = selector.replaceAll(INTERPOLATION, INTERPOLATION_TOKEN);\n\n const collect = (node: SelectorClassNode): void => {\n const isBareParent = node.value === PARENT_TOKEN;\n\n if (isBareParent) return;\n\n const hasInterpolation = node.value.includes(INTERPOLATION_TOKEN);\n const hasUnknownParent = node.value.includes(PARENT_TOKEN);\n const isDynamic = hasInterpolation || hasUnknownParent;\n\n if (isDynamic) {\n patterns.push(classNamePattern(node.value));\n\n return;\n }\n\n exact.push(node.value);\n };\n\n try {\n const root = selectorParser().astSync(normalized);\n\n root.walkClasses(collect);\n } catch {\n const empty: SelectorClasses = { exact: [], patterns: [] };\n\n return empty;\n }\n\n const classes: SelectorClasses = { exact, patterns };\n\n return classes;\n};\n\nconst isBoundaryNode = (node: Node): boolean => {\n if (node.type === 'combinator') return DEEP_COMBINATORS.has(node.value);\n\n if (node.type !== 'pseudo') return false;\n\n return node.value === NG_DEEP_PSEUDO;\n};\n\nconst addTemplateClass = (value: string, names: string[]): void => {\n const hasInterpolation = value.includes(INTERPOLATION_TOKEN);\n const hasUnknownParent = value.includes(PARENT_TOKEN);\n const isDynamic = hasInterpolation || hasUnknownParent;\n\n if (isDynamic) return;\n\n names.push(value);\n};\n\nconst collectTemplateClasses = (nodes: Node[], names: string[]): boolean => {\n for (const node of nodes) {\n const isBoundary = isBoundaryNode(node);\n\n if (isBoundary) return true;\n\n if (node.type === 'class') {\n addTemplateClass(node.value, names);\n continue;\n }\n\n if (node.type !== 'pseudo') continue;\n\n const isHost = HOST_PSEUDOS.has(node.value);\n\n if (isHost) continue;\n\n for (const argument of node.nodes) {\n const isStopped = collectTemplateClasses(argument.nodes, names);\n\n if (isStopped) return true;\n }\n }\n\n return false;\n};\n\nexport const selectorTemplateClasses = (selector: string): string[] => {\n const names: string[] = [];\n const normalized = selector.replaceAll(INTERPOLATION, INTERPOLATION_TOKEN);\n\n try {\n const root = selectorParser().astSync(normalized);\n\n for (const each of root.nodes) collectTemplateClasses(each.nodes, names);\n } catch {\n return [];\n }\n\n const uniqueNames = new Set(names);\n\n return [...uniqueNames];\n};\n\nexport const classMatcher = (\n exact: Set<string>,\n patterns: RegExp[]\n): ClassMatcher => {\n const matches = (name: string): boolean => {\n const isExact = exact.has(name);\n\n if (isExact) return true;\n\n return patterns.some((pattern) => pattern.test(name));\n };\n\n return matches;\n};\n", "import type { ChildNode, Container, Root, Rule } from 'postcss';\n\nimport { resolveSelectors } from '../selector-classes.ts';\n\ntype ResolvedRuleVisitor = (\n rule: Rule,\n resolved: string[],\n parents: string[]\n) => void;\n\nconst walkContainer = (\n container: Container<ChildNode>,\n parents: string[],\n visit: ResolvedRuleVisitor\n): void => {\n for (const node of container.nodes ?? []) {\n if (node.type === 'rule') {\n const resolved = resolveSelectors(node.selectors, parents);\n\n visit(node, resolved, parents);\n walkContainer(node, resolved, visit);\n continue;\n }\n\n if (node.type !== 'atrule') continue;\n\n walkContainer(node, parents, visit);\n }\n};\n\nexport const walkResolvedRules = (\n root: Root,\n visit: ResolvedRuleVisitor\n): void => {\n walkContainer(root, [], visit);\n};\n", "import type { AtRule, Root, Rule } from 'postcss';\n\nimport { resolveStylesheetImport } from './stylesheet-imports.ts';\nimport { selectorClasses } from '../../selector-classes.ts';\nimport { walkResolvedRules } from '../../utils/resolved-rules.util.ts';\nimport type { StylesheetEntry } from '../common/no-unstyled-classes.type.ts';\n\nconst IMPORT_AT_RULES = new Set(['use', 'import', 'forward']);\n\nconst addSelectors = (selectors: string[], entry: StylesheetEntry): void => {\n for (const selector of selectors) {\n const { exact, patterns } = selectorClasses(selector);\n\n entry.classes.push(...exact);\n entry.patterns.push(...patterns);\n }\n};\n\nconst addImport = (\n node: AtRule,\n entry: StylesheetEntry,\n directory: string\n): void => {\n const isImport = IMPORT_AT_RULES.has(node.name);\n\n if (!isImport) return;\n\n const imported = resolveStylesheetImport(node.params, directory);\n\n if (imported !== null) entry.imports.push(imported);\n};\n\nexport const collectStylesheet = (\n root: Root,\n directory: string\n): StylesheetEntry => {\n const entry: StylesheetEntry = { classes: [], patterns: [], imports: [] };\n const onRule = (_rule: Rule, resolved: string[]): void => {\n addSelectors(resolved, entry);\n };\n const onAtRule = (node: AtRule): void => {\n addImport(node, entry, directory);\n };\n\n walkResolvedRules(root, onRule);\n root.walkAtRules(onAtRule);\n\n return entry;\n};\n", "export const toRegExp = (pattern: string): RegExp => new RegExp(pattern, 'u');\n", "import {\n componentStylesheets,\n stylesheetFiles\n} from './component-stylesheets.ts';\nimport { linkedStylesheets } from './linked-stylesheets.ts';\nimport { stylesheetClasses } from './stylesheet-classes.ts';\nimport type {\n StylesheetClasses,\n StylesheetLookup,\n StylesheetSource\n} from '../common/no-unstyled-classes.type.ts';\n\nexport const templateStylesheets = (\n templateFilename: string,\n template: string,\n cwd: string,\n globalStyles: string[]\n): StylesheetLookup => {\n let known: StylesheetClasses | null = null;\n\n const lookup = (): StylesheetClasses => {\n if (known !== null) return known;\n\n const component = componentStylesheets(templateFilename);\n const linked = linkedStylesheets(template, templateFilename);\n const global = stylesheetFiles(globalStyles, cwd);\n const sources: StylesheetSource[] = [...component, ...linked, ...global];\n\n known = stylesheetClasses(sources);\n\n return known;\n };\n\n return lookup;\n};\n", "import { ParseSourceSpan } from '@angular/compiler';\nimport type {\n TmplAstBoundAttribute,\n TmplAstTextAttribute\n} from '@angular/compiler';\n\nimport { classExpressionLiterals } from './class-expression-literals.util.ts';\nimport type {\n ClassAttributeHost,\n TemplateClass\n} from '../common/class-usage.type.ts';\n\nconst CLASS_ATTRIBUTE = 'class';\nconst CLASS_BINDING_PREFIX = 'class.';\nconst TOKEN = /\\S+/gu;\n\nconst expressionSource = (value: object): string | null => {\n if (!('source' in value)) return null;\n\n const { source } = value;\n\n if (typeof source !== 'string') return null;\n\n return source;\n};\n\nconst staticClasses = (attribute: TmplAstTextAttribute): TemplateClass[] => {\n const classes: TemplateClass[] = [];\n const valueSpan = attribute.valueSpan ?? attribute.sourceSpan;\n\n for (const token of attribute.value.matchAll(TOKEN)) {\n const start = valueSpan.start.moveBy(token.index);\n const end = valueSpan.start.moveBy(token.index + token[0].length);\n const span = new ParseSourceSpan(start, end);\n const templateClass: TemplateClass = { name: token[0], span };\n\n classes.push(templateClass);\n }\n\n return classes;\n};\n\nconst boundClassName = (input: TmplAstBoundAttribute): string | null => {\n const { details } = input.keySpan;\n\n if (details === null) return null;\n\n const isClassBinding = details.startsWith(CLASS_BINDING_PREFIX);\n\n if (!isClassBinding) return null;\n\n return input.name;\n};\n\nconst isClassExpression = (input: TmplAstBoundAttribute): boolean => {\n const isClassName = input.name === CLASS_ATTRIBUTE;\n\n if (!isClassName) return false;\n\n const { details } = input.keySpan;\n\n if (details === null) return true;\n\n return details === CLASS_ATTRIBUTE;\n};\n\nconst expressionClasses = (input: TmplAstBoundAttribute): TemplateClass[] => {\n const source = expressionSource(input.value);\n\n if (source === null) return [];\n\n const names = classExpressionLiterals(source);\n const templateClassOf = (name: string): TemplateClass => {\n const templateClass: TemplateClass = { name, span: input.sourceSpan };\n\n return templateClass;\n };\n\n return names.map(templateClassOf);\n};\n\nconst inputClasses = (input: TmplAstBoundAttribute): TemplateClass[] => {\n const bound = boundClassName(input);\n\n if (bound !== null) {\n const templateClass: TemplateClass = { name: bound, span: input.keySpan };\n\n return [templateClass];\n }\n\n const isExpression = isClassExpression(input);\n\n if (!isExpression) return [];\n\n return expressionClasses(input);\n};\n\nexport const templateClasses = (node: ClassAttributeHost): TemplateClass[] => {\n const classes: TemplateClass[] = [];\n\n for (const attribute of node.attributes) {\n const isClassName = attribute.name === CLASS_ATTRIBUTE;\n\n if (isClassName) {\n const found = staticClasses(attribute);\n\n classes.push(...found);\n }\n }\n\n for (const input of node.inputs) {\n const found = inputClasses(input);\n\n classes.push(...found);\n }\n\n return classes;\n};\n", "import {\n Conditional,\n Interpolation,\n Lexer,\n LiteralArray,\n LiteralMap,\n LiteralPrimitive,\n ParseLocation,\n ParseSourceFile,\n ParseSourceSpan,\n Parser\n} from '@angular/compiler';\nimport type { AST, ASTWithSource, LiteralMapKey } from '@angular/compiler';\n\nimport type { ClassExpressionUsage } from '../common/class-usage.type.ts';\nimport { classNamePattern } from '../selector-classes.ts';\n\nconst WHITESPACE = /\\s+/u;\nconst EXPRESSION_FILE = 'class-expression';\nconst INTERPOLATION_TOKEN = 'zzinterpzz';\n\nconst parser = new Parser(new Lexer());\n\nconst spanOf = (source: string): ParseSourceSpan => {\n const file = new ParseSourceFile(source, EXPRESSION_FILE);\n const start = new ParseLocation(file, 0, 0, 0);\n const span = new ParseSourceSpan(start, start.moveBy(source.length));\n\n return span;\n};\n\nconst astOf = (parsed: ASTWithSource): AST | null => {\n const hasErrors = parsed.errors.length > 0;\n\n if (hasErrors) return null;\n\n return parsed.ast;\n};\n\nconst parseClassExpression = (source: string): AST | null => {\n try {\n const span = spanOf(source);\n const interpolation = parser.parseInterpolation(source, span, 0, null);\n\n if (interpolation) return astOf(interpolation);\n\n const binding = parser.parseBinding(source, span, 0);\n\n return astOf(binding);\n } catch {\n return null;\n }\n};\n\nconst addNames = (value: string, names: string[]): void => {\n for (const token of value.split(WHITESPACE)) {\n if (token) names.push(token);\n }\n};\n\nconst addPrimitive = (ast: LiteralPrimitive, names: string[]): void => {\n if (typeof ast.value === 'string') addNames(ast.value, names);\n};\n\nconst addMapKeys = (ast: LiteralMap, names: string[]): void => {\n for (const key of ast.keys) {\n if (key.kind !== 'spread') addNames(key.key, names);\n }\n};\n\nconst addInterpolation = (ast: Interpolation, names: string[]): void => {\n for (const text of ast.strings) addNames(text, names);\n};\n\nconst collect = (ast: AST, names: string[]): void => {\n if (ast instanceof LiteralPrimitive) {\n addPrimitive(ast, names);\n\n return;\n }\n\n if (ast instanceof LiteralMap) {\n addMapKeys(ast, names);\n\n return;\n }\n\n if (ast instanceof Interpolation) {\n addInterpolation(ast, names);\n\n return;\n }\n\n if (ast instanceof LiteralArray) {\n for (const expression of ast.expressions) collect(expression, names);\n\n return;\n }\n\n if (ast instanceof Conditional) {\n collect(ast.trueExp, names);\n collect(ast.falseExp, names);\n }\n};\n\nexport const classExpressionLiterals = (source: string): string[] => {\n const ast = parseClassExpression(source);\n\n if (ast === null) return [];\n\n const names: string[] = [];\n\n collect(ast, names);\n\n const uniqueNames = new Set(names);\n\n return [...uniqueNames];\n};\n\nconst isSpreadKey = (key: LiteralMapKey): boolean => key.kind === 'spread';\n\nconst isDynamicAst = (ast: AST): boolean => {\n if (ast instanceof LiteralPrimitive) return false;\n\n if (ast instanceof LiteralMap) return ast.keys.some(isSpreadKey);\n\n if (ast instanceof LiteralArray) return ast.expressions.some(isDynamicAst);\n\n if (ast instanceof Conditional) {\n const isTrueDynamic = isDynamicAst(ast.trueExp);\n const isFalseDynamic = isDynamicAst(ast.falseExp);\n\n return isTrueDynamic || isFalseDynamic;\n }\n\n return true;\n};\n\nconst isNamedToken = (token: string): boolean => token !== INTERPOLATION_TOKEN;\n\nconst isPatternToken = (token: string): boolean => {\n return token.includes(INTERPOLATION_TOKEN);\n};\n\nconst isPlainToken = (token: string): boolean => !isPatternToken(token);\n\nconst interpolationUsage = (ast: Interpolation): ClassExpressionUsage => {\n const joined = ast.strings.join(INTERPOLATION_TOKEN);\n const tokens = joined.split(WHITESPACE).filter(Boolean);\n const named = tokens.filter(isNamedToken);\n const patterns = named.filter(isPatternToken).map(classNamePattern);\n const names = named.filter(isPlainToken);\n const uniqueNames = new Set(names);\n const uniquePatterns = new Set(patterns);\n const usage: ClassExpressionUsage = {\n names: [...uniqueNames],\n patterns: [...uniquePatterns],\n isDynamic: named.length < tokens.length\n };\n\n return usage;\n};\n\nconst UNKNOWN_USAGE: ClassExpressionUsage = {\n names: [],\n patterns: [],\n isDynamic: true\n};\n\nexport const classExpressionUsage = (source: string): ClassExpressionUsage => {\n const ast = parseClassExpression(source);\n\n if (ast === null) return UNKNOWN_USAGE;\n\n if (ast instanceof Interpolation) return interpolationUsage(ast);\n\n const names: string[] = [];\n\n collect(ast, names);\n\n const isDynamic = isDynamicAst(ast);\n const uniqueNames = new Set(names);\n const usage: ClassExpressionUsage = {\n names: [...uniqueNames],\n patterns: [],\n isDynamic\n };\n\n return usage;\n};\n", "import { configs, processInlineTemplates } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\nimport globals from 'globals';\n\nimport { definePlugin } from './rules/define-plugin.util.ts';\nimport noUnusedInstanceFieldsRule from './rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.ts';\n\nconst lintSuiteAngularPlugin = definePlugin('lint-suite-angular', {\n 'no-unused-instance-fields': noUnusedInstanceFieldsRule\n});\n\nconst inlineTemplates = processInlineTemplates && {\n processor: processInlineTemplates\n};\n\nexport const angular = defineConfig([\n {\n files: ['**/*.ts'],\n extends: [...configs.tsRecommended],\n plugins: {\n 'lint-suite-angular': lintSuiteAngularPlugin\n },\n languageOptions: {\n globals: {\n ...globals.browser,\n ...globals.es2025,\n ...globals.node\n },\n parserOptions: {\n projectService: true\n }\n },\n ...inlineTemplates,\n rules: {\n // Component and directive members nothing reads (class, template, host)\n // are dead.\n // Bad: private unused = 1; read nowhere\n // Good: delete it, or read it in the template\n 'lint-suite-angular/no-unused-instance-fields': [\n 'error',\n { analysis: 'project' }\n ],\n '@angular-eslint/prefer-on-push-component-change-detection': 'error', // v22: flags only explicit opt-out of OnPush (omission now means OnPush)\n '@angular-eslint/prefer-signals': 'error',\n '@angular-eslint/use-injectable-provided-in': 'error',\n '@angular-eslint/prefer-signal-model': 'error',\n '@angular-eslint/no-uncalled-signals': 'error',\n '@angular-eslint/prefer-host-metadata-property': 'error',\n '@angular-eslint/no-implicit-take-until-destroyed': 'error', // v21.2.0: Enforce explicit DestroyRef\n '@angular-eslint/no-async-lifecycle-method': 'error', // Prevent async lifecycle hooks\n '@angular-eslint/prefer-output-readonly': 'warn', // Prevent accidental reassignment\n '@angular-eslint/prefer-output-emitter-ref': 'warn', // Modern output() function over @Output()\n '@angular-eslint/sort-lifecycle-methods': 'warn', // Consistent lifecycle method ordering\n '@angular-eslint/computed-must-return': 'error', // Catch silent computed() bugs missing a return\n '@angular-eslint/no-duplicates-in-metadata-arrays': 'error', // Catch duplicate imports/providers in @Component/@NgModule\n '@angular-eslint/no-lifecycle-call': 'error', // Forbid manual this.ngOnInit() calls\n '@angular-eslint/require-lifecycle-on-prototype': 'error', // Lifecycle hooks must be methods, not arrow-fn fields\n '@angular-eslint/relative-url-prefix': 'error', // Require ./ in templateUrl/styleUrl for portability\n '@angular-eslint/use-component-selector': 'error', // All components must declare a selector\n '@angular-eslint/no-developer-preview': 'warn', // Flag APIs marked @developerPreview (no breaking-change policy)\n '@angular-eslint/no-experimental': 'warn' // Flag APIs marked @experimental\n }\n }\n]);\n", "import { ESLintUtils } from '@typescript-eslint/utils';\nimport type {\n JSONSchema,\n ParserServicesWithTypeInformation,\n TSESLint,\n TSESTree\n} from '@typescript-eslint/utils';\n\nimport { reportUnusedMembers } from './angular/angular-class-fields.ts';\nimport { angularClassImports } from './angular/angular-imports.ts';\nimport type {\n ClassEntry,\n DynamicClasses,\n MessageIds,\n ProjectMemberUsed,\n ReportUnusedMembersOptions,\n RuleContext,\n RuleOptions\n} from './common/no-unused-angular-instance-fields.type.ts';\nimport { classReadVisitor } from './typescript/typescript-class-read-visitor.ts';\nimport type { ProjectUsageIndex } from '../project-usage/common/project-index.type.ts';\nimport {\n projectUsage,\n projectUsageIsCurrent\n} from '../project-usage/project-usage.ts';\nimport { isSpecFile } from '../project-usage/utils/spec-file.util.ts';\n\ntype Options = [RuleOptions];\ntype Analysis = NonNullable<RuleOptions['analysis']>;\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow unread instance fields and methods in Angular components and directives'\n};\n\nconst messages: Record<MessageIds, string> = {\n unusedField: \"Angular instance field '{{name}}' is never read.\",\n unusedMethod: \"Angular instance method '{{name}}' is never read.\"\n};\n\nconst allowEffectFieldsSchema: JSONSchema.JSONSchema4 = {\n type: 'boolean',\n description: 'Allow Angular effect() fields with automatic cleanup.'\n};\n\nconst analysisSchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['local', 'project'],\n description: 'Choose local-file or typed whole-project analysis.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n allowEffectFields: allowEffectFieldsSchema,\n analysis: analysisSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = {\n allowEffectFields: false,\n analysis: 'local'\n};\n\nconst defaultOptions: Options = [ruleDefaults];\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://eslint.org/docs/latest/rules/no-unused-private-class-members'\n);\n\nconst projectParserServices = (\n context: RuleContext,\n analysis: Analysis\n): ParserServicesWithTypeInformation | undefined => {\n if (analysis !== 'project') return undefined;\n\n try {\n return ESLintUtils.getParserServices(context);\n } catch {\n throw new Error(\n 'Project analysis requires parser services with type information.'\n );\n }\n};\n\nconst projectMemberUsedFor = (\n parserServices: ParserServicesWithTypeInformation | undefined,\n fileName: string\n): ProjectMemberUsed | undefined => {\n if (parserServices === undefined) return undefined;\n\n let usage: ProjectUsageIndex | null | undefined;\n\n const memberUsed = (node: TSESTree.ClassElement): boolean => {\n if (usage === undefined) {\n usage = projectUsage(parserServices.program, fileName);\n }\n\n return usage?.has(parserServices.esTreeNodeToTSNodeMap.get(node)) ?? true;\n };\n\n return memberUsed;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-unused-instance-fields',\n meta,\n defaultOptions,\n create(context, [options]): TSESLint.RuleListener {\n const analysis = options.analysis ?? 'local';\n const isSpec = isSpecFile(context.filename);\n const noListeners: TSESLint.RuleListener = {};\n\n if (analysis === 'project' && isSpec) return noListeners;\n\n const parserServices = projectParserServices(context, analysis);\n const imports = angularClassImports(context.sourceCode.ast);\n\n if (!imports) return noListeners;\n\n const classes: ClassEntry[] = [];\n const stack: ClassEntry[] = [];\n const dynamicClasses: DynamicClasses = new Set();\n\n const projectIndexed = (): boolean => {\n if (parserServices === undefined) return false;\n\n return projectUsageIsCurrent(parserServices.program);\n };\n\n const reportOptions: ReportUnusedMembersOptions = {\n allowEffectFields: options.allowEffectFields ?? false,\n classes,\n context,\n dynamicClasses,\n imports,\n projectIndexed,\n projectMemberUsed: projectMemberUsedFor(parserServices, context.filename)\n };\n\n const readListeners = classReadVisitor(classes, stack, dynamicClasses);\n const listeners: TSESLint.RuleListener = {\n ...readListeners,\n 'Program:exit'(): void {\n reportUnusedMembers(reportOptions);\n }\n };\n\n return listeners;\n }\n});\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n AngularImport,\n AngularImports\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst calleeRoot = (\n node: TSESTree.Expression\n): TSESTree.Identifier | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) return node;\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.object.type === TSESTree.AST_NODE_TYPES.Super\n ) {\n return undefined;\n }\n\n return calleeRoot(node.object);\n};\n\nexport const angularName = (\n node: TSESTree.Expression,\n imports: AngularImports\n): AngularImport | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imports.get(node.name);\n }\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.computed ||\n node.property.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return null;\n }\n\n if (node.object.type === TSESTree.AST_NODE_TYPES.Identifier) {\n const namespaceAlias = imports.get(node.object.name);\n\n if (namespaceAlias === null) return node.property.name;\n }\n\n return angularName(node.object, imports);\n};\n\nexport const isImportBinding = (\n node: TSESTree.Expression,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const root = calleeRoot(node);\n\n if (!root) return false;\n\n for (\n let scope: TSESLint.Scope.Scope | null = sourceCode.getScope(root);\n scope;\n scope = scope.upper\n ) {\n const variable = scope.set.get(root.name);\n\n if (variable) return variable.defs[0]?.type === 'ImportBinding';\n }\n\n return false;\n};\n\n// eslint-disable-next-line local/no-unused-exports -- read by angular-class-fields.spec.ts\nexport const addAngularImport = (\n node: TSESTree.ImportDeclaration,\n imports: AngularImports\n): void => {\n if (node.source.value !== '@angular/core' || node.importKind === 'type') {\n return;\n }\n\n for (const specifier of node.specifiers) {\n if (specifier.type === TSESTree.AST_NODE_TYPES.ImportNamespaceSpecifier) {\n imports.set(specifier.local.name, null);\n } else if (\n specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier &&\n specifier.importKind !== 'type'\n ) {\n const { imported } = specifier;\n const isIdentifier = imported.type === TSESTree.AST_NODE_TYPES.Identifier;\n const importedName = isIdentifier ? imported.name : imported.value;\n\n imports.set(specifier.local.name, importedName);\n }\n }\n};\n\nexport const angularClassMetadata = (\n node: AngularClassNode,\n imports: AngularImports\n): AngularClassMetadata | null => {\n for (const decorator of node.decorators) {\n if (decorator.expression.type !== TSESTree.AST_NODE_TYPES.CallExpression) {\n continue;\n }\n\n const kind = angularName(decorator.expression.callee, imports);\n const metadata = decorator.expression.arguments.at(0);\n\n const isComponentOrDirective = kind === 'Component' || kind === 'Directive';\n\n if (\n isComponentOrDirective &&\n metadata?.type === TSESTree.AST_NODE_TYPES.ObjectExpression\n ) {\n const classMetadata: AngularClassMetadata | null = {\n component: kind === 'Component',\n metadata\n };\n\n return classMetadata;\n }\n }\n\n return null;\n};\n\nexport const angularClassImports = (\n ast: TSESTree.Program\n): AngularImports | null => {\n const imports: AngularImports = new Map();\n\n for (const node of ast.body) {\n if (node.type === TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n addAngularImport(node, imports);\n }\n }\n\n for (const imported of imports.values()) {\n const isNamespaceImport = imported === null;\n const isComponent = imported === 'Component';\n const isDirective = imported === 'Directive';\n const isAngularClassImport =\n isNamespaceImport || isComponent || isDirective;\n\n if (isAngularClassImport) return imports;\n }\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n isAngularComponentRefField,\n isManagedField\n} from './angular-managed-fields.ts';\nimport type {\n AngularClassNode,\n FieldCandidateOptions,\n InstanceField,\n InstanceMethod,\n MemberCandidate\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst lifecycleHooks: ReadonlySet<string> = new Set([\n 'ngOnChanges',\n 'ngOnInit',\n 'ngDoCheck',\n 'ngAfterContentInit',\n 'ngAfterContentChecked',\n 'ngAfterViewInit',\n 'ngAfterViewChecked',\n 'ngOnDestroy'\n]);\n\nconst formsInterfaceMethods: Readonly<Record<string, string[]>> = {\n AsyncValidator: ['validate', 'registerOnValidatorChange'],\n ControlValueAccessor: [\n 'writeValue',\n 'registerOnChange',\n 'registerOnTouched',\n 'setDisabledState'\n ],\n Validator: ['validate', 'registerOnValidatorChange']\n};\n\nconst isInstanceField = (\n node: TSESTree.ClassElement\n): node is InstanceField => {\n if (node.type !== TSESTree.AST_NODE_TYPES.PropertyDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isInstanceMethod = (\n node: TSESTree.ClassElement\n): node is InstanceMethod => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isExcludedField = (\n node: InstanceField,\n localPrivateOnly: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const isModified = node.static || node.declare || node.override;\n const isDecorated = node.decorators.length > 0;\n\n if (isModified || isDecorated) return true;\n\n const isComponentRef = isAngularComponentRefField(node, sourceCode);\n\n if (isComponentRef) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nconst isExcludedMethod = (\n node: InstanceMethod,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): boolean => {\n const isModified = node.static || node.override || node.computed;\n const isDecorated = node.decorators.length > 0;\n const isPlainMethod = node.kind === 'method';\n\n if (isModified || isDecorated || !isPlainMethod) return true;\n\n const hasNoBody = node.value.body === null;\n const isLifecycleHook = lifecycleHooks.has(node.key.name);\n\n if (hasNoBody || isLifecycleHook) return true;\n\n const isImplemented = implementedMethods.has(node.key.name);\n\n if (isImplemented) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nexport const implementedFormsMethods = (\n node: AngularClassNode\n): Set<string> => {\n const methods = new Set<string>();\n\n for (const heritage of node.implements) {\n if (heritage.expression.type !== TSESTree.AST_NODE_TYPES.Identifier) {\n continue;\n }\n\n for (const name of formsInterfaceMethods[heritage.expression.name] ?? []) {\n methods.add(name);\n }\n }\n\n return methods;\n};\n\nexport const fieldCandidate = (\n node: TSESTree.ClassElement,\n options: FieldCandidateOptions\n): MemberCandidate | null => {\n const isField = isInstanceField(node);\n\n if (!isField) return null;\n\n const { localPrivateOnly, sourceCode } = options;\n const isExcluded = isExcludedField(node, localPrivateOnly, sourceCode);\n\n if (isExcluded) return null;\n\n const isManaged = isManagedField(\n node,\n options.imports,\n options.allowEffectFields,\n sourceCode\n );\n\n if (isManaged) return null;\n\n const unusedFieldCandidate: MemberCandidate | null = {\n messageId: 'unusedField',\n name: node.key.name,\n node\n };\n\n return unusedFieldCandidate;\n};\n\nexport const methodCandidate = (\n node: TSESTree.ClassElement,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): MemberCandidate | null => {\n const isMethod = isInstanceMethod(node);\n\n if (!isMethod) return null;\n\n const isExcluded = isExcludedMethod(\n node,\n localPrivateOnly,\n implementedMethods\n );\n\n if (isExcluded) return null;\n\n const unusedMethodCandidate: MemberCandidate | null = {\n messageId: 'unusedMethod',\n name: node.key.name,\n node\n };\n\n return unusedMethodCandidate;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularName, isImportBinding } from './angular-imports.ts';\nimport type {\n AngularImports,\n InstanceField\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst managedApis: ReadonlySet<string> = new Set([\n 'input',\n 'model',\n 'output',\n 'viewChild',\n 'viewChildren',\n 'contentChild',\n 'contentChildren'\n]);\n\nconst isManualCleanupDisabledProperty = (\n property: TSESTree.ObjectLiteralElement\n): boolean => {\n if (\n property.type !== TSESTree.AST_NODE_TYPES.Property ||\n property.computed\n ) {\n return false;\n }\n\n const isIdentifierManualCleanup =\n property.key.type === TSESTree.AST_NODE_TYPES.Identifier &&\n property.key.name === 'manualCleanup';\n const isLiteralManualCleanup =\n property.key.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.key.value === 'manualCleanup';\n const manualCleanup = isIdentifierManualCleanup || isLiteralManualCleanup;\n\n return (\n !manualCleanup ||\n (property.value.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.value.value === false)\n );\n};\n\nconst hasAutomaticEffectCleanup = (node: TSESTree.CallExpression): boolean => {\n const options = node.arguments.at(1);\n\n if (options === undefined) return true;\n\n if (options.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n return options.properties.every(isManualCleanupDisabledProperty);\n};\n\nconst angularCoreImportedName = (\n definition: TSESLint.Scope.Definition | undefined\n): string | null => {\n if (definition?.type !== 'ImportBinding') return null;\n\n if (definition.node.type !== TSESTree.AST_NODE_TYPES.ImportSpecifier) {\n return null;\n }\n\n if (definition.parent.type !== TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n return null;\n }\n\n if (definition.parent.source.value !== '@angular/core') return null;\n\n const { imported } = definition.node;\n\n if (imported.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imported.name;\n }\n\n return imported.value;\n};\n\nexport const isAngularComponentRefField = (\n node: InstanceField,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const type = node.typeAnnotation?.typeAnnotation;\n\n if (\n type?.type !== TSESTree.AST_NODE_TYPES.TSTypeReference ||\n type.typeName.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return false;\n }\n\n const scope = sourceCode.getScope(type.typeName);\n const reference = scope.references.find(\n ({ identifier }) => identifier === type.typeName\n );\n const definition = reference?.resolved?.defs[0];\n\n return angularCoreImportedName(definition) === 'ComponentRef';\n};\n\nexport const isManagedField = (\n node: InstanceField,\n imports: AngularImports,\n allowEffectFields: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n if (node.value?.type !== TSESTree.AST_NODE_TYPES.CallExpression) return false;\n\n const name = angularName(node.value.callee, imports);\n const isString = typeof name === 'string';\n\n if (!isString) return false;\n\n const isManagedApi = managedApis.has(name);\n\n if (isManagedApi) return true;\n\n if (!allowEffectFields) return false;\n\n if (name !== 'effect') return false;\n\n const isImported = isImportBinding(node.value.callee, sourceCode);\n\n if (!isImported) return false;\n\n return hasAutomaticEffectCleanup(node.value);\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport { TSESTree } from '@typescript-eslint/utils';\n\nimport { key, metadataValue, text } from './angular-metadata-literals.ts';\nimport {\n expressionReads,\n externalTemplateReads,\n templateReads\n} from './angular-template-parsing.ts';\nimport type { MetadataReadsOptions } from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst addReads = (target: Set<string>, source: Set<string> | null): boolean => {\n if (!source) return false;\n\n for (const name of source) {\n target.add(name);\n }\n\n return true;\n};\n\nconst hostPropertyReads = (\n property: TSESTree.Property,\n reads: Set<string>,\n filename: string\n): boolean => {\n const name = key(property);\n const expression = text(property.value);\n\n if (name === null || expression === null) return false;\n\n const isPropertyBinding = name.startsWith('[');\n\n if (isPropertyBinding) {\n return addReads(reads, expressionReads(expression, filename, false));\n }\n\n const isEventBinding = name.startsWith('(');\n\n if (isEventBinding) {\n return addReads(reads, expressionReads(expression, filename, true));\n }\n\n return true;\n};\n\nconst hostReads = (\n host: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!host) return true;\n\n if (host.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n const hasUnreadableKey = host.properties.some(\n (property) => key(property) === null\n );\n\n if (hasUnreadableKey) return false;\n\n for (const property of host.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) return false;\n\n const hasPropertyReads = hostPropertyReads(property, reads, filename);\n\n if (!hasPropertyReads) return false;\n }\n\n return true;\n};\n\nconst inlineTemplateReads = (\n template: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!template) return true;\n\n const source = text(template);\n\n return source !== null && addReads(reads, templateReads(source, filename));\n};\n\nconst externalTemplatePropertyReads = (\n templateUrl: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!templateUrl) return true;\n\n const url = text(templateUrl);\n\n return (\n url !== null &&\n addReads(reads, externalTemplateReads(resolve(dirname(filename), url)))\n );\n};\n\nconst componentTemplateReads = (\n metadata: TSESTree.ObjectExpression,\n reads: Set<string>,\n filename: string\n): boolean => {\n const template = metadataValue(metadata, 'template');\n const templateUrl = metadataValue(metadata, 'templateUrl');\n\n return (\n inlineTemplateReads(template, reads, filename) &&\n externalTemplatePropertyReads(templateUrl, reads, filename)\n );\n};\n\n/**\n * Names read by a class's host bindings and, for components, its template.\n * Returns null when the metadata cannot be read statically; with\n * `requireTemplate` false an unreadable template keeps the host reads\n * instead, for callers that resolve template reads elsewhere.\n */\nexport const metadataReads = (\n options: MetadataReadsOptions\n): Set<string> | null => {\n const { filename, metadata } = options;\n const isUnreadableKey = (\n property: TSESTree.ObjectLiteralElement\n ): boolean => {\n return key(property) === null;\n };\n const hasUnreadableKey = metadata.properties.some(isUnreadableKey);\n\n if (hasUnreadableKey) return null;\n\n const reads = new Set<string>();\n const hostValue = metadataValue(metadata, 'host');\n const hasHostReads = hostReads(hostValue, reads, filename);\n\n if (!hasHostReads) return null;\n\n if (!options.component) return reads;\n\n const isRead = (name: string): boolean => reads.has(name);\n const hasRemainingReads = options.remainingNames.every(isRead);\n\n if (hasRemainingReads) return reads;\n\n const hasTemplateReads = componentTemplateReads(metadata, reads, filename);\n\n if (hasTemplateReads) return reads;\n\n if (!options.requireTemplate) return reads;\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nexport const text = (node: TSESTree.Node | null | undefined): string | null => {\n if (\n node?.type === TSESTree.AST_NODE_TYPES.Literal &&\n typeof node.value === 'string'\n ) {\n return node.value;\n }\n\n if (node?.type !== TSESTree.AST_NODE_TYPES.TemplateLiteral) return null;\n\n const hasExpressions = node.expressions.length > 0;\n\n if (hasExpressions) return null;\n\n const [quasi] = node.quasis;\n\n if (quasi === undefined) return null;\n\n return quasi.value.cooked;\n};\n\nexport const key = (property: TSESTree.ObjectLiteralElement): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n return text(property.key);\n};\n\nexport const metadataValue = (\n metadata: TSESTree.ObjectExpression,\n name: string\n): TSESTree.Property['value'] | undefined => {\n for (const property of metadata.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) continue;\n\n const propertyKey = key(property);\n\n if (propertyKey === name) return property.value;\n }\n\n return undefined;\n};\n", "import {\n Lexer,\n ParseLocation,\n ParseSourceFile,\n ParseSourceSpan,\n Parser,\n R3TargetBinder,\n parseTemplate\n} from '@angular/compiler';\nimport type { ASTWithSource, DirectiveMeta } from '@angular/compiler';\n\nimport { readFileSync, statSync } from 'node:fs';\n\nimport { collectAngularExpressionReads } from './angular-expression-reads.ts';\n\ntype ExternalTemplateCache = {\n readonly reads: Set<string> | null;\n readonly version: string;\n};\n\nconst externalTemplates = new Map<string, ExternalTemplateCache>();\nconst parser = new Parser(new Lexer());\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\n\nexport const templateReads = (\n template: string,\n filename: string\n): Set<string> | null => {\n try {\n const result = parseTemplate(template, filename);\n\n if (result.errors?.length) return null;\n\n return collectAngularExpressionReads(\n result.nodes,\n templateBinder.bind({ template: result.nodes }),\n false\n );\n } catch {\n return null;\n }\n};\n\nexport const externalTemplateReads = (filename: string): Set<string> | null => {\n try {\n const stats = statSync(filename, { bigint: true });\n const version = `${stats.mtimeNs}:${stats.size}`;\n const cached = externalTemplates.get(filename);\n\n if (cached?.version === version) return cached.reads;\n\n const reads = templateReads(readFileSync(filename, 'utf8'), filename);\n\n externalTemplates.set(filename, { reads, version });\n\n return reads;\n } catch {\n return null;\n }\n};\n\nconst parseExpression = (\n expression: string,\n span: ParseSourceSpan,\n action: boolean\n): ASTWithSource => {\n if (action) return parser.parseAction(expression, span, 0);\n\n return parser.parseBinding(expression, span, 0);\n};\n\nexport const expressionReads = (\n expression: string,\n filename: string,\n action: boolean\n): Set<string> | null => {\n try {\n const file = new ParseSourceFile(expression, filename);\n const start = new ParseLocation(file, 0, 0, 0);\n const span = new ParseSourceSpan(start, start.moveBy(expression.length));\n const result = parseExpression(expression, span, action);\n\n if (result.errors.length > 0) return null;\n\n return collectAngularExpressionReads([result], undefined, action);\n } catch {\n return null;\n }\n};\n", "import {\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n SafeKeyedRead,\n ThisReceiver\n} from '@angular/compiler';\nimport type {\n Binary,\n BoundTarget,\n DirectiveMeta,\n PropertyRead,\n SafePropertyRead\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\n\ntype VisitableNode = Parameters<CombinedRecursiveAstVisitor['visit']>[0];\n\nclass ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads = new Set<string>();\n private readonly boundTarget: BoundTarget<DirectiveMeta> | undefined;\n private readonly action: boolean;\n\n public constructor(\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n ) {\n super();\n this.boundTarget = boundTarget;\n this.action = action;\n }\n\n private record(node: PropertyRead | SafePropertyRead): void {\n if (node.receiver instanceof ThisReceiver) {\n this.reads.add(node.name);\n\n return;\n }\n\n if (!(node.receiver instanceof ImplicitReceiver)) return;\n\n const isBindableName = !this.action || node.name !== '$event';\n\n if (!isBindableName) return;\n\n const expressionTarget = this.boundTarget?.getExpressionTarget(node);\n\n if (expressionTarget) return;\n\n this.reads.add(node.name);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n\nexport const collectAngularExpressionReads = (\n nodes: VisitableNode[],\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n): Set<string> => {\n const collector = new ReadCollector(boundTarget, action);\n\n for (const node of nodes) {\n collector.visit(node);\n }\n\n return collector.reads;\n};\n", "import {\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead\n} from '@angular/compiler';\nimport type { AST } from '@angular/compiler';\n\nexport const isReadTarget = (\n node: AST\n): node is PropertyRead | SafePropertyRead | KeyedRead | SafeKeyedRead => {\n const isPropertyRead = node instanceof PropertyRead;\n const isSafePropertyRead = node instanceof SafePropertyRead;\n const isKeyedRead = node instanceof KeyedRead;\n const isSafeKeyedRead = node instanceof SafeKeyedRead;\n\n return isPropertyRead || isSafePropertyRead || isKeyedRead || isSafeKeyedRead;\n};\n", "import type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularClassMetadata } from './angular-imports.ts';\nimport {\n fieldCandidate,\n implementedFormsMethods,\n methodCandidate\n} from './angular-member-candidates.ts';\nimport { metadataReads } from './angular-metadata-reads.ts';\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n ClassEntry,\n FieldCandidateOptions,\n MemberCandidate,\n MessageIds,\n MetadataReadsOptions,\n ReportContext,\n ReportUnusedMembersOptions\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype ClassReportOptions = {\n readonly localTemplates: boolean;\n readonly options: ReportUnusedMembersOptions;\n readonly projectAnalysis: boolean;\n};\n\nconst memberCandidates = (\n node: AngularClassNode,\n options: FieldCandidateOptions\n): MemberCandidate[] => {\n const implementedMethods = implementedFormsMethods(node);\n const members: MemberCandidate[] = [];\n\n for (const element of node.body.body) {\n const fieldMatch = fieldCandidate(element, options);\n const methodMatch = methodCandidate(\n element,\n options.localPrivateOnly,\n implementedMethods\n );\n const candidate = fieldMatch ?? methodMatch;\n\n if (candidate) {\n members.push(candidate);\n }\n }\n\n return members;\n};\n\nconst reportMember = (\n context: ReportContext,\n candidate: MemberCandidate\n): void => {\n const data = { name: candidate.name };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n data,\n messageId: candidate.messageId,\n node: candidate.node.key\n };\n\n context.report(report);\n};\n\nconst reportUnreadMembers = (\n members: MemberCandidate[],\n reads: Set<string>,\n options: ReportUnusedMembersOptions\n): void => {\n for (const candidate of members) {\n const isTemplateRead = reads.has(candidate.name);\n\n if (isTemplateRead) continue;\n\n const isProjectUsed = options.projectMemberUsed?.(candidate.node) === true;\n\n if (isProjectUsed) continue;\n\n reportMember(options.context, candidate);\n }\n};\n\nconst reportClassMembers = (\n entry: ClassEntry,\n ngClass: AngularClassMetadata,\n report: ClassReportOptions\n): void => {\n const { options, projectAnalysis } = report;\n const isLocalOnlyClass = !ngClass.component || entry.node.abstract === true;\n const candidateOptions: FieldCandidateOptions = {\n allowEffectFields: options.allowEffectFields,\n imports: options.imports,\n localPrivateOnly: !projectAnalysis && isLocalOnlyClass,\n sourceCode: options.context.sourceCode\n };\n const members = memberCandidates(entry.node, candidateOptions);\n const unreadMembers = members.filter(\n (candidate) => !entry.reads.has(candidate.name)\n );\n\n if (unreadMembers.length === 0) return;\n\n const remainingNames = unreadMembers.map((candidate) => candidate.name);\n const readsOptions: MetadataReadsOptions = {\n component: ngClass.component && report.localTemplates,\n filename: options.context.filename,\n metadata: ngClass.metadata,\n remainingNames,\n requireTemplate: !projectAnalysis\n };\n const reads = metadataReads(readsOptions);\n\n if (!reads) return;\n\n reportUnreadMembers(unreadMembers, reads, options);\n};\n\nexport const reportUnusedMembers = (\n options: ReportUnusedMembersOptions\n): void => {\n const projectAnalysis = options.projectMemberUsed !== undefined;\n const localTemplates = !projectAnalysis || !options.projectIndexed();\n const report: ClassReportOptions = {\n localTemplates,\n options,\n projectAnalysis\n };\n\n for (const entry of options.classes) {\n const ngClass = angularClassMetadata(entry.node, options.imports);\n const isDynamicClass = options.dynamicClasses.has(entry);\n\n if (!ngClass || isDynamicClass) continue;\n\n reportClassMembers(entry, ngClass, report);\n }\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n destructuredThisReads,\n isThisExpression\n} from './typescript-field-reads.ts';\nimport { lexicalThisVisitor } from './typescript-lexical-this.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type {\n AngularClassNode,\n ClassEntry,\n DynamicClasses\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\nconst enterClass = (\n node: AngularClassNode,\n classes: ClassEntry[],\n stack: ClassEntry[],\n thisStack: boolean[]\n): void => {\n const entry: ClassEntry = {\n node,\n reads: new Set<string>()\n };\n\n classes.push(entry);\n stack.push(entry);\n thisStack.push(true);\n};\n\nconst trackMemberRead = (\n node: TSESTree.MemberExpression,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const receiverIsThis = isThisExpression(node.object);\n\n if (node.computed && receiverIsThis) {\n dynamicClasses.add(current);\n }\n\n if (!receiverIsThis || node.computed) return;\n\n const isWriteOnlyTarget = isWriteOnly(node);\n\n if (isWriteOnlyTarget) return;\n\n if (node.property.type === TSESTree.AST_NODE_TYPES.Identifier) {\n current.reads.add(node.property.name);\n }\n};\n\nconst trackDestructuringRead = (\n node: DestructuringNode,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const reads = destructuredThisReads(node);\n\n if (reads === undefined) return;\n\n if (reads === null) {\n dynamicClasses.add(current);\n\n return;\n }\n\n for (const name of reads) {\n current.reads.add(name);\n }\n};\n\nexport const classReadVisitor = (\n classes: ClassEntry[],\n stack: ClassEntry[],\n dynamicClasses: DynamicClasses\n): TSESLint.RuleListener => {\n const thisStack: boolean[] = [];\n const lexicalThisListeners = lexicalThisVisitor(thisStack);\n\n const listeners: TSESLint.RuleListener = {\n ClassDeclaration(node: TSESTree.ClassDeclaration): void {\n enterClass(node, classes, stack, thisStack);\n },\n ClassExpression(node: TSESTree.ClassExpression): void {\n enterClass(node, classes, stack, thisStack);\n },\n 'ClassDeclaration:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n 'ClassExpression:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n ...lexicalThisListeners,\n AssignmentExpression(node: TSESTree.AssignmentExpression): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n },\n MemberExpression(node: TSESTree.MemberExpression): void {\n trackMemberRead(node, stack, thisStack, dynamicClasses);\n },\n VariableDeclarator(node: TSESTree.VariableDeclarator): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\ntype TypeScriptExpressionWrapper =\n | TSESTree.TSAsExpression\n | TSESTree.TSInstantiationExpression\n | TSESTree.TSNonNullExpression\n | TSESTree.TSSatisfiesExpression\n | TSESTree.TSTypeAssertion;\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\ntype DestructuringParts = {\n readonly pattern: TSESTree.BindingName | TSESTree.Expression;\n readonly source: TSESTree.Expression | null;\n};\n\nconst expressionWrapperTypes: ReadonlySet<TSESTree.AST_NODE_TYPES> = new Set([\n TSESTree.AST_NODE_TYPES.TSAsExpression,\n TSESTree.AST_NODE_TYPES.TSInstantiationExpression,\n TSESTree.AST_NODE_TYPES.TSNonNullExpression,\n TSESTree.AST_NODE_TYPES.TSSatisfiesExpression,\n TSESTree.AST_NODE_TYPES.TSTypeAssertion\n]);\n\nexport const isTypeScriptExpressionWrapper = (\n node: TSESTree.Node\n): node is TypeScriptExpressionWrapper => {\n return expressionWrapperTypes.has(node.type);\n};\n\nconst unwrapTypeScriptExpression = (\n node: TSESTree.Expression | null\n): TSESTree.Expression | null => {\n let current = node;\n\n while (current && isTypeScriptExpressionWrapper(current)) {\n current = current.expression;\n }\n\n return current;\n};\n\nexport const isThisExpression = (node: TSESTree.Expression | null): boolean => {\n const unwrapped = unwrapTypeScriptExpression(node);\n\n return unwrapped?.type === TSESTree.AST_NODE_TYPES.ThisExpression;\n};\n\nconst destructuringParts = (\n node: DestructuringNode\n): DestructuringParts | null => {\n if (node.type === TSESTree.AST_NODE_TYPES.VariableDeclarator) {\n const variableParts: DestructuringParts | null = {\n pattern: node.id,\n source: node.init\n };\n\n return variableParts;\n }\n\n if (node.operator === '=') {\n const assignmentParts: DestructuringParts | null = {\n pattern: node.left,\n source: node.right\n };\n\n return assignmentParts;\n }\n\n return null;\n};\n\nconst propertyName = (\n property: TSESTree.Property | TSESTree.RestElement\n): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n const { value } = property.key;\n\n if (typeof value !== 'string') return null;\n\n return value;\n};\n\nexport const destructuredThisReads = (\n node: DestructuringNode\n): string[] | null | undefined => {\n const parts = destructuringParts(node);\n\n if (!parts) return undefined;\n\n if (parts.pattern.type !== TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return undefined;\n }\n\n const isThisSource = isThisExpression(parts.source);\n\n if (!isThisSource) return undefined;\n\n const reads: string[] = [];\n\n for (const property of parts.pattern.properties) {\n const name = propertyName(property);\n\n if (name === null) return null;\n\n reads.push(name);\n }\n\n return reads;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype FunctionNode =\n | TSESTree.ArrowFunctionExpression\n | TSESTree.FunctionDeclaration\n | TSESTree.FunctionExpression;\n\nconst componentThis = (node: FunctionNode, thisStack: boolean[]): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.ArrowFunctionExpression) {\n return thisStack.at(-1) ?? false;\n }\n\n const { parent } = node;\n\n if (parent.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return !parent.static;\n};\n\nexport const lexicalThisVisitor = (\n thisStack: boolean[]\n): TSESLint.RuleListener => {\n const listeners: TSESLint.RuleListener = {\n FunctionDeclaration(node: TSESTree.FunctionDeclaration): void {\n thisStack.push(componentThis(node, thisStack));\n },\n FunctionExpression(node: TSESTree.FunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n 'FunctionDeclaration:exit'(): void {\n thisStack.pop();\n },\n 'FunctionExpression:exit'(): void {\n thisStack.pop();\n },\n 'ArrowFunctionExpression:exit'(): void {\n thisStack.pop();\n },\n StaticBlock(): void {\n thisStack.push(false);\n },\n 'StaticBlock:exit'(): void {\n thisStack.pop();\n },\n PropertyDefinition(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.push(false);\n }\n },\n 'PropertyDefinition:exit'(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.pop();\n }\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nimport { isTypeScriptExpressionWrapper } from './typescript-field-reads.ts';\n\nconst parentOf = (node: TSESTree.Node): TSESTree.Node | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Program) return undefined;\n\n return node.parent;\n};\n\nconst isPatternTarget = (\n parent: TSESTree.Node | undefined,\n child: TSESTree.Node\n): boolean => {\n if (parent === undefined) return false;\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ArrayPattern) {\n return parent.elements.some((element) => element === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parent.left === child;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return parent.properties.some((property) => property === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.Property) {\n const isObjectPattern =\n parent.parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern;\n\n return parent.value === child && isObjectPattern;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.RestElement) {\n return parent.argument === child;\n }\n\n return false;\n};\n\nconst isSimpleAssignmentTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n if (parent?.type !== TSESTree.AST_NODE_TYPES.AssignmentExpression) {\n return false;\n }\n\n return parent.left === current && parent.operator === '=';\n};\n\nconst isLoopTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n const isForIn = parent?.type === TSESTree.AST_NODE_TYPES.ForInStatement;\n const isForOf = parent?.type === TSESTree.AST_NODE_TYPES.ForOfStatement;\n const isLoop = isForIn || isForOf;\n\n if (!isLoop) return false;\n\n return parent.left === current;\n};\n\nconst isWrapping = (parent: TSESTree.Node, child: TSESTree.Node): boolean => {\n const isWrapper = isTypeScriptExpressionWrapper(parent);\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isDirectWrite = (node: TSESTree.MemberExpression): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n\n while (\n parent &&\n isTypeScriptExpressionWrapper(parent) &&\n parent.expression === current\n ) {\n current = parent;\n parent = parentOf(parent);\n }\n\n const isDeleteExpression =\n parent?.type === TSESTree.AST_NODE_TYPES.UnaryExpression &&\n parent.operator === 'delete';\n const isAssignment = isSimpleAssignmentTarget(parent, current);\n\n return isAssignment || isDeleteExpression;\n};\n\nconst isDestructuringOrLoopTarget = (\n node: TSESTree.MemberExpression\n): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n let patternTarget = false;\n\n while (parent) {\n const wrapper = isWrapping(parent, current);\n const pattern = isPatternTarget(parent, current);\n\n if (!wrapper && !pattern) break;\n\n if (pattern) {\n patternTarget = true;\n }\n\n current = parent;\n parent = parentOf(parent);\n }\n\n const isSimpleTarget = isSimpleAssignmentTarget(parent, current);\n const isAssignedPattern = patternTarget && isSimpleTarget;\n\n return isAssignedPattern || isLoopTarget(parent, current);\n};\n\nexport const isWriteOnly = (node: TSESTree.MemberExpression): boolean => {\n const isWrite = isDirectWrite(node);\n\n if (isWrite) return true;\n\n return isDestructuringOrLoopTarget(node);\n};\n", "import { isClassElement, isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { Node, Program } from 'typescript';\n\nimport { buildDirectiveIndex } from './angular/angular-directive-index.ts';\nimport type {\n ProjectIndex,\n ProjectUsageIndex\n} from './common/project-index.type.ts';\nimport { reconcile } from './project-index-reconciliation.ts';\n\nconst indexes = new Map<string, ProjectIndex>();\n\nconst memberName = (node: Node): string | null => {\n const isMember = isClassElement(node);\n\n if (!isMember) return null;\n\n if (!node.name) return null;\n\n const isIdentifierName = isIdentifier(node.name);\n const isStringName = isStringLiteralLike(node.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (!isNamedMember) return null;\n\n return node.name.text;\n};\n\nconst usageOf = (index: ProjectIndex): ProjectUsageIndex => {\n const { declarationCounts, fallbackNameCounts } = index;\n const has = (node: Node): boolean => {\n const hasDeclaration = declarationCounts.has(node);\n\n if (hasDeclaration) return true;\n\n if (fallbackNameCounts.size === 0) return false;\n\n const name = memberName(node);\n\n return name !== null && fallbackNameCounts.has(name);\n };\n const usage: ProjectUsageIndex = { has };\n\n return usage;\n};\n\nconst createIndex = (): ProjectIndex => {\n const emptyIndex: ProjectIndex = {\n candidateNames: new Set(),\n classes: new Map(),\n declarationCounts: new Map(),\n directives: buildDirectiveIndex([]),\n directiveShape: '',\n entries: new Map(),\n fallbackNameCounts: new Map(),\n program: null,\n templateCheckDuration: 0,\n templateCheckedAt: 0\n };\n\n return emptyIndex;\n};\n\n/**\n * True when the index already reflects this exact Program, so callers can\n * skip local work the index duplicates (such as parsing a component's own\n * template) without ever triggering a build.\n */\nexport const projectUsageIsCurrent = (program: Program): boolean => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n return (\n typeof configFilePath === 'string' &&\n indexes.get(configFilePath)?.program === program\n );\n};\n\n/**\n * Member declarations read anywhere in the Program's non-spec TypeScript\n * and Angular templates, or null when the project cannot be indexed\n * reliably. Indexes are kept per tsconfig and updated incrementally: a new\n * Program (an edit in the editor) only re-indexes the files that changed\n * and the files whose resolutions depended on them. `fileName` is the file\n * being linted; its own templates are always checked for freshness.\n */\nexport const projectUsage = (\n program: Program,\n fileName: string\n): ProjectUsageIndex | null => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n if (typeof configFilePath !== 'string') return null;\n\n let index = indexes.get(configFilePath);\n\n if (!index) {\n index = createIndex();\n indexes.set(configFilePath, index);\n }\n\n try {\n reconcile(index, program, fileName);\n\n return usageOf(index);\n } catch {\n indexes.delete(configFilePath);\n\n return null;\n }\n};\n", "import { CssSelector, SelectorMatcher } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport type {\n AngularClass,\n DirectiveIndex\n} from '../common/project-usage.type.ts';\n\nconst classShape = ({\n component,\n declaration,\n exportAs,\n hostDirectives,\n name,\n selector\n}: AngularClass): string => {\n const fields = [\n declaration.getSourceFile().fileName,\n name,\n String(component),\n String(hostDirectives),\n selector ?? '',\n exportAs.join(',')\n ];\n\n return fields.join('\\0');\n};\n\nexport const directiveShape = (classes: Iterable<AngularClass>): string => {\n const classList = [...classes];\n const shapes = classList.map(classShape);\n\n return shapes.sort().join('\\n');\n};\n\nconst parseSelector = (selector: string): CssSelector[] | null => {\n try {\n return CssSelector.parse(selector);\n } catch {\n return null;\n }\n};\n\ntype Slots = Map<string, ClassLikeDeclaration[][]>;\n\nconst slotsOf = new WeakMap<DirectiveIndex, Slots>();\n\nconst classKey = ({ declaration, name }: AngularClass): string => {\n return `${declaration.getSourceFile().fileName}\\0${name}`;\n};\n\nconst addSlot = (\n slots: Slots,\n angularClass: AngularClass,\n holder: ClassLikeDeclaration[]\n): void => {\n const key = classKey(angularClass);\n const holders = slots.get(key) ?? [];\n\n holders.push(holder);\n slots.set(key, holders);\n};\n\nexport const buildDirectiveIndex = (\n classes: Iterable<AngularClass>\n): DirectiveIndex => {\n const byDeclaration = new Map<ClassLikeDeclaration, AngularClass>();\n const byExportAs = new Map<string, ClassLikeDeclaration[]>();\n const componentMatcher = new SelectorMatcher<ClassLikeDeclaration[]>();\n const slots: Slots = new Map();\n\n for (const angularClass of classes) {\n const { component, declaration, exportAs, selector } = angularClass;\n\n byDeclaration.set(declaration, angularClass);\n\n for (const name of exportAs) {\n const declarations = byExportAs.get(name) ?? [];\n\n declarations.push(declaration);\n byExportAs.set(name, declarations);\n addSlot(slots, angularClass, declarations);\n }\n\n if (component && selector !== null) {\n const selectors = parseSelector(selector);\n\n if (selectors) {\n const holder = [declaration];\n\n componentMatcher.addSelectables(selectors, holder);\n addSlot(slots, angularClass, holder);\n }\n }\n }\n\n const directiveIndex: DirectiveIndex = {\n byDeclaration,\n byExportAs,\n componentMatcher\n };\n\n slotsOf.set(directiveIndex, slots);\n\n return directiveIndex;\n};\n\nconst repointHolders = (\n holders: ClassLikeDeclaration[][],\n previous: ClassLikeDeclaration,\n next: ClassLikeDeclaration\n): void => {\n for (const holder of holders) {\n const position = holder.indexOf(previous);\n\n if (position >= 0) holder[position] = next;\n }\n};\n\n/**\n * Points the index at a re-parsed file's class declarations without\n * rebuilding it; only valid when the file's directive shape is unchanged.\n */\nexport const replaceDeclarations = (\n index: DirectiveIndex,\n previous: Iterable<AngularClass>,\n next: Iterable<AngularClass>\n): void => {\n const slots = slotsOf.get(index) ?? new Map<string, ClassLikeDeclaration[][]>();\n const nextByKey = new Map<string, AngularClass>();\n\n for (const angularClass of next) {\n nextByKey.set(classKey(angularClass), angularClass);\n }\n\n for (const angularClass of previous) {\n const key = classKey(angularClass);\n const replacement = nextByKey.get(key);\n\n if (!replacement) continue;\n\n const holders = slots.get(key) ?? [];\n\n repointHolders(holders, angularClass.declaration, replacement.declaration);\n index.byDeclaration.delete(angularClass.declaration);\n index.byDeclaration.set(replacement.declaration, replacement);\n }\n};\n", "import { dirname, normalize } from 'node:path';\n\nimport type { Program, SourceFile, TypeChecker } from 'typescript';\n\nimport type {\n FileEntry,\n LazyChecker,\n ProjectIndex,\n TemplateFileVersion\n} from './common/project-index.type.ts';\nimport { computeEntry } from './project-file-entry.ts';\nimport { reconcileClasses } from './project-index-classes.ts';\nimport {\n addEntry,\n currentSourceFiles,\n dropEntriesMentioning,\n dropReplacedEntries,\n dropStaleTemplateEntries,\n hasStaleTemplate,\n indexableSourceFiles\n} from './project-index-staleness.ts';\n\nconst lazyChecker = (program: Program): LazyChecker => {\n let typeChecker: TypeChecker | undefined;\n\n return () => (typeChecker ??= program.getTypeChecker());\n};\n\nconst indexMissingEntries = (\n index: ProjectIndex,\n sourceFiles: Iterable<SourceFile>,\n checker: LazyChecker\n): void => {\n for (const sourceFile of sourceFiles) {\n const isEntryIndexed = index.entries.has(sourceFile.fileName);\n\n if (isEntryIndexed) continue;\n\n addEntry(index, computeEntry(index, sourceFile, checker()));\n }\n};\n\nconst reindexProgram = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const indexable = indexableSourceFiles(program);\n const current = currentSourceFiles(program);\n\n dropReplacedEntries(index, current);\n\n const newNames = reconcileClasses(index, indexable, current, checker);\n\n dropEntriesMentioning(index, newNames);\n\n index.program = program;\n dropStaleTemplateEntries(index, false);\n indexMissingEntries(index, indexable, checker);\n};\n\nconst refreshTemplateEntries = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const entryCount = index.entries.size;\n\n dropStaleTemplateEntries(index, false);\n\n const isUnchanged = index.entries.size === entryCount;\n\n if (isUnchanged) return;\n\n indexMissingEntries(index, indexableSourceFiles(program), checker);\n};\n\nconst isLocalEntry = (\n entry: FileEntry,\n sourceFile: SourceFile,\n directory: string\n): boolean => {\n const isOwn = entry.sourceFile === sourceFile;\n\n if (isOwn) return true;\n\n const isNearby = (version: TemplateFileVersion): boolean => {\n return version.directory === directory;\n };\n\n return entry.templateVersions.some(isNearby);\n};\n\nconst refreshLocalEntries = (\n index: ProjectIndex,\n program: Program,\n fileName: string,\n checker: LazyChecker\n): void => {\n const sourceFile = program.getSourceFile(fileName);\n\n if (!sourceFile) return;\n\n const directory = dirname(normalize(sourceFile.fileName));\n const stale: FileEntry[] = [];\n\n for (const entry of index.entries.values()) {\n if (entry.templateVersions.length === 0) continue;\n\n const isLocal = isLocalEntry(entry, sourceFile, directory);\n\n if (!isLocal) continue;\n\n const isStale = hasStaleTemplate(entry);\n\n if (isStale) stale.push(entry);\n }\n\n for (const entry of stale) {\n addEntry(index, computeEntry(index, entry.sourceFile, checker()));\n }\n};\n\nexport const reconcile = (\n index: ProjectIndex,\n program: Program,\n fileName: string\n): void => {\n const checker = lazyChecker(program);\n const isNewProgram = index.program !== program;\n\n if (isNewProgram) {\n reindexProgram(index, program, checker);\n } else {\n refreshTemplateEntries(index, program, checker);\n }\n\n refreshLocalEntries(index, program, fileName, checker);\n};\n", "import { readFileSync, statSync } from 'node:fs';\nimport { dirname, normalize } from 'node:path';\n\nimport { isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { ClassElement, ClassLikeDeclaration } from 'typescript';\n\nimport { addTemplateReads } from './angular-template-read-resolution.ts';\nimport type {\n TemplateFileVersion,\n TemplateReads\n} from '../common/project-index.type.ts';\nimport type {\n AngularClass,\n CandidateNames,\n CollectTemplateReadsOptions,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype TemplateSource = {\n readonly fileName: string;\n readonly source: string;\n};\n\nconst memberNameOf = (member: ClassElement): string[] => {\n const name = member.name;\n\n if (!name) return [];\n\n const isIdentifierName = isIdentifier(name);\n const isStringName = isStringLiteralLike(name);\n const isTextName = isIdentifierName || isStringName;\n\n if (!isTextName) return [];\n\n const names = [name.text];\n\n return names;\n};\n\nconst memberNames = (declaration: ClassLikeDeclaration): string[] => {\n return declaration.members.flatMap(memberNameOf);\n};\n\nconst unknownTemplateNames = (\n { declaration, scope }: AngularClass,\n allNames: CandidateNames\n): Iterable<string> => {\n if (scope === null) return allNames;\n\n const scopeNames = scope.flatMap(memberNames);\n const declarationNames = memberNames(declaration);\n const names = [...declarationNames, ...scopeNames];\n\n return names;\n};\n\nconst IDENTIFIER = /[A-Za-z_$][\\w$]*/gu;\n\nconst addTemplateMentions = (source: string, sink: ReadSink): void => {\n for (const [name] of source.matchAll(IDENTIFIER)) sink.addMention(name);\n};\n\nconst templateFileVersion = (fileName: string): TemplateFileVersion => {\n const { mtimeNs, size } = statSync(fileName, { bigint: true });\n const directory = dirname(normalize(fileName));\n const version: TemplateFileVersion = { directory, fileName, mtimeNs, size };\n\n return version;\n};\n\nexport const templateFileIsCurrent = (\n version: TemplateFileVersion\n): boolean => {\n try {\n const current = statSync(version.fileName, { bigint: true });\n\n return current.mtimeNs === version.mtimeNs && current.size === version.size;\n } catch {\n return false;\n }\n};\n\nconst templateSourceOf = (\n angularClass: AngularClass,\n allNames: CandidateNames,\n sink: ReadSink,\n versions: TemplateFileVersion[]\n): TemplateSource | null => {\n const { declaration, template, valid } = angularClass;\n const fileName = declaration.getSourceFile().fileName;\n const className = declaration.name?.text ?? '(anonymous)';\n\n if (!valid) {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: metadata of ${className} is not static (template, templateUrl)`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n\n if (!template) return null;\n\n if (template.kind === 'inline') {\n const inlineSource: TemplateSource = { fileName, source: template.source };\n\n return inlineSource;\n }\n\n const templateFileName = template.fileName;\n\n try {\n versions.push(templateFileVersion(templateFileName));\n\n const source = readFileSync(templateFileName, 'utf8');\n const externalSource: TemplateSource = {\n fileName: templateFileName,\n source\n };\n\n return externalSource;\n } catch {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: templateUrl of ${className} cannot be read (${templateFileName})`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n};\n\n/** Reads made by the templates of the components declared in one file. */\nexport const collectAngularTemplateReads = ({\n allNames,\n checker,\n classes,\n directives,\n sink\n}: CollectTemplateReadsOptions): TemplateReads => {\n const templateVersions: TemplateFileVersion[] = [];\n let usedDirectiveIndex = false;\n\n for (const angularClass of classes) {\n const template = templateSourceOf(\n angularClass,\n allNames,\n sink,\n templateVersions\n );\n\n if (template === null) continue;\n\n addTemplateMentions(template.source, sink);\n\n const result = addTemplateReads({\n angularClass,\n checker,\n directives,\n fileName: template.fileName,\n sink,\n source: template.source\n });\n\n usedDirectiveIndex ||= result.usedDirectiveIndex;\n }\n\n const templateReads: TemplateReads = {\n templateVersions,\n usedDirectiveIndex\n };\n\n return templateReads;\n};\n", "import {\r\n R3TargetBinder,\r\n ThisReceiver,\r\n TmplAstReference,\r\n parseTemplate\r\n} from '@angular/compiler';\r\nimport type {\r\n BoundTarget,\r\n DirectiveMeta,\r\n ParseTemplateOptions,\r\n ParsedTemplate,\r\n TemplateEntity\r\n} from '@angular/compiler';\r\n\r\nimport { addResolvedPath } from './angular-resolved-path.ts';\r\nimport { ReadCollector } from './angular-template-read-chains.ts';\r\nimport { addReferenceRead } from './angular-template-references.ts';\r\nimport type {\r\n ReadChain,\r\n ReadSegment,\r\n ResolvedPathOptions,\r\n TemplateReadContext,\r\n TemplateReadsOptions\r\n} from '../common/project-usage.type.ts';\r\nimport { chainText } from '../utils/read-chain-text.util.ts';\r\n\r\ntype TemplateReadResult = {\r\n readonly usedDirectiveIndex: boolean;\r\n};\r\n\r\nconst identifierNames = (text: string): Set<string> => {\r\n const matches = text.match(/[A-Za-z_$][\\w$]*/gu) ?? [];\r\n\r\n return new Set(matches);\r\n};\r\n\r\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\r\n\r\nconst unparsedTemplateReads = (\r\n context: TemplateReadContext,\r\n source: string,\r\n error: string | undefined\r\n): TemplateReadResult => {\r\n const names = identifierNames(source);\r\n const message = error ?? 'unknown error';\r\n const reason = `${context.fileName}: template of ${context.className} does not parse (${message})`;\r\n\r\n context.sink.addFallbackNames(names, reason);\r\n\r\n const unparsedReads: TemplateReadResult = { usedDirectiveIndex: false };\r\n\r\n return unparsedReads;\r\n};\r\n\r\nconst addComponentRead = (\r\n context: TemplateReadContext,\r\n names: ReadSegment[]\r\n): void => {\r\n const { checker, className, declaration, fileName, sink } = context;\r\n const options: ResolvedPathOptions = {\r\n allowMissingRoot: true,\r\n checker,\r\n declaration,\r\n names,\r\n sink\r\n };\r\n const isResolved = addResolvedPath(options);\r\n\r\n if (isResolved) return;\r\n\r\n const fallbackNames = names.map((segment) => segment.name);\r\n const reason = `${fileName}: cannot resolve '${chainText(names)}' on ${className}`;\r\n\r\n sink.addFallbackNames(fallbackNames, reason);\r\n};\r\n\r\nconst chainEntity = (\r\n boundTarget: BoundTarget<DirectiveMeta>,\r\n chain: ReadChain\r\n): TemplateEntity | null => {\r\n const isThisRead = chain.root.receiver instanceof ThisReceiver;\r\n\r\n if (isThisRead) return null;\r\n\r\n return boundTarget.getExpressionTarget(chain.root);\r\n};\r\n\r\nconst addChainRead = (\r\n context: TemplateReadContext,\r\n reads: ReadCollector,\r\n boundTarget: BoundTarget<DirectiveMeta>,\r\n chain: ReadChain\r\n): boolean => {\r\n const entity = chainEntity(boundTarget, chain);\r\n\r\n if (entity === null) {\r\n addComponentRead(context, chain.names);\r\n\r\n return false;\r\n }\r\n\r\n if (!(entity instanceof TmplAstReference)) return false;\r\n\r\n const owner = reads.referenceOwners.get(entity);\r\n const names = chain.names.slice(1);\r\n\r\n addReferenceRead(context, entity, owner, names);\r\n\r\n return true;\r\n};\r\n\r\nconst PARSE_OPTIONS: ParseTemplateOptions = {\r\n leadingTriviaChars: [],\r\n preserveWhitespaces: true\r\n};\r\n\r\nconst PARSE_CACHE_SIZE = 64;\r\n\r\nconst parsedTemplates = new Map<string, ParsedTemplate>();\r\n\r\nconst parsedTemplate = (source: string, fileName: string): ParsedTemplate => {\r\n const key = `${fileName}\u0000${source}`;\r\n const cached = parsedTemplates.get(key);\r\n\r\n if (cached !== undefined) return cached;\r\n\r\n const parsed = parseTemplate(source, fileName, PARSE_OPTIONS);\r\n const isFull = parsedTemplates.size >= PARSE_CACHE_SIZE;\r\n const [oldest] = parsedTemplates.keys();\r\n\r\n if (isFull && oldest !== undefined) parsedTemplates.delete(oldest);\r\n\r\n parsedTemplates.set(key, parsed);\r\n\r\n return parsed;\r\n};\r\n\r\nexport const addTemplateReads = ({\r\n angularClass,\r\n checker,\r\n directives,\r\n fileName,\r\n sink,\r\n source\r\n}: TemplateReadsOptions): TemplateReadResult => {\r\n const { declaration, scope } = angularClass;\r\n const className = declaration.name?.text ?? '(anonymous)';\r\n const context: TemplateReadContext = {\r\n checker,\r\n className,\r\n declaration,\r\n directives,\r\n fileName,\r\n scope,\r\n sink\r\n };\r\n const parsed = parsedTemplate(source, fileName);\r\n\r\n if (parsed.errors?.length) {\r\n const error = parsed.errors[0]?.msg;\r\n\r\n return unparsedTemplateReads(context, source, error);\r\n }\r\n\r\n const boundTarget = templateBinder.bind({ template: parsed.nodes });\r\n const reads = new ReadCollector();\r\n\r\n for (const node of parsed.nodes) {\r\n reads.visit(node);\r\n }\r\n\r\n let usedDirectiveIndex = false;\r\n\r\n for (const chain of reads.reads) {\r\n const usedIndex = addChainRead(context, reads, boundTarget, chain);\r\n\r\n usedDirectiveIndex ||= usedIndex;\r\n }\r\n\r\n const templateReads: TemplateReadResult = { usedDirectiveIndex };\r\n\r\n return templateReads;\r\n};\r\n", "import { SignatureKind, TypeFlags } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport type {\n ReadSegment,\n ReadSink,\n ResolvedPathOptions\n} from '../common/project-usage.type.ts';\nimport { ownMembersNamed } from '../utils/class-members.util.ts';\nimport {\n stringIndexTypes,\n symbolsForName\n} from '../utils/type-property-symbols.util.ts';\n\ntype FlaggedType = { readonly flags: TypeFlags };\n\nconst hasAnyOrUnknownFlag = (type: FlaggedType): boolean => {\n const anyOrUnknown = TypeFlags.Any | TypeFlags.Unknown;\n\n return (type.flags & anyOrUnknown) !== 0;\n};\n\nconst isAnyOrUnknown = (types: FlaggedType[]): boolean => {\n return types.some(hasAnyOrUnknownFlag);\n};\n\nconst addTypes = (sink: ReadSink, types: Type[]): void => {\n for (const type of types) {\n sink.addType(type);\n }\n};\n\nconst callReturnTypes = (checker: TypeChecker, type: Type): Type[] => {\n const signatures = checker.getSignaturesOfType(type, SignatureKind.Call);\n\n return signatures.map((signature) => signature.getReturnType());\n};\n\nconst memberTypes = (\n symbols: Set<Symbol>,\n declaration: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): Type[] => {\n const types: Type[] = [];\n\n for (const symbol of symbols) {\n for (const memberDeclaration of symbol.declarations ?? []) {\n sink.addDeclaration(memberDeclaration);\n }\n\n types.push(checker.getTypeOfSymbolAtLocation(symbol, declaration));\n }\n\n return types;\n};\n\nconst addOwnMemberPath = (\n declaration: ClassLikeDeclaration,\n names: ReadSegment[],\n sink: ReadSink\n): boolean => {\n const [only] = names;\n const isSingle = names.length === 1 && only !== undefined;\n\n if (!isSingle) return false;\n\n const members = ownMembersNamed(declaration, only.name);\n\n if (members.length === 0) return false;\n\n for (const member of members) sink.addDeclaration(member);\n\n return true;\n};\n\nexport const addResolvedPath = ({\n allowMissingRoot,\n checker,\n declaration,\n names,\n sink\n}: ResolvedPathOptions): boolean => {\n const isOwnMember = addOwnMemberPath(declaration, names, sink);\n\n if (isOwnMember) return true;\n\n let types = [checker.getTypeAtLocation(declaration)];\n const indexTypesOf = (type: Type): Type[] => stringIndexTypes(checker, type);\n const returnTypesOf = (type: Type): Type[] => callReturnTypes(checker, type);\n\n for (const [index, segment] of names.entries()) {\n addTypes(sink, types);\n\n const symbolsOf = (type: Type): Symbol[] => {\n return symbolsForName(checker, type, segment.name);\n };\n const symbols = new Set(types.flatMap(symbolsOf));\n\n if (symbols.size === 0) {\n const indexedTypes = types.flatMap(indexTypesOf);\n\n if (indexedTypes.length > 0) {\n types = indexedTypes;\n continue;\n }\n\n const isAnyOrUnknownType = isAnyOrUnknown(types);\n\n if (isAnyOrUnknownType) return true;\n\n return index === 0 && allowMissingRoot;\n }\n\n types = memberTypes(symbols, declaration, checker, sink);\n\n if (segment.called) {\n const returnTypes = types.flatMap(returnTypesOf);\n\n if (returnTypes.length === 0) return isAnyOrUnknown(types);\n\n types = returnTypes;\n }\n }\n\n return true;\n};\n", "import {\n SyntaxKind,\n isClassLike,\n isFunctionDeclaration,\n isFunctionExpression,\n isGetAccessor,\n isIdentifier,\n isMethodDeclaration,\n isObjectLiteralExpression,\n isPrivateIdentifier,\n isSetAccessor,\n isSourceFile,\n isStringLiteralLike\n} from 'typescript';\nimport type { ClassElement, ClassLikeDeclaration, Node } from 'typescript';\n\nconst memberNameOf = (member: ClassElement): string | null => {\n const { name } = member;\n\n if (!name) return null;\n\n const isIdentifierName = isIdentifier(name);\n const isPrivateName = isPrivateIdentifier(name);\n const isStringName = isStringLiteralLike(name);\n const isTextName = isIdentifierName || isPrivateName || isStringName;\n\n if (!isTextName) return null;\n\n return name.text;\n};\n\n/** Members the class declares itself under `name`, without the type checker. */\nexport const ownMembersNamed = (\n declaration: ClassLikeDeclaration,\n name: string\n): ClassElement[] => {\n const isNamed = (member: ClassElement): boolean => {\n return memberNameOf(member) === name;\n };\n\n return declaration.members.filter(isNamed);\n};\n\nconst isObjectLiteralMember = (node: Node): boolean => {\n const isMethod = isMethodDeclaration(node);\n const isGetter = isGetAccessor(node);\n const isSetter = isSetAccessor(node);\n const isMember = isMethod || isGetter || isSetter;\n\n if (!isMember) return false;\n\n return isObjectLiteralExpression(node.parent);\n};\n\nconst isThisBoundary = (node: Node): boolean => {\n const isDeclaration = isFunctionDeclaration(node);\n const isExpression = isFunctionExpression(node);\n const isFunction = isDeclaration || isExpression;\n\n if (isFunction) return true;\n\n return isObjectLiteralMember(node);\n};\n\n/**\n * The class `this` refers to at `node`, or null when a `function` or an\n * object literal rebinds it first (then only the checker knows).\n */\nexport const thisClassOf = (node: Node): ClassLikeDeclaration | null => {\n let current = node.parent;\n\n while (!isSourceFile(current)) {\n if (isClassLike(current)) return current;\n\n const isBoundary = isThisBoundary(current);\n\n if (isBoundary) return null;\n\n current = current.parent;\n }\n\n return null;\n};\n\nexport const isThisExpression = (node: Node): boolean => {\n return node.kind === SyntaxKind.ThisKeyword;\n};\n", "import { IndexKind } from 'typescript';\nimport type { Symbol, Type, TypeChecker } from 'typescript';\n\nexport const symbolsForName = (\n checker: TypeChecker,\n type: Type,\n name: string\n): Symbol[] => {\n const symbol = checker.getPropertyOfType(checker.getApparentType(type), name);\n\n if (symbol) return [symbol];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const symbols = new Set<Symbol>();\n\n for (const member of type.types) {\n for (const memberSymbol of symbolsForName(checker, member, name)) {\n symbols.add(memberSymbol);\n }\n }\n\n return [...symbols];\n};\n\nexport const stringIndexTypes = (checker: TypeChecker, type: Type): Type[] => {\n const indexedType = checker.getIndexTypeOfType(\n checker.getApparentType(type),\n IndexKind.String\n );\n\n if (indexedType) return [indexedType];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const indexedTypes = new Set<Type>();\n\n for (const member of type.types) {\n for (const memberIndexedType of stringIndexTypes(checker, member)) {\n indexedTypes.add(memberIndexedType);\n }\n }\n\n return [...indexedTypes];\n};\n", "import type {\n AST,\n Binary,\n TmplAstComponent,\n TmplAstDirective,\n TmplAstElement,\n TmplAstReference,\n TmplAstTemplate\n} from '@angular/compiler';\nimport {\n Call,\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead,\n ThisReceiver\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\nimport type {\n ReadChain,\n ReadSegment,\n ReferenceOwner\n} from '../common/project-usage.type.ts';\n\ntype ChainStep = {\n readonly called: boolean;\n readonly next: PropertyRead | SafePropertyRead;\n};\n\nconst isPropertyReadLike = (\n node: AST\n): node is PropertyRead | SafePropertyRead => {\n const isPlainRead = node instanceof PropertyRead;\n const isSafeRead = node instanceof SafePropertyRead;\n\n return isPlainRead || isSafeRead;\n};\n\nconst isRootRead = (read: PropertyRead | SafePropertyRead): boolean => {\n const isImplicitReceiver = read.receiver instanceof ImplicitReceiver;\n const isThisReceiver = read.receiver instanceof ThisReceiver;\n\n return isImplicitReceiver || isThisReceiver;\n};\n\nconst chainStep = (read: PropertyRead | SafePropertyRead): ChainStep | null => {\n const receiver = read.receiver;\n const isReadReceiver = isPropertyReadLike(receiver);\n\n if (isReadReceiver) {\n const readStep: ChainStep = { called: false, next: receiver };\n\n return readStep;\n }\n\n const isCallReceiver = receiver instanceof Call;\n\n if (!isCallReceiver) return null;\n\n const target = receiver.receiver;\n const isReadLikeTarget = isPropertyReadLike(target);\n\n if (!isReadLikeTarget) return null;\n\n const calledStep: ChainStep = { called: true, next: target };\n\n return calledStep;\n};\n\nconst readChain = (node: PropertyRead | SafePropertyRead): ReadChain | null => {\n const leaf: ReadSegment = { called: false, name: node.name };\n const names: ReadSegment[] = [leaf];\n let current = node;\n\n while (!isRootRead(current)) {\n const step = chainStep(current);\n\n if (step === null) return null;\n\n current = step.next;\n names.unshift({ called: step.called, name: current.name });\n }\n\n if (!(current instanceof PropertyRead)) return null;\n\n const chain: ReadChain = { names, root: current };\n\n return chain;\n};\n\nexport class ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads: ReadChain[] = [];\n public readonly referenceOwners = new Map<TmplAstReference, ReferenceOwner>();\n\n private record(node: PropertyRead | SafePropertyRead): void {\n const chain = readChain(node);\n\n if (chain) {\n this.reads.push(chain);\n }\n }\n\n private recordReferences(owner: ReferenceOwner): void {\n for (const reference of owner.references) {\n this.referenceOwners.set(reference, owner);\n }\n }\n\n public override visitElement(element: TmplAstElement): void {\n this.recordReferences(element);\n super.visitElement(element);\n }\n\n public override visitTemplate(template: TmplAstTemplate): void {\n this.recordReferences(template);\n super.visitTemplate(template);\n }\n\n public override visitComponent(component: TmplAstComponent): void {\n this.recordReferences(component);\n super.visitComponent(component);\n }\n\n public override visitDirective(directive: TmplAstDirective): void {\n this.recordReferences(directive);\n super.visitDirective(directive);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n", "import { TmplAstElement, createCssSelectorFromNode } from '@angular/compiler';\nimport type { TmplAstReference } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport { addResolvedPath } from './angular-resolved-path.ts';\nimport type {\n DirectiveIndex,\n ReadSegment,\n ReferenceOwner,\n ResolvedPathOptions,\n TemplateReadContext\n} from '../common/project-usage.type.ts';\nimport { chainText } from '../utils/read-chain-text.util.ts';\n\nconst referenceTargets = (\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n directives: DirectiveIndex,\n scope: ClassLikeDeclaration[] | null\n): ClassLikeDeclaration[] => {\n const exportAs = reference.value.trim();\n let targets: ClassLikeDeclaration[] = [];\n\n if (exportAs !== '') {\n const exportedTargets = directives.byExportAs.get(exportAs) ?? [];\n\n targets = [...exportedTargets];\n } else if (owner instanceof TmplAstElement) {\n directives.componentMatcher.match(\n createCssSelectorFromNode(owner),\n (_selector, declarations) => targets.push(...declarations)\n );\n }\n\n const hostDirectiveInScope =\n scope?.some(\n (declaration) => directives.byDeclaration.get(declaration)?.hostDirectives\n ) ?? false;\n const scoped = scope !== null && !hostDirectiveInScope;\n\n if (!scoped) return targets;\n\n const scopedTargets = targets.filter((target) => scope.includes(target));\n\n return scopedTargets;\n};\n\n/** Reads made on the classes a template `#reference` resolves to. */\nexport const addReferenceRead = (\n context: TemplateReadContext,\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n names: ReadSegment[]\n): void => {\n const { checker, className, directives, fileName, scope, sink } = context;\n const targets = referenceTargets(reference, owner, directives, scope);\n const isTargetResolved = (target: ClassLikeDeclaration): boolean => {\n const options: ResolvedPathOptions = {\n allowMissingRoot: false,\n checker,\n declaration: target,\n names,\n sink\n };\n\n return addResolvedPath(options);\n };\n const resolved = targets.map(isTargetResolved);\n const hasResolvedTarget = resolved.includes(true);\n\n if (resolved.length === 0) return;\n\n if (hasResolvedTarget) return;\n\n const fallbackNames = names.map((segment) => segment.name);\n const reason = `${fileName}: cannot resolve '#${reference.name}.${chainText(names)}' in ${className}`;\n\n sink.addFallbackNames(fallbackNames, reason);\n};\n", "import type { ReadSegment } from '../common/project-usage.type.ts';\n\nconst segmentText = (segment: ReadSegment): string => {\n const call = segment.called ? '()' : '';\n\n return `${segment.name}${call}`;\n};\n\n/** A read chain rendered the way it appeared in the template. */\nexport const chainText = (names: ReadSegment[]): string => {\n const texts = names.map(segmentText);\n\n return texts.join('.');\n};\n", "import {\n forEachChild,\n isClassLike,\n isElementAccessExpression,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ElementAccessExpression,\n Node,\n PropertyAccessExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { collectAngularInterfaceMethods } from './typescript-angular-interface-methods.ts';\nimport { collectDestructuringReads } from './typescript-destructuring-reads.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n literalPropertyNames\n} from './typescript-symbol-reads.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type { CandidateNames, ReadSink } from '../common/project-usage.type.ts';\nimport {\n isThisExpression,\n ownMembersNamed,\n thisClassOf\n} from '../utils/class-members.util.ts';\n\nconst addOwnMemberRead = (\n node: PropertyAccessExpression,\n sink: ReadSink\n): boolean => {\n const isThisAccess = isThisExpression(node.expression);\n\n if (!isThisAccess) return false;\n\n const owner = thisClassOf(node);\n\n if (owner === null) return false;\n\n const members = ownMembersNamed(owner, node.name.text);\n\n if (members.length === 0) return false;\n\n for (const member of members) sink.addDeclaration(member);\n\n return true;\n};\n\nconst addPropertyAccessRead = (\n node: PropertyAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n sink.addMention(node.name.text);\n\n const isCandidateName = candidateNames.has(node.name.text);\n\n if (!isCandidateName) return;\n\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n const isOwnMember = addOwnMemberRead(node, sink);\n\n if (isOwnMember) return;\n\n sink.addType(checker.getTypeAtLocation(node.expression));\n\n const symbol = checker.getSymbolAtLocation(node.name);\n\n if (symbol) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n};\n\nconst addElementAccessRead = (\n node: ElementAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n const argumentType = checker.getTypeAtLocation(node.argumentExpression);\n const names = literalPropertyNames(argumentType);\n\n for (const name of names ?? []) sink.addMention(name);\n\n if (names) {\n const hasCandidateName = names.some((name) => candidateNames.has(name));\n\n if (!hasCandidateName) return;\n }\n\n const targetType = checker.getTypeAtLocation(node.expression);\n\n addNamedProperties(checker, targetType, names, sink);\n};\n\nexport const collectTypeScriptReads = (\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const visit = (node: Node): void => {\n const isPropertyAccess = isPropertyAccessExpression(node);\n const isElementAccess = isElementAccessExpression(node);\n const isClass = isClassLike(node);\n\n if (isPropertyAccess) {\n addPropertyAccessRead(node, checker, sink, candidateNames);\n } else if (isElementAccess) {\n addElementAccessRead(node, checker, sink, candidateNames);\n } else if (isClass) {\n collectAngularInterfaceMethods(node, checker, sink);\n }\n\n collectDestructuringReads(node, checker, sink, candidateNames);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n};\n", "import { SyntaxKind, isMethodSignature } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport { addSymbolDeclarations } from './typescript-symbol-reads.ts';\nimport type { ReadSink } from '../common/project-usage.type.ts';\n\nconst isAngularMethodSignature = (declaration: Declaration): boolean => {\n const isMethod = isMethodSignature(declaration);\n\n if (!isMethod) return false;\n\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/');\n};\n\nconst isAngularInterfaceMethod = (symbol: Symbol): boolean => {\n const declarations = symbol.declarations ?? [];\n\n return declarations.some(isAngularMethodSignature);\n};\n\nconst addImplementations = (\n heritageType: Type,\n classType: Type,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n for (const interfaceMethod of heritageType.getProperties()) {\n const isInterfaceMethod = isAngularInterfaceMethod(interfaceMethod);\n\n if (!isInterfaceMethod) continue;\n\n const implementation = classType.getProperty(interfaceMethod.name);\n\n if (implementation) {\n addSymbolDeclarations(checker, implementation, sink);\n }\n }\n};\n\n/**\n * Angular calls lifecycle and forms methods through the interfaces a class\n * implements, so an implementation of one counts as read.\n */\nexport const collectAngularInterfaceMethods = (\n node: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n const heritageClauses = node.heritageClauses ?? [];\n const implementsClauses = heritageClauses.filter(\n (clause) => clause.token === SyntaxKind.ImplementsKeyword\n );\n\n if (implementsClauses.length === 0) return;\n\n const classType = checker.getTypeAtLocation(node);\n\n for (const clause of implementsClauses) {\n for (const heritageType of clause.types) {\n const type = checker.getTypeAtLocation(heritageType);\n\n sink.addType(type);\n addImplementations(type, classType, checker, sink);\n }\n }\n};\n", "import {\n SymbolFlags,\n isBigIntLiteral,\n isIdentifier,\n isNumericLiteral,\n isPrivateIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { PropertyName, Symbol, Type, TypeChecker } from 'typescript';\n\nimport type { ReadSink } from '../common/project-usage.type.ts';\nimport { symbolsForName } from '../utils/type-property-symbols.util.ts';\n\nconst aliasTarget = (checker: TypeChecker, symbol: Symbol): Symbol => {\n const isAlias = (symbol.flags & SymbolFlags.Alias) !== 0;\n\n if (!isAlias) return symbol;\n\n return checker.getAliasedSymbol(symbol);\n};\n\nexport const addSymbolDeclarations = (\n checker: TypeChecker,\n symbol: Symbol,\n sink: ReadSink\n): void => {\n const resolved = aliasTarget(checker, symbol);\n\n for (const declaration of resolved.declarations ?? []) {\n sink.addDeclaration(declaration);\n }\n};\n\nexport const allPropertySymbols = (\n checker: TypeChecker,\n type: Type\n): Symbol[] => {\n const symbols = new Set(\n checker.getPropertiesOfType(checker.getApparentType(type))\n );\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n for (const symbol of allPropertySymbols(checker, member)) {\n symbols.add(symbol);\n }\n }\n }\n\n return [...symbols];\n};\n\nconst namedPropertySymbols = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null\n): Symbol[] => {\n if (names === null) return allPropertySymbols(checker, type);\n\n return names.flatMap((name) => symbolsForName(checker, type, name));\n};\n\nexport const addNamedProperties = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null,\n sink: ReadSink\n): Symbol[] => {\n sink.addType(type);\n\n const symbols = namedPropertySymbols(checker, type, names);\n\n for (const symbol of symbols) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n\n return symbols;\n};\n\nexport const literalPropertyNames = (type: Type): string[] | null => {\n const isStringLiteral = type.isStringLiteral();\n const isNumberLiteral = type.isNumberLiteral();\n const isLiteralType = isStringLiteral || isNumberLiteral;\n\n if (isLiteralType) return [String(type.value)];\n\n const isUnion = type.isUnion();\n\n if (!isUnion) return null;\n\n const names: string[] = [];\n\n for (const member of type.types) {\n const memberNames = literalPropertyNames(member);\n\n if (!memberNames) return null;\n\n names.push(...memberNames);\n }\n\n return names;\n};\n\nexport const propertyName = (\n checker: TypeChecker,\n node: PropertyName\n): string[] | null => {\n const isIdentifierName = isIdentifier(node);\n const isPrivateName = isPrivateIdentifier(node);\n const isStringName = isStringLiteralLike(node);\n const isNumericName = isNumericLiteral(node);\n const isBigIntName = isBigIntLiteral(node);\n const isLiteralName =\n isIdentifierName ||\n isPrivateName ||\n isStringName ||\n isNumericName ||\n isBigIntName;\n\n if (isLiteralName) return [node.text];\n\n return literalPropertyNames(checker.getTypeAtLocation(node.expression));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isBinaryExpression,\n isBindingElement,\n isObjectLiteralExpression,\n isVariableDeclaration\n} from 'typescript';\nimport type { Node, Type, TypeChecker } from 'typescript';\n\nimport { assignmentPatternElements } from './typescript-assignment-pattern-elements.ts';\nimport {\n bindingPatternElements,\n isBindingPattern\n} from './typescript-binding-pattern-elements.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n allPropertySymbols\n} from './typescript-symbol-reads.ts';\nimport type {\n CandidateNames,\n DestructuringPattern,\n PatternElementRead,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype LazyType = () => Type;\n\ntype PatternReadContext = {\n readonly checker: TypeChecker;\n readonly sink: ReadSink;\n readonly candidateNames: CandidateNames;\n};\n\nconst lazyType = (compute: () => Type): LazyType => {\n let type: Type | undefined;\n\n return () => (type ??= compute());\n};\n\nconst isSkippable = (\n read: PatternElementRead,\n candidateNames: CandidateNames\n): boolean => {\n if (read.nested !== null) return false;\n\n if (read.names === null) return false;\n\n const hasCandidateName = read.names.some((name) => candidateNames.has(name));\n\n return !hasCandidateName;\n};\n\nconst patternElements = (\n pattern: DestructuringPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isBinding = isBindingPattern(pattern);\n\n if (isBinding) return bindingPatternElements(pattern, checker);\n\n return assignmentPatternElements(pattern, checker);\n};\n\nconst addRestReads = (\n type: Type,\n consumed: Set<string>,\n context: PatternReadContext\n): void => {\n context.sink.addType(type);\n\n for (const symbol of allPropertySymbols(context.checker, type)) {\n const isConsumed = consumed.has(symbol.name);\n\n if (isConsumed) continue;\n\n addSymbolDeclarations(context.checker, symbol, context.sink);\n }\n};\n\nconst collectPatternReads = (\n pattern: DestructuringPattern,\n type: LazyType,\n context: PatternReadContext\n): void => {\n const { checker, sink, candidateNames } = context;\n const consumed = new Set<string>();\n const reads = patternElements(pattern, checker);\n\n for (const read of reads) {\n if (read.rest) {\n addRestReads(type(), consumed, context);\n continue;\n }\n\n for (const name of read.names ?? []) {\n consumed.add(name);\n sink.addMention(name);\n }\n\n const skip = isSkippable(read, candidateNames);\n\n if (skip) continue;\n\n const symbols = addNamedProperties(checker, type(), read.names, sink);\n const nested = read.nested;\n\n if (nested === null) continue;\n\n for (const symbol of symbols) {\n const nestedTypeOf = (): Type =>\n checker.getTypeOfSymbolAtLocation(symbol, read.location);\n const nestedType = lazyType(nestedTypeOf);\n\n collectPatternReads(nested, nestedType, context);\n }\n }\n};\n\nconst collectBindingReads = (node: Node, context: PatternReadContext): void => {\n const isBinding = isBindingPattern(node);\n\n if (!isBinding) return;\n\n const isBindingElementParent = isBindingElement(node.parent);\n const isNestedBindingName =\n isBindingElementParent && node.parent.name === node;\n\n if (isNestedBindingName) return;\n\n const declaration = node.parent;\n const isDeclaration = isVariableDeclaration(declaration);\n const isInitializedDeclaration =\n isDeclaration && declaration.initializer !== undefined;\n const source = isInitializedDeclaration\n ? declaration.initializer\n : declaration;\n const sourceTypeOf = (): Type => context.checker.getTypeAtLocation(source);\n const sourceType = lazyType(sourceTypeOf);\n\n collectPatternReads(node, sourceType, context);\n};\n\nconst collectAssignmentReads = (\n node: Node,\n context: PatternReadContext\n): void => {\n const isBinary = isBinaryExpression(node);\n\n if (!isBinary) return;\n\n const isEqualsAssignment = node.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (!isEqualsAssignment) return;\n\n const isArrayTarget = isArrayLiteralExpression(node.left);\n const isObjectTarget = isObjectLiteralExpression(node.left);\n const isDestructuringAssignment = isArrayTarget || isObjectTarget;\n\n if (!isDestructuringAssignment) return;\n\n const rightTypeOf = (): Type => context.checker.getTypeAtLocation(node.right);\n const sourceType = lazyType(rightTypeOf);\n\n collectPatternReads(node.left, sourceType, context);\n};\n\nexport const collectDestructuringReads = (\n node: Node,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const context: PatternReadContext = { checker, sink, candidateNames };\n\n collectBindingReads(node, context);\n collectAssignmentReads(node, context);\n};\n", "import {\n isArrayLiteralExpression,\n isObjectLiteralExpression,\n isOmittedExpression,\n isPropertyAssignment,\n isSpreadAssignment,\n isSpreadElement\n} from 'typescript';\nimport type {\n Expression,\n ObjectLiteralElementLike,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n AssignmentPattern,\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nconst nestedPattern = (expression: Expression): DestructuringPattern | null => {\n const isArrayLiteral = isArrayLiteralExpression(expression);\n const isObjectLiteral = isObjectLiteralExpression(expression);\n const isNested = isArrayLiteral || isObjectLiteral;\n\n if (!isNested) return null;\n\n return expression;\n};\n\nconst nestedPropertyPattern = (\n property: ObjectLiteralElementLike\n): DestructuringPattern | null => {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) return null;\n\n return nestedPattern(property.initializer);\n};\n\nconst arrayElementRead = (\n element: Expression,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = isSpreadElement(element);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst propertyRead = (\n property: ObjectLiteralElementLike,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestProperty = isSpreadAssignment(property);\n\n if (isRestProperty) {\n const restRead: PatternElementRead = {\n location: property,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: property,\n names: propertyName(checker, property.name),\n nested: nestedPropertyPattern(property),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one destructuring assignment target. */\nexport const assignmentPatternElements = (\n pattern: AssignmentPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayLiteralExpression(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.properties.map((property) => propertyRead(property, checker));\n};\n", "import {\n isArrayBindingPattern,\n isIdentifier,\n isObjectBindingPattern,\n isOmittedExpression\n} from 'typescript';\nimport type {\n ArrayBindingElement,\n BindingElement,\n BindingPattern,\n Node,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nexport const isBindingPattern = (node: Node): node is BindingPattern => {\n const isArrayPattern = isArrayBindingPattern(node);\n const isObjectPattern = isObjectBindingPattern(node);\n\n return isArrayPattern || isObjectPattern;\n};\n\nconst nestedPattern = (\n element: BindingElement\n): DestructuringPattern | null => {\n const isNested = isBindingPattern(element.name);\n\n if (!isNested) return null;\n\n return element.name;\n};\n\nconst bindingNames = (\n checker: TypeChecker,\n element: BindingElement\n): string[] | null => {\n if (element.propertyName) return propertyName(checker, element.propertyName);\n\n const isIdentifierName = isIdentifier(element.name);\n\n if (!isIdentifierName) return null;\n\n return [element.name.text];\n};\n\nconst arrayElementRead = (\n element: ArrayBindingElement,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = Boolean(element.dotDotDotToken);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst objectElementRead = (\n element: BindingElement,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestElement = Boolean(element.dotDotDotToken);\n\n if (isRestElement) {\n const restRead: PatternElementRead = {\n location: element,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: element,\n names: bindingNames(checker, element),\n nested: nestedPattern(element),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one array or object binding pattern. */\nexport const bindingPatternElements = (\n pattern: BindingPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayBindingPattern(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.elements.map((element) => objectElementRead(element, checker));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isAsExpression,\n isBinaryExpression,\n isDeleteExpression,\n isForInStatement,\n isForOfStatement,\n isNonNullExpression,\n isObjectLiteralExpression,\n isParenthesizedExpression,\n isPropertyAssignment,\n isSatisfiesExpression,\n isSpreadAssignment,\n isTypeAssertionExpression\n} from 'typescript';\nimport type { Expression, Node } from 'typescript';\n\nconst isExpressionWrapper = (parent: Node, child: Node): boolean => {\n const isParenthesized = isParenthesizedExpression(parent);\n const isAs = isAsExpression(parent);\n const isTypeAssertion = isTypeAssertionExpression(parent);\n const isNonNull = isNonNullExpression(parent);\n const isSatisfies = isSatisfiesExpression(parent);\n const isCast = isAs || isTypeAssertion || isSatisfies;\n const isWrapper = isParenthesized || isNonNull || isCast;\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isPatternContainer = (parent: Node, child: Node): boolean => {\n const isArrayLiteral = isArrayLiteralExpression(parent);\n\n if (isArrayLiteral) {\n return parent.elements.some((element) => element === child);\n }\n\n const isObjectLiteral = isObjectLiteralExpression(parent);\n\n if (isObjectLiteral) {\n return parent.properties.some((property) => property === child);\n }\n\n const isAssignment = isPropertyAssignment(parent);\n\n if (isAssignment) return parent.initializer === child;\n\n const isSpread = isSpreadAssignment(parent);\n\n if (!isSpread) return false;\n\n return parent.expression === child;\n};\n\nconst isWriteTarget = (parent: Node, current: Node): boolean => {\n const isBinary = isBinaryExpression(parent);\n const isBinaryTarget =\n isBinary &&\n parent.left === current &&\n parent.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (isBinaryTarget) return true;\n\n const isDelete = isDeleteExpression(parent);\n const isDeleteTarget = isDelete && parent.expression === current;\n\n if (isDeleteTarget) return true;\n\n const isForIn = isForInStatement(parent);\n const isForOf = isForOfStatement(parent);\n const isIteration = isForIn || isForOf;\n\n return isIteration && parent.initializer === current;\n};\n\n/**\n * True when every use of `node` up through its wrapping expressions and\n * destructuring patterns writes to it rather than reading it.\n */\nexport const isWriteOnly = (node: Expression): boolean => {\n let current: Node = node;\n let parent = node.parent;\n\n while (\n isExpressionWrapper(parent, current) ||\n isPatternContainer(parent, current)\n ) {\n current = parent;\n parent = parent.parent;\n }\n\n return isWriteTarget(parent, current);\n};\n", "import { ObjectFlags, TypeFlags } from 'typescript';\nimport type {\n InterfaceType,\n ObjectType,\n SourceFile,\n Type,\n TypeChecker,\n TypeReference\n} from 'typescript';\n\nconst isObjectType = (type: Type): type is ObjectType => {\n return (type.flags & TypeFlags.Object) !== 0;\n};\n\nconst isTypeReference = (type: ObjectType): type is TypeReference => {\n return (type.objectFlags & ObjectFlags.Reference) !== 0;\n};\n\nconst isInterfaceType = (type: ObjectType): type is InterfaceType => {\n return (type.objectFlags & ObjectFlags.ClassOrInterface) !== 0;\n};\n\nconst addDeclarationFiles = (\n type: Type,\n dependencies: Set<SourceFile>\n): void => {\n for (const symbol of [type.getSymbol(), type.aliasSymbol]) {\n const declarations = symbol?.declarations ?? [];\n\n for (const declaration of declarations) {\n dependencies.add(declaration.getSourceFile());\n }\n }\n};\n\nconst baseTypesOf = (checker: TypeChecker, type: Type): Type[] => {\n const isObject = isObjectType(type);\n\n if (!isObject) return [];\n\n const isReference = isTypeReference(type);\n const target = isReference ? type.target : type;\n const isClassOrInterface = isInterfaceType(target);\n\n if (!isClassOrInterface) return [];\n\n return checker.getBaseTypes(target);\n};\n\nexport const addTypeDependencies = (\n checker: TypeChecker,\n type: Type,\n dependencies: Set<SourceFile>,\n seen: Set<Type>\n): void => {\n const isSeen = seen.has(type);\n\n if (isSeen) return;\n\n seen.add(type);\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n addTypeDependencies(checker, member, dependencies, seen);\n }\n\n return;\n }\n\n addDeclarationFiles(type, dependencies);\n\n const isTypeParameter = (type.flags & TypeFlags.TypeParameter) !== 0;\n\n if (isTypeParameter) {\n const constraint = checker.getBaseConstraintOfType(type);\n\n if (constraint) {\n addTypeDependencies(checker, constraint, dependencies, seen);\n }\n\n return;\n }\n\n for (const base of baseTypesOf(checker, type)) {\n addTypeDependencies(checker, base, dependencies, seen);\n }\n};\n", "import type { Node, SourceFile, Type, TypeChecker } from 'typescript';\n\nimport { collectAngularTemplateReads } from './angular/angular-template-reads.ts';\nimport type {\n FileEntry,\n ProjectIndex,\n TemplateReads\n} from './common/project-index.type.ts';\nimport type { ReadSink } from './common/project-usage.type.ts';\nimport { collectTypeScriptReads } from './typescript/typescript-reads.ts';\nimport { addTypeDependencies } from './typescript/typescript-type-dependencies.ts';\n\nconst failureText = (error: unknown): string => {\n if (error instanceof Error) return error.message;\n\n return String(error);\n};\n\nconst collectFileReads = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink\n): TemplateReads => {\n try {\n collectTypeScriptReads(sourceFile, checker, sink, index.candidateNames);\n\n const classes = index.classes.get(sourceFile.fileName)?.classes ?? [];\n\n return collectAngularTemplateReads({\n allNames: index.candidateNames,\n checker,\n classes,\n directives: index.directives,\n sink\n });\n } catch (error) {\n const errorMessage = failureText(error);\n\n sink.addFallbackNames(\n index.candidateNames,\n `${sourceFile.fileName}: indexing failed (${errorMessage})`\n );\n\n const noTemplateReads: TemplateReads = {\n templateVersions: [],\n usedDirectiveIndex: false\n };\n\n return noTemplateReads;\n }\n};\n\nexport const computeEntry = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker\n): FileEntry => {\n const declarations = new Set<Node>();\n const dependencies = new Set<SourceFile>();\n const fallbackNames = new Set<string>();\n const mentionedNames = new Set<string>();\n const seenTypes = new Set<Type>();\n const sink: ReadSink = {\n addDeclaration: (declaration) => {\n declarations.add(declaration);\n dependencies.add(declaration.getSourceFile());\n },\n addFallbackNames: (names) => {\n for (const name of names) {\n fallbackNames.add(name);\n }\n },\n addMention: (name) => {\n mentionedNames.add(name);\n },\n addType: (type) => {\n addTypeDependencies(checker, type, dependencies, seenTypes);\n }\n };\n const reads = collectFileReads(index, sourceFile, checker, sink);\n\n dependencies.delete(sourceFile);\n\n const fileEntry: FileEntry = {\n ...reads,\n declarations,\n dependencies,\n fallbackNames,\n mentionedNames,\n sourceFile\n };\n\n return fileEntry;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isCallExpression,\n isClassLike,\n isObjectLiteralExpression\n} from 'typescript';\nimport type {\n CallExpression,\n ClassLikeDeclaration,\n Node,\n ObjectLiteralExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { scopeOf } from './angular-component-scope.ts';\nimport { angularDecoratorKind } from './angular-decorator-kind.ts';\nimport {\n exportAsOf,\n metadataProperty,\n stringValue,\n templateOf\n} from './angular-metadata-values.ts';\nimport type {\n AngularClass,\n DiscoveredClasses,\n Discovery\n} from '../common/project-usage.type.ts';\n\ntype UndecidedClass = Omit<AngularClass, 'valid'>;\n\nconst describedClass = (\n base: UndecidedClass,\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): AngularClass => {\n const selector = metadataProperty(metadata, 'selector');\n const described = {\n ...base,\n exportAs: exportAsOf(metadata, discovery),\n hostDirectives: metadataProperty(metadata, 'hostDirectives') !== undefined,\n selector: stringValue(selector, discovery)\n };\n\n if (!base.component) {\n const directiveDiscovery: AngularClass = { ...described, valid: true };\n\n return directiveDiscovery;\n }\n\n const fileName = base.declaration.getSourceFile().fileName;\n const template = templateOf(metadata, fileName, discovery);\n const componentDiscovery: AngularClass = {\n ...described,\n scope: scopeOf(metadata, discovery),\n template: template ?? null,\n valid: template !== undefined\n };\n\n return componentDiscovery;\n};\n\nconst decoratedClass = (\n declaration: ClassLikeDeclaration,\n call: CallExpression,\n discovery: Discovery\n): AngularClass | null => {\n const kind = angularDecoratorKind(call.expression, discovery);\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n const component = kind === 'Component';\n const base: UndecidedClass = {\n component,\n declaration,\n exportAs: [],\n hostDirectives: false,\n name: declaration.name?.text ?? '',\n scope: null,\n selector: null,\n template: null\n };\n const metadata = call.arguments.at(0);\n\n if (metadata === undefined) {\n const bareDiscovery: AngularClass = { ...base, valid: !component };\n\n return bareDiscovery;\n }\n\n const isMetadataObject = isObjectLiteralExpression(metadata);\n\n if (!isMetadataObject) {\n const invalidDiscovery: AngularClass = { ...base, valid: false };\n\n return invalidDiscovery;\n }\n\n return describedClass(base, metadata, discovery);\n};\n\nconst angularClass = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): AngularClass | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const found = decoratedClass(declaration, decorator.expression, discovery);\n\n if (found) return found;\n }\n\n return null;\n};\n\n/** Angular components and directives declared in one source file. */\nexport const angularClasses = (\n sourceFile: SourceFile,\n checker: TypeChecker\n): DiscoveredClasses => {\n const classes: AngularClass[] = [];\n const discovery: Discovery = { checker, dependencies: new Set() };\n\n const visit = (node: Node): void => {\n const isClass = isClassLike(node);\n\n if (isClass) {\n const found = angularClass(node, discovery);\n\n if (found) {\n classes.push(found);\n }\n }\n\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n discovery.dependencies.delete(sourceFile);\n\n const discovered: DiscoveredClasses = {\n classes,\n dependencies: discovery.dependencies\n };\n\n return discovered;\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isClassLike,\n isIdentifier,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Expression,\n ObjectLiteralExpression,\n Symbol\n} from 'typescript';\n\nimport { classDecoratorKind, resolveAlias } from './angular-decorator-kind.ts';\nimport { metadataProperty } from './angular-metadata-values.ts';\nimport type { Discovery } from '../common/project-usage.type.ts';\n\nconst booleanValue = (node: Expression | undefined): boolean | undefined => {\n if (!node) return undefined;\n\n if (node.kind === SyntaxKind.TrueKeyword) return true;\n\n if (node.kind === SyntaxKind.FalseKeyword) return false;\n\n return undefined;\n};\n\nconst classesOf = (\n symbol: Symbol,\n discovery: Discovery\n): ClassLikeDeclaration[] => {\n const resolved = resolveAlias(symbol, discovery);\n const declarations = resolved.declarations ?? [];\n\n return declarations.filter(isClassLike);\n};\n\nconst scopedClasses = (\n classes: ClassLikeDeclaration[],\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const scoped: ClassLikeDeclaration[] = [];\n\n for (const declaration of classes) {\n if (declaration.getSourceFile().isDeclarationFile) continue;\n\n const kind = classDecoratorKind(declaration, discovery);\n\n if (kind === 'Pipe') continue;\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n scoped.push(declaration);\n }\n\n return scoped;\n};\n\nconst importedClasses = (\n element: Expression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const isIdentifierElement = isIdentifier(element);\n const isPropertyAccessElement = isPropertyAccessExpression(element);\n\n if (!isIdentifierElement && !isPropertyAccessElement) return null;\n\n const target = isIdentifierElement ? element : element.name;\n const symbol = discovery.checker.getSymbolAtLocation(target);\n\n if (!symbol) return null;\n\n const classes = classesOf(symbol, discovery);\n\n if (classes.length === 0) return null;\n\n return scopedClasses(classes, discovery);\n};\n\n/**\n * Resolves a standalone component's `imports` to program classes. Library\n * classes and pipes are skipped; anything that cannot be classified (an\n * NgModule, a spread, a `forwardRef`) makes the scope unknown.\n */\nexport const scopeOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const standalone = booleanValue(metadataProperty(metadata, 'standalone'));\n const imports = metadataProperty(metadata, 'imports');\n const isModuleDeclared = standalone === undefined && !imports;\n\n if (standalone === false || isModuleDeclared) return null;\n\n if (!imports) return [];\n\n const isImportsArray = isArrayLiteralExpression(imports);\n\n if (!isImportsArray) return null;\n\n const scope: ClassLikeDeclaration[] = [];\n\n for (const element of imports.elements) {\n const classes = importedClasses(element, discovery);\n\n if (classes === null) return null;\n\n scope.push(...classes);\n }\n\n return scope;\n};\n", "import {\n SymbolFlags,\n canHaveDecorators,\n getDecorators,\n isCallExpression,\n isImportDeclaration,\n isStringLiteralLike\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Expression,\n Node,\n Symbol\n} from 'typescript';\n\nimport type { DecoratorKind, Discovery } from '../common/project-usage.type.ts';\n\nconst decoratorKinds: DecoratorKind[] = [\n 'Component',\n 'Directive',\n 'NgModule',\n 'Pipe'\n];\n\nconst isDecoratorKind = (name: string): name is DecoratorKind => {\n return decoratorKinds.some((kind) => kind === name);\n};\n\nconst isAngularCoreFile = (declaration: Declaration): boolean => {\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/core/');\n};\n\nconst parentOf = (node: Node): Node | undefined => {\n return node.parent;\n};\n\nconst importedFromAngularCore = (declaration: Declaration): boolean => {\n let current = parentOf(declaration);\n\n while (current) {\n if (isImportDeclaration(current)) {\n return (\n isStringLiteralLike(current.moduleSpecifier) &&\n current.moduleSpecifier.text === '@angular/core'\n );\n }\n\n current = parentOf(current);\n }\n\n return false;\n};\n\n/**\n * Follows an alias one hop at a time so every re-exporting file on the way\n * to the target becomes a dependency of the discovery result.\n */\nexport const resolveAlias = (symbol: Symbol, discovery: Discovery): Symbol => {\n let current = symbol;\n\n for (let hop = 0; hop < 32; hop += 1) {\n for (const declaration of current.declarations ?? []) {\n discovery.dependencies.add(declaration.getSourceFile());\n }\n\n if ((current.flags & SymbolFlags.Alias) === 0) return current;\n\n const next = discovery.checker.getImmediateAliasedSymbol(current);\n\n if (!next || next === current) return current;\n\n current = next;\n }\n\n return current;\n};\n\nexport const angularDecoratorKind = (\n expression: Expression,\n discovery: Discovery\n): DecoratorKind | null => {\n const unresolved = discovery.checker.getSymbolAtLocation(expression);\n\n if (!unresolved) return null;\n\n const symbol = resolveAlias(unresolved, discovery);\n const name = symbol.getName();\n const isKind = isDecoratorKind(name);\n\n if (!isKind) return null;\n\n const unresolvedDeclarations = unresolved.declarations ?? [];\n const symbolDeclarations = symbol.declarations ?? [];\n const isCoreImport = unresolvedDeclarations.some(importedFromAngularCore);\n const isCoreDeclaration = symbolDeclarations.some(isAngularCoreFile);\n const fromAngularCore = isCoreImport || isCoreDeclaration;\n\n if (!fromAngularCore) return null;\n\n return name;\n};\n\nexport const classDecoratorKind = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): DecoratorKind | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const kind = angularDecoratorKind(\n decorator.expression.expression,\n discovery\n );\n\n if (kind !== null) return kind;\n }\n\n return null;\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport {\n isIdentifier,\n isNumericLiteral,\n isPropertyAccessExpression,\n isPropertyAssignment,\n isStringLiteralLike\n} from 'typescript';\nimport type { Expression, ObjectLiteralExpression } from 'typescript';\n\nimport { resolveAlias } from './angular-decorator-kind.ts';\nimport type {\n AngularTemplate,\n Discovery\n} from '../common/project-usage.type.ts';\n\n/**\n * The string an expression evaluates to: a literal, or a constant whose\n * type is a single string literal (`const URL = './x.html'`, imported or\n * not). The constant's declaration file becomes a dependency.\n */\nexport const stringValue = (\n node: Expression | undefined,\n discovery: Discovery\n): string | null => {\n if (!node) return null;\n\n const isStringLiteral = isStringLiteralLike(node);\n\n if (isStringLiteral) return node.text;\n\n const isIdentifierNode = isIdentifier(node);\n const isPropertyAccessNode = isPropertyAccessExpression(node);\n\n if (isIdentifierNode || isPropertyAccessNode) {\n const symbol = discovery.checker.getSymbolAtLocation(\n isIdentifier(node) ? node : node.name\n );\n\n if (symbol) {\n resolveAlias(symbol, discovery);\n }\n }\n\n const type = discovery.checker.getTypeAtLocation(node);\n\n return type.isStringLiteral() ? type.value : null;\n};\n\nexport const metadataProperty = (\n metadata: ObjectLiteralExpression,\n name: string\n): Expression | undefined => {\n for (const property of metadata.properties) {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) continue;\n\n const isIdentifierName = isIdentifier(property.name);\n const isStringName = isStringLiteralLike(property.name);\n const isNumericName = isNumericLiteral(property.name);\n const isLiteralName = isIdentifierName || isStringName || isNumericName;\n const isPropertyNamed = isLiteralName && property.name.text === name;\n\n if (isPropertyNamed) return property.initializer;\n }\n\n return undefined;\n};\n\nexport const templateOf = (\n metadata: ObjectLiteralExpression,\n fileName: string,\n discovery: Discovery\n): AngularTemplate | null | undefined => {\n const inline = metadataProperty(metadata, 'template');\n\n if (inline) {\n const source = stringValue(inline, discovery);\n\n if (source === null) return undefined;\n\n const inlineTemplate: AngularTemplate = { kind: 'inline', source };\n\n return inlineTemplate;\n }\n\n const url = metadataProperty(metadata, 'templateUrl');\n\n if (url) {\n const text = stringValue(url, discovery);\n\n if (text === null) return undefined;\n\n const externalFileName = resolve(dirname(fileName), text);\n const externalTemplate: AngularTemplate = {\n fileName: externalFileName,\n kind: 'external'\n };\n\n return externalTemplate;\n }\n\n return null;\n};\n\nexport const exportAsOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): string[] => {\n const exportAsProperty = metadataProperty(metadata, 'exportAs');\n const exportAs = stringValue(exportAsProperty, discovery) ?? '';\n const names = exportAs.split(',').map((name) => name.trim());\n\n return names.filter(Boolean);\n};\n", "const specFilePattern = /\\.spec\\.[cm]?[tj]sx?$/u;\n\nexport const isSpecFile = (fileName: string): boolean => {\n return specFilePattern.test(fileName);\n};\n", "import type { Program, SourceFile } from 'typescript';\n\nimport { templateFileIsCurrent } from './angular/angular-template-reads.ts';\nimport type {\n CurrentSourceFiles,\n FileEntry,\n ProjectIndex,\n TemplateFileVersion\n} from './common/project-index.type.ts';\nimport { isSpecFile } from './utils/spec-file.util.ts';\n\nconst typeScriptFilePattern = /\\.(?:[cm]?ts|tsx)$/u;\n\nconst isIndexable = (program: Program, sourceFile: SourceFile): boolean => {\n if (sourceFile.isDeclarationFile) return false;\n\n const isExternal = program.isSourceFileFromExternalLibrary(sourceFile);\n\n if (isExternal) return false;\n\n const isSpec = isSpecFile(sourceFile.fileName);\n\n if (isSpec) return false;\n\n return typeScriptFilePattern.test(sourceFile.fileName);\n};\n\nexport const indexableSourceFiles = (program: Program): SourceFile[] => {\n const sourceFiles = program.getSourceFiles();\n\n return sourceFiles.filter((sourceFile) => isIndexable(program, sourceFile));\n};\n\nconst adjustCounts = <K>(\n counts: Map<K, number>,\n keys: Iterable<K>,\n delta: number\n): void => {\n for (const key of keys) {\n const current = counts.get(key) ?? 0;\n const count = current + delta;\n\n if (count > 0) {\n counts.set(key, count);\n } else {\n counts.delete(key);\n }\n }\n};\n\nexport const removeEntry = (index: ProjectIndex, fileName: string): void => {\n const entry = index.entries.get(fileName);\n\n if (!entry) return;\n\n index.entries.delete(fileName);\n adjustCounts(index.declarationCounts, entry.declarations, -1);\n adjustCounts(index.fallbackNameCounts, entry.fallbackNames, -1);\n};\n\nexport const addEntry = (index: ProjectIndex, entry: FileEntry): void => {\n removeEntry(index, entry.sourceFile.fileName);\n index.entries.set(entry.sourceFile.fileName, entry);\n adjustCounts(index.declarationCounts, entry.declarations, 1);\n adjustCounts(index.fallbackNameCounts, entry.fallbackNames, 1);\n};\n\nexport const dropEntries = (\n index: ProjectIndex,\n stale: (entry: FileEntry) => boolean\n): void => {\n for (const [fileName, entry] of index.entries) {\n const isStale = stale(entry);\n\n if (isStale) removeEntry(index, fileName);\n }\n};\n\n/** The Program's source file objects, for identity checks without path work. */\nexport const currentSourceFiles = (program: Program): CurrentSourceFiles => {\n return new Set(program.getSourceFiles());\n};\n\nexport const isReplaced = (\n sourceFile: SourceFile,\n dependencies: ReadonlySet<SourceFile>,\n current: CurrentSourceFiles\n): boolean => {\n const isCurrent = current.has(sourceFile);\n\n if (!isCurrent) return true;\n\n for (const dependency of dependencies) {\n const isDependencyCurrent = current.has(dependency);\n\n if (!isDependencyCurrent) return true;\n }\n\n return false;\n};\n\nexport const dropReplacedEntries = (\n index: ProjectIndex,\n current: CurrentSourceFiles\n): void => {\n const isEntryReplaced = (entry: FileEntry): boolean => {\n return isReplaced(entry.sourceFile, entry.dependencies, current);\n };\n\n dropEntries(index, isEntryReplaced);\n};\n\nexport const dropEntriesMentioning = (\n index: ProjectIndex,\n names: ReadonlySet<string>\n): void => {\n if (names.size === 0) return;\n\n if (index.entries.size === 0) return;\n\n const nameList = [...names];\n const mentionsName = (entry: FileEntry): boolean => {\n return nameList.some((name) => entry.mentionedNames.has(name));\n };\n\n dropEntries(index, mentionsName);\n};\n\nconst templateVersionChecker = (): ((\n version: TemplateFileVersion\n) => boolean) => {\n const checked = new Map<string, boolean>();\n\n return (version: TemplateFileVersion): boolean => {\n const key = `${version.fileName}\\0${version.mtimeNs}\\0${version.size}`;\n const known = checked.get(key);\n\n if (known !== undefined) return known;\n\n const current = templateFileIsCurrent(version);\n\n checked.set(key, current);\n\n return current;\n };\n};\n\nexport const hasStaleTemplate = (entry: FileEntry): boolean => {\n return !entry.templateVersions.every(templateFileIsCurrent);\n};\n\nexport const dropStaleTemplateEntries = (\n index: ProjectIndex,\n force: boolean\n): void => {\n const now = performance.now();\n const sinceLastCheck = now - index.templateCheckedAt;\n const isThrottled =\n !force && sinceLastCheck < index.templateCheckDuration * 100;\n\n if (isThrottled) return;\n\n const isCurrent = templateVersionChecker();\n const isStale = (entry: FileEntry): boolean => {\n return !entry.templateVersions.every(isCurrent);\n };\n\n dropEntries(index, isStale);\n\n index.templateCheckedAt = now;\n index.templateCheckDuration = performance.now() - now;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isClassLike,\n isIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { ClassLikeDeclaration, Node, SourceFile } from 'typescript';\n\nconst isDecoratedClass = (node: ClassLikeDeclaration): boolean => {\n const isDecoratable = canHaveDecorators(node);\n\n if (!isDecoratable) return false;\n\n const decorators = getDecorators(node);\n const decoratorCount = decorators?.length ?? 0;\n\n return decoratorCount > 0;\n};\n\nconst addMemberNames = (node: Node, names: Set<string>): void => {\n const isClass = isClassLike(node);\n\n if (!isClass) return;\n\n const isDecorated = isDecoratedClass(node);\n\n if (!isDecorated) return;\n\n for (const member of node.members) {\n if (!member.name) continue;\n\n const isIdentifierName = isIdentifier(member.name);\n const isStringName = isStringLiteralLike(member.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (isNamedMember) {\n names.add(member.name.text);\n }\n }\n};\n\n/** Names of members declared by decorated classes in one source file. */\nexport const collectCandidateNames = (sourceFile: SourceFile): Set<string> => {\n const names = new Set<string>();\n\n const visit = (node: Node): void => {\n addMemberNames(node, names);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return names;\n};\n", "import type { SourceFile } from 'typescript';\n\nimport { angularClasses } from './angular/angular-component-discovery.ts';\nimport {\n buildDirectiveIndex,\n directiveShape,\n replaceDeclarations\n} from './angular/angular-directive-index.ts';\nimport type {\n CurrentSourceFiles,\n FileClasses,\n LazyChecker,\n ProjectIndex\n} from './common/project-index.type.ts';\nimport { dropEntries, isReplaced, removeEntry } from './project-index-staleness.ts';\nimport { collectCandidateNames } from './typescript/typescript-candidate-names.ts';\n\nconst dropReplacedClasses = (\n index: ProjectIndex,\n current: CurrentSourceFiles\n): FileClasses[] => {\n const dropped: FileClasses[] = [];\n\n for (const [fileName, fileClasses] of index.classes) {\n const replaced = isReplaced(\n fileClasses.sourceFile,\n fileClasses.dependencies,\n current\n );\n\n if (!replaced) continue;\n\n index.classes.delete(fileName);\n dropped.push(fileClasses);\n }\n\n return dropped;\n};\n\nconst addCandidateNames = (\n index: ProjectIndex,\n candidateNames: ReadonlySet<string>,\n newNames: Set<string>\n): void => {\n for (const name of candidateNames) {\n const isKnownName = index.candidateNames.has(name);\n\n if (isKnownName) continue;\n\n index.candidateNames.add(name);\n newNames.add(name);\n }\n};\n\nconst indexFileClasses = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: LazyChecker,\n newNames: Set<string>\n): FileClasses => {\n const candidateNames = collectCandidateNames(sourceFile);\n\n addCandidateNames(index, candidateNames, newNames);\n\n const { classes, dependencies } = angularClasses(sourceFile, checker());\n const shape = directiveShape(classes);\n const fileClasses: FileClasses = {\n candidateNames,\n classes,\n dependencies,\n shape,\n sourceFile\n };\n\n index.classes.set(sourceFile.fileName, fileClasses);\n removeEntry(index, sourceFile.fileName);\n\n return fileClasses;\n};\n\nconst indexNewClasses = (\n index: ProjectIndex,\n current: SourceFile[],\n checker: LazyChecker,\n newNames: Set<string>\n): FileClasses[] => {\n const added: FileClasses[] = [];\n\n for (const sourceFile of current) {\n const isIndexed = index.classes.has(sourceFile.fileName);\n\n if (isIndexed) continue;\n\n added.push(indexFileClasses(index, sourceFile, checker, newNames));\n }\n\n return added;\n};\n\nconst rebuildDirectives = (index: ProjectIndex): void => {\n const classesValues = index.classes.values();\n const fileClasses = [...classesValues];\n const classes = fileClasses.flatMap((entry) => entry.classes);\n const shape = directiveShape(classes);\n\n index.directives = buildDirectiveIndex(classes);\n\n if (shape === index.directiveShape) return;\n\n index.directiveShape = shape;\n dropEntries(index, (entry) => entry.usedDirectiveIndex);\n};\n\nconst shapesOf = (files: FileClasses[]): string => {\n return files.map((file) => file.shape).sort().join('\\n');\n};\n\nconst repointDirectives = (\n index: ProjectIndex,\n dropped: FileClasses[],\n added: FileClasses[]\n): void => {\n const previous = dropped.flatMap((file) => file.classes);\n const next = added.flatMap((file) => file.classes);\n\n replaceDeclarations(index.directives, previous, next);\n};\n\n/** Re-index changed files' classes; returns member names never seen before. */\nexport const reconcileClasses = (\n index: ProjectIndex,\n indexable: SourceFile[],\n current: CurrentSourceFiles,\n checker: LazyChecker\n): Set<string> => {\n const newNames = new Set<string>();\n const dropped = dropReplacedClasses(index, current);\n const added = indexNewClasses(index, indexable, checker, newNames);\n const isUntouched = dropped.length === 0 && added.length === 0;\n\n if (isUntouched) return newNames;\n\n const droppedShape = shapesOf(dropped);\n const addedShape = shapesOf(added);\n const isSameShape = droppedShape === addedShape;\n\n if (isSameShape) {\n repointDirectives(index, dropped, added);\n } else {\n rebuildDirectives(index);\n }\n\n return newNames;\n};\n", "import { defineConfig } from 'eslint/config';\n\nimport { baseLimits } from './base-limits.ts';\nimport { basePractices } from './base-practices.ts';\nimport { baseRecommended } from './base-recommended.ts';\n\nexport const base = defineConfig([\n ...baseRecommended,\n ...basePractices,\n ...baseLimits\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const baseLimits = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'max-lines': [\n 'error',\n {\n max: 150,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n 'max-lines-per-function': 'off',\n complexity: ['warn', { max: 3 }],\n 'max-lines': [\n 'error',\n {\n max: 300,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n 'max-classes-per-file': 'off'\n }\n },\n {\n files: ['**/*.state.ts'],\n rules: {\n 'class-methods-use-this': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { MAX_LINE_LENGTH } from './line-length.const.ts';\n\nexport const basePractices = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'no-param-reassign': 'error',\n 'no-alert': 'error',\n 'no-console': ['warn', { allow: ['warn', 'error'] }],\n 'no-debugger': 'error',\n eqeqeq: ['error', 'always', { null: 'ignore' }],\n curly: ['error', 'multi-line'],\n 'prefer-const': ['error', { destructuring: 'all' }],\n 'no-var': 'error',\n 'object-shorthand': 'error',\n 'prefer-arrow-callback': 'error',\n 'no-useless-concat': 'error',\n 'prefer-template': 'error',\n 'no-nested-ternary': 'error',\n 'no-useless-assignment': 'error', // NEW: Catch unused assignments (ESLint v9)\n 'no-object-constructor': 'error', // Disallow new Object() without arguments\n 'no-else-return': ['error', { allowElseIf: false }], // Prefer early returns\n 'no-multi-assign': 'error', // Disallow chaining assignments\n radix: 'error', // Require radix parameter for parseInt()\n yoda: 'error', // Disallow yoda conditions (`if (\"red\" === color)`)\n complexity: ['warn', 10], // Warn if function complexity is high\n 'max-depth': ['warn', 4], // Warn on deeply nested blocks\n 'max-lines-per-function': [\n 'warn',\n { max: 50, skipBlankLines: true, skipComments: true }\n ], // Warn on long functions\n 'max-params': ['warn', 4], // Warn on functions with many parameters\n 'no-lonely-if': 'error', // Disallow if statements as the only statement in an else block\n 'grouped-accessor-pairs': ['error', 'getBeforeSet'], // Enforce consistency for getters/setters\n 'class-methods-use-this': 'error',\n 'no-underscore-dangle': 'error',\n 'max-len': [\n 'error',\n {\n code: MAX_LINE_LENGTH,\n ignoreComments: true\n }\n ],\n 'spaced-comment': [\n 2,\n 'always',\n {\n block: {\n exceptions: ['*']\n }\n }\n ],\n '@stylistic/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n prev: 'export',\n next: ['export', 'const']\n },\n {\n blankLine: 'always',\n prev: ['const', 'let', 'var'],\n next: '*'\n },\n {\n blankLine: 'any',\n prev: ['const', 'let', 'var'],\n next: ['const', 'let', 'var']\n },\n {\n blankLine: 'always',\n prev: '*',\n next: [\n 'for',\n 'if',\n 'return',\n 'throw',\n 'switch',\n 'try',\n 'class',\n 'function'\n ]\n }\n ],\n '@stylistic/comma-dangle': ['error', 'never'],\n '@stylistic/indent': [\n 'error',\n 2,\n {\n offsetTernaryExpressions: true,\n SwitchCase: 1,\n ignoredNodes: [\n 'TSTypeParameterInstantiation',\n 'FunctionExpression > .params > :matches(Decorator, :not(:first-child))'\n ]\n }\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n allowSeparatedGroups: true\n }\n ]\n }\n }\n]);\n", "export const MAX_LINE_LENGTH = 135;\n", "import { configs } from '@nx/eslint-plugin';\nimport stylistic from '@stylistic/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\n\nexport const baseRecommended = defineConfig([\n { extends: [...configs['flat/base']] },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [importPluginX.flatConfigs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [stylistic.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport boundariesPlugin from 'eslint-plugin-boundaries';\n\nexport const boundaries = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n boundaries: boundariesPlugin\n },\n settings: {\n 'boundaries/elements': [\n {\n type: 'feature',\n pattern: '**/feature/**'\n },\n {\n type: 'data-access',\n pattern: '**/data-access/**'\n },\n {\n type: 'domain-logic',\n pattern: '**/domain-logic/**'\n },\n {\n type: 'ui',\n pattern: '**/ui/**'\n },\n {\n type: 'common',\n pattern: '**/common/**'\n },\n {\n type: 'utils',\n pattern: '**/utils/**'\n }\n ],\n 'import/resolver': {\n typescript: {\n alwaysTryTypes: true\n }\n }\n },\n rules: {\n ...boundariesPlugin.configs.recommended.rules,\n 'boundaries/dependencies': [\n 'error',\n {\n default: 'disallow',\n message:\n '{{to.element.types}} is not allowed to be imported in {{from.element.types}}',\n policies: [\n {\n from: { element: { type: 'feature' } },\n allow: [\n { to: { element: { type: 'feature' } } },\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'domain-logic' } },\n allow: [\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'data-access' } },\n allow: [\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'ui' } },\n allow: [\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'utils' } },\n allow: [\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'common' } },\n allow: [{ to: { element: { type: 'common' } } }]\n }\n ]\n }\n ]\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n 'boundaries/dependencies': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxJavascript: CompatibleConfigArray = configs['flat/javascript'];\n\nexport const javascript = defineConfig({\n files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],\n extends: nxJavascript\n});\n", "import jsonPlugin from '@eslint/json';\nimport { defineConfig } from 'eslint/config';\n\nexport const json = defineConfig([\n {\n plugins: { json: jsonPlugin }\n },\n {\n files: ['**/*.json'],\n language: 'json/json',\n extends: [jsonPlugin.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport playwrightEslint from 'eslint-plugin-playwright';\n\nexport const playwright = defineConfig([\n {\n ...playwrightEslint.configs['flat/recommended'],\n files: ['**/*.e2e.ts', '**/*.e2e.js'],\n rules: {\n ...playwrightEslint.configs['flat/recommended'].rules,\n // Locator best practices\n 'playwright/prefer-locator': 'error',\n 'playwright/prefer-native-locators': 'error',\n 'playwright/no-nth-methods': 'warn',\n // Matcher improvements\n 'playwright/prefer-to-be': 'error',\n 'playwright/prefer-to-have-count': 'error',\n 'playwright/prefer-to-have-length': 'error',\n 'playwright/prefer-comparison-matcher': 'error',\n // Test structure\n 'playwright/prefer-hooks-on-top': 'error',\n 'playwright/require-top-level-describe': 'warn'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport eslintConfigPrettier from 'eslint-config-prettier';\n\nexport const prettier = defineConfig([eslintConfigPrettier]);\n", "import rxjsEslint from '@smarttools/eslint-plugin-rxjs';\nimport { defineConfig } from 'eslint/config';\n\nexport const rxjs = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n extends: [rxjsEslint.configs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n rxjs: rxjsEslint\n }\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'rxjs/prefer-observer': 'error',\n 'rxjs/finnish': 'warn',\n 'rxjs/no-ignored-subscription': 'warn',\n 'rxjs/no-ignored-error': 'warn',\n 'rxjs/no-unsafe-switchmap': 'error',\n 'rxjs/no-unsafe-takeuntil': 'error',\n 'rxjs/no-unsafe-catch': 'error',\n 'rxjs/no-unsafe-first': 'error',\n 'rxjs/no-topromise': 'error',\n 'rxjs/throw-error': 'error',\n 'rxjs/no-async-subscribe': 'off',\n 'rxjs/no-exposed-subjects': 'error', // Enforce subject encapsulation\n 'rxjs/no-cyclic-action': 'error', // Prevent infinite loops in NgRx effects\n 'rxjs/no-subscribe-handlers': 'warn' // Prefer observer objects (complements prefer-observer)\n }\n },\n {\n files: ['**/*.spec.ts', '**/*.test.ts', '**/*.spec.js', '**/*.test.js'],\n rules: {\n 'rxjs/no-ignored-subscription': 'off',\n 'rxjs/no-subscribe-handlers': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport storybookEslint from 'eslint-plugin-storybook';\n\nexport const storybook = defineConfig([\n {\n ignores: ['!.storybook'],\n files: ['**/*.stories.ts'],\n extends: [storybookEslint.configs['flat/recommended']],\n rules: {\n 'storybook/csf-component': 'warn', // Ensure component property is set\n 'storybook/no-stories-of': 'error' // Prevent deprecated storiesOf API\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { typescriptConsistency } from './typescript-consistency.ts';\nimport { typescriptImports } from './typescript-imports.ts';\nimport { typescriptOverrides } from './typescript-overrides.ts';\nimport { typescriptRecommended } from './typescript-recommended.ts';\nimport { typescriptSafety } from './typescript-safety.ts';\n\nexport const typescript = defineConfig([\n ...typescriptRecommended,\n ...typescriptSafety,\n ...typescriptConsistency,\n ...typescriptImports,\n ...typescriptOverrides\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptConsistency = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': [\n 'error',\n { assertionStyle: 'never' }\n ],\n '@typescript-eslint/consistent-type-definitions': ['error', 'type'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n { prefer: 'type-imports', fixStyle: 'separate-type-imports' }\n ],\n '@typescript-eslint/naming-convention': [\n 'error',\n {\n selector: ['objectLiteralProperty', 'objectLiteralMethod'],\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'objectLiteralMethod',\n format: ['camelCase', 'PascalCase']\n },\n {\n selector: 'objectLiteralProperty',\n format: ['camelCase', 'snake_case', 'PascalCase']\n },\n {\n selector: 'parameter',\n format: ['camelCase'],\n leadingUnderscore: 'allow'\n },\n { selector: 'default', format: ['camelCase'] },\n { selector: 'variable', format: ['camelCase', 'UPPER_CASE'] },\n { selector: 'function', format: ['camelCase'] },\n { selector: 'typeLike', format: ['PascalCase'] },\n {\n selector: 'property',\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'property',\n format: ['camelCase', 'PascalCase', 'snake_case']\n }\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';\n\nconst pathGroups = [\n { pattern: '@angular/**', group: 'builtin', position: 'before' },\n { pattern: '@nestjs/**', group: 'builtin', position: 'before' },\n { pattern: '@shared/**', group: 'internal', position: 'before' },\n { pattern: '@backend/**', group: 'internal', position: 'before' },\n { pattern: '@frontend/**', group: 'internal', position: 'before' },\n { pattern: '@*/shared/**', group: 'internal', position: 'before' },\n { pattern: '@*/frontend/**', group: 'internal', position: 'after' },\n { pattern: '@*/backend/**', group: 'internal', position: 'after' }\n];\n\nexport const typescriptImports = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n 'import-x/order': [\n 'error',\n {\n groups: [\n 'builtin',\n 'external',\n 'internal',\n ['parent', 'sibling'],\n 'index',\n 'unknown'\n ],\n pathGroups,\n pathGroupsExcludedImportTypes: ['builtin'],\n 'newlines-between': 'always',\n alphabetize: { order: 'asc', caseInsensitive: true }\n }\n ],\n // TypeScript already checks these four; import-x would re-parse every import with a parser resolved by name, which fails under pnpm.\n 'import-x/namespace': 'off',\n 'import-x/default': 'off',\n 'import-x/no-named-as-default': 'off',\n 'import-x/no-named-as-default-member': 'off',\n 'import-x/no-unresolved': 'error',\n 'import-x/no-duplicates': 'error',\n 'import-x/prefer-default-export': 'off',\n 'import-x/no-useless-path-segments': ['error', { noUselessIndex: true }],\n 'import-x/newline-after-import': 'error',\n 'import-x/first': 'error',\n 'import-x/no-mutable-exports': 'error',\n 'import-x/no-self-import': 'error',\n 'import-x/no-cycle': ['error', { maxDepth: 2, ignoreExternal: true }],\n 'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],\n 'import-x/no-anonymous-default-export': 'error'\n },\n settings: {\n 'import-x/resolver-next': [\n createTypeScriptImportResolver({\n alwaysTryTypes: true\n })\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptOverrides = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n rules: {\n '@typescript-eslint/prefer-readonly': 'error'\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n '@typescript-eslint/no-namespace': 'off',\n '@typescript-eslint/no-extraneous-class': 'off'\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/unbound-method': 'off',\n '@typescript-eslint/consistent-type-assertions': 'off'\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': 'off',\n '@typescript-eslint/naming-convention': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxTypescript: CompatibleConfigArray = configs['flat/typescript'];\n\nexport const typescriptRecommended = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n extends: [importPluginX.flatConfigs.typescript, ...nxTypescript]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { MAX_LINE_LENGTH } from './line-length.const.ts';\nimport { localPlugin } from './typescript-local-plugin.ts';\n\nexport const typescriptSafety = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n plugins: { local: localPlugin },\n rules: {\n // Expression arrow whose body wraps gets a block body. Fixes.\n // Bad: (x) => a && b on two lines Good: (x) => { return a && b; }\n 'local/arrow-body-fits-line': 'error',\n // Two or more calls in one chain stay on one line.\n // Bad: a .b() .c() over three lines Good: const b = a.b(); b.c();\n 'local/chain-fits-line': 'error',\n // A member chain starts on a name, never on an inline expression.\n // Bad: (a ?? b).c Good: const ab = a ?? b; ab.c\n 'local/chain-receiver-is-name': 'error',\n // Every class member states public, private, or protected. Fixes.\n // Bad: field = 1; Good: private field = 1;\n 'local/explicit-accessibility': 'error',\n // An if condition holds at most 3 operands joined by && or ||.\n // Bad: if (a && b && c && d) Good: const isAll = a && b && c && d;\n 'local/max-condition-operands': 'error',\n // No call inside an if; type predicates and this.x() reads are exempt.\n // Bad: if (validate(o)) Good: const isValid = validate(o); if (isValid)\n 'local/no-call-in-condition': 'error',\n // No parenthesised group with a different operator inside an if.\n // Bad: if (a && (b || c)) Good: const isBOrC = b || c; if (a && isBOrC)\n 'local/no-grouped-condition': 'error',\n // An object type literal appears only as the body of a type alias.\n // Bad: (f: { a: string }) Good: type F = { a: string }; (f: F)\n 'local/no-inline-object-types': 'error',\n // Never return an object literal inline; name it first.\n // Bad: return { a: 1 }; Good: const result = { a: 1 }; return result;\n 'local/no-inline-return-object': 'error',\n // A nested object, array of objects, ternary, or chain as a value gets a\n // name.\n // Bad: { a: { b: 1 } } Good: const a = { b: 1 }; { a }\n 'local/no-nested-object-value': 'error',\n // Spread only a name or a member access.\n // Bad: f(...getArgs()) Good: const args = getArgs(); f(...args)\n 'local/no-spread-expression': 'error',\n // An export no file in the program imports is dead; entry points exempt.\n // Bad: export const unused = 1; Good: delete it, or import it\n 'local/no-unused-exports': 'error',\n // A lone return/throw/continue/break guard drops braces when it fits.\n // Bad: braced three-line if (x) { return; } Good: if (x) return;\n 'local/one-line-guard': ['error', { maxLineLength: MAX_LINE_LENGTH }],\n // Type properties are readonly; arrays stay T[], never readonly T[].\n // Fixes.\n // Bad: { id: string; items: readonly T[] }\n // Good: { readonly id: string; readonly items: T[] }\n 'local/readonly-type-properties': 'error',\n // A ternary branch is a name, literal, or plain member access.\n // Bad: c ? foo() : b Good: const called = foo(); c ? called : b\n 'local/ternary-branch-shape': 'error',\n // No spec-support, helpers, or __mocks__ files; stubs, mocks, and\n // spec utils live under test/; stubs are UPPER_SNAKE_STUB: Type.\n // Bad: user.spec-helper.ts, common/stubs/user.stub.ts\n // Good: test/utils/user.spec.util.ts, test/stubs USER_STUB: User\n 'local/test-file-shape': 'error',\n // Exported types live in common/*.type.ts; type-only imports come from\n // there.\n // Bad: export type Order in order.ts\n // Good: export type Order in common/order.type.ts\n 'local/type-placement': 'error',\n // utils/*.util.ts hold pure code: no fs, process, Date.now, module-level\n // let or Map. Files under test/ or testing/ are exempt.\n // Bad: const cache = new Map(); at module level\n // Good: pass the state in as an argument\n 'local/util-purity': 'error',\n '@typescript-eslint/explicit-function-return-type': 'error',\n '@typescript-eslint/parameter-properties': 'error',\n 'no-restricted-syntax': [\n 'error',\n {\n selector: 'TSEnumDeclaration[declare!=true]',\n message:\n 'enum is not erasable syntax; use a union of literals or an as-const object.'\n },\n {\n selector: 'TSModuleDeclaration[kind=\"namespace\"][declare!=true]',\n message: 'namespace is not erasable syntax; use a module.'\n }\n ],\n '@typescript-eslint/no-empty-function': 'error',\n '@typescript-eslint/no-unused-vars': 'error',\n '@typescript-eslint/no-use-before-define': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n '@typescript-eslint/no-unsafe-assignment': 'error',\n '@typescript-eslint/no-unsafe-call': 'error',\n '@typescript-eslint/no-unsafe-member-access': 'error',\n '@typescript-eslint/no-unsafe-return': 'error',\n '@typescript-eslint/no-unsafe-argument': 'error',\n '@typescript-eslint/no-empty-object-type': 'error',\n '@typescript-eslint/no-unsafe-function-type': 'error',\n '@typescript-eslint/no-wrapper-object-types': 'error',\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-non-null-assertion': 'error',\n '@typescript-eslint/prefer-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-optional-chain': 'error',\n '@typescript-eslint/no-floating-promises': [\n 'error',\n { ignoreVoid: true }\n ],\n '@typescript-eslint/no-misused-promises': 'warn',\n '@typescript-eslint/promise-function-async': 'error',\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-inferrable-types': 'warn',\n '@typescript-eslint/no-require-imports': 'error',\n '@typescript-eslint/only-throw-error': 'error',\n '@typescript-eslint/no-array-delete': 'error',\n '@typescript-eslint/return-await': ['error', 'in-try-catch'],\n '@typescript-eslint/require-await': 'error',\n '@typescript-eslint/restrict-template-expressions': [\n 'error',\n { allowNumber: true, allowBoolean: true }\n ],\n '@typescript-eslint/restrict-plus-operands': 'error',\n '@typescript-eslint/prefer-as-const': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/switch-exhaustiveness-check': 'error',\n '@typescript-eslint/no-unused-expressions': [\n 'error',\n { allowShortCircuit: true, allowTernary: true }\n ],\n '@typescript-eslint/no-useless-constructor': 'error',\n '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],\n '@typescript-eslint/no-unnecessary-condition': 'error',\n '@typescript-eslint/no-confusing-void-expression': [\n 'error',\n { ignoreArrowShorthand: true, ignoreVoidOperator: true }\n ],\n '@typescript-eslint/no-dynamic-delete': 'error',\n '@typescript-eslint/no-extraneous-class': [\n 'error',\n { allowWithDecorator: true }\n ],\n '@typescript-eslint/no-invalid-void-type': 'error',\n '@typescript-eslint/unified-signatures': 'error',\n '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-find': 'error',\n '@typescript-eslint/prefer-for-of': 'error',\n '@typescript-eslint/prefer-includes': 'error',\n '@typescript-eslint/prefer-string-starts-ends-with': 'error',\n '@typescript-eslint/prefer-regexp-exec': 'error'\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n // Class actions carry their payload as constructor parameter properties.\n '@typescript-eslint/parameter-properties': 'off'\n }\n }\n]);\n", "import { ASTUtils, ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { JSONSchema, TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'arrowBodyWrapped';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require an expression-bodied arrow function to fit on one line'\n};\n\nconst messages: Record<MessageIds, string> = {\n arrowBodyWrapped:\n 'Expression body of this arrow function spans multiple lines; wrap it in a block with an explicit return.'\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n schema,\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#arrow-body-fits-line'\n);\n\nconst isMultiLine = (body: TSESTree.Expression): boolean =>\n body.loc.start.line !== body.loc.end.line;\n\nconst arrowIndent = (\n node: TSESTree.ArrowFunctionExpressionWithExpressionBody,\n sourceCode: TSESLint.SourceCode\n): string => {\n const line = sourceCode.lines[node.loc.start.line - 1] ?? '';\n const leadingWhitespace = /^\\s*/u.exec(line);\n\n return leadingWhitespace ? leadingWhitespace[0] : '';\n};\n\nconst wrappedBody = (indent: string, bodyText: string): string => {\n const innerIndent = `${indent} `;\n\n return `{\\n${innerIndent}return ${bodyText};\\n${indent}}`;\n};\n\nconst replacementRange = (\n node: TSESTree.ArrowFunctionExpressionWithExpressionBody,\n sourceCode: TSESLint.SourceCode\n): Readonly<TSESTree.Range> => {\n const isParenthesized = ASTUtils.isParenthesized(node.body, sourceCode);\n\n if (!isParenthesized) return node.body.range;\n\n const openParen = sourceCode.getTokenBefore(node.body);\n const closeParen = sourceCode.getTokenAfter(node.body);\n\n if (!openParen || !closeParen) return node.body.range;\n\n return [openParen.range[0], closeParen.range[1]];\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'arrow-body-fits-line',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n 'ArrowFunctionExpression[expression=true]'(\n node: TSESTree.ArrowFunctionExpressionWithExpressionBody\n ): void {\n const isObjectBody =\n node.body.type === TSESTree.AST_NODE_TYPES.ObjectExpression;\n\n if (isObjectBody) return;\n\n const isMultiLineBody = isMultiLine(node.body);\n\n if (!isMultiLineBody) return;\n\n const indent = arrowIndent(node, sourceCode);\n const bodyText = sourceCode.getText(node.body);\n const range = replacementRange(node, sourceCode);\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceTextRange(range, wrappedBody(indent, bodyText));\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'arrowBodyWrapped',\n fix\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'chainWrapped';\ntype MemberCallCallee = { readonly callee: TSESTree.MemberExpression };\ntype MemberCall = MemberCallCallee & TSESTree.CallExpression;\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require every call in a member call chain to keep its property on the same line'\n};\n\nconst messages: Record<MessageIds, string> = {\n chainWrapped:\n 'Call chain is wrapped across lines; keep every call on the same line or name intermediate steps.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#chain-fits-line'\n);\n\nconst isMemberCall = (node: TSESTree.Node): node is MemberCall => {\n if (node.type !== TSESTree.AST_NODE_TYPES.CallExpression) return false;\n\n return node.callee.type === TSESTree.AST_NODE_TYPES.MemberExpression;\n};\n\nconst spinePropertyLines = (node: MemberCall): number[] => {\n const lines = [node.callee.property.loc.start.line];\n let current: TSESTree.Node = node.callee.object;\n\n for (;;) {\n if (isMemberCall(current)) {\n lines.push(current.callee.property.loc.start.line);\n current = current.callee.object;\n continue;\n }\n\n if (current.type === TSESTree.AST_NODE_TYPES.MemberExpression) {\n current = current.object;\n continue;\n }\n\n break;\n }\n\n return lines;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'chain-fits-line',\n meta,\n defaultOptions: [],\n create(context) {\n const listeners: TSESLint.RuleListener = {\n CallExpression(node): void {\n if (!isMemberCall(node)) return;\n\n const isOutermost =\n node.parent.type !== TSESTree.AST_NODE_TYPES.MemberExpression;\n\n if (!isOutermost) return;\n\n const lines = spinePropertyLines(node);\n\n if (lines.length < 2) return;\n\n const isWrapped = new Set(lines).size > 1;\n\n if (!isWrapped) return;\n\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'chainWrapped'\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { indentOf } from '../utils/indent-of.util.ts';\n\ntype Options = [];\ntype MessageIds = 'chainReceiver' | 'extractReceiver';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require a call chain to start from a name, not an inline expression'\n};\n\nconst messages: Record<MessageIds, string> = {\n chainReceiver:\n 'Call chain starts from an inline expression; extract it to a named constant first.',\n extractReceiver: \"Extract the receiver to a 'value' constant.\"\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n hasSuggestions: true,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#chain-receiver-is-name'\n);\n\nconst UNNAMED_RECEIVER_TYPES = new Set([\n TSESTree.AST_NODE_TYPES.LogicalExpression,\n TSESTree.AST_NODE_TYPES.ConditionalExpression,\n TSESTree.AST_NODE_TYPES.ObjectExpression,\n TSESTree.AST_NODE_TYPES.ArrayExpression,\n TSESTree.AST_NODE_TYPES.AwaitExpression,\n TSESTree.AST_NODE_TYPES.BinaryExpression,\n TSESTree.AST_NODE_TYPES.TemplateLiteral\n]);\n\ntype NonRootNode = Exclude<TSESTree.Node, TSESTree.Program>;\n\nconst enclosingStatement = (node: NonRootNode): NonRootNode => {\n let current = node;\n\n while (\n current.parent.type !== TSESTree.AST_NODE_TYPES.BlockStatement &&\n current.parent.type !== TSESTree.AST_NODE_TYPES.Program\n ) {\n current = current.parent;\n }\n\n return current;\n};\n\nconst suggestionOf = (\n node: TSESTree.MemberExpression,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const statement = enclosingStatement(node);\n const indent = indentOf(statement, sourceCode);\n const objectText = sourceCode.getText(node.object);\n const declaration = `const value = ${objectText};\\n${indent}`;\n const fix: TSESLint.ReportFixFunction = (fixer) => {\n const hoisted = fixer.insertTextBefore(statement, declaration);\n const replaced = fixer.replaceText(node.object, 'value');\n const fixes = [hoisted, replaced];\n\n return fixes;\n };\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'extractReceiver',\n fix\n };\n\n return suggestion;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'chain-receiver-is-name',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n MemberExpression(node): void {\n const isUnnamedReceiver = UNNAMED_RECEIVER_TYPES.has(node.object.type);\n\n if (!isUnnamedReceiver) return;\n\n const suggest = [suggestionOf(node, sourceCode)];\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'chainReceiver',\n suggest\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import type { TSESLint, TSESTree } from '@typescript-eslint/utils';\n\nexport const indentOf = (\n node: TSESTree.Node,\n sourceCode: TSESLint.SourceCode\n): string => {\n const line = sourceCode.lines[node.loc.start.line - 1] ?? '';\n const [leading] = /^[ \\t]*/.exec(line) ?? [''];\n\n return leading;\n};\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n accessibilities,\n defaultOptions,\n meta\n} from './common/explicit-accessibility.const.ts';\nimport type {\n Accessibility,\n AutoFix,\n Fix,\n FixAccessibility,\n Member,\n MessageIds,\n Options\n} from './common/explicit-accessibility.type.ts';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#explicit-accessibility'\n);\n\nconst isPrivateMember = (node: Member): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.TSParameterProperty) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.PrivateIdentifier;\n};\n\nconst isConstructor = (node: Member): boolean => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.kind === 'constructor';\n};\n\nconst reportTarget = (node: Member): TSESTree.Node => {\n if (node.type !== TSESTree.AST_NODE_TYPES.TSParameterProperty) {\n return node.key;\n }\n\n const { parameter } = node;\n\n if (parameter.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parameter.left;\n }\n\n return parameter;\n};\n\nconst memberName = (\n target: TSESTree.Node,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (target.type === TSESTree.AST_NODE_TYPES.Identifier) return target.name;\n\n return sourceCode.getText(target);\n};\n\nconst modifierToken = (\n node: Member,\n sourceCode: TSESLint.SourceCode\n): TSESTree.Token | null => {\n const lastDecorator = node.decorators.at(-1);\n\n if (!lastDecorator) return sourceCode.getFirstToken(node);\n\n return sourceCode.getTokenAfter(lastDecorator);\n};\n\nconst insertModifier = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): Fix => {\n const token = modifierToken(node, sourceCode);\n\n if (!token) return () => null;\n\n const lastDecorator = node.decorators.at(-1);\n const adjacentToDecorator = lastDecorator?.range[1] === token.range[0];\n const text = `${adjacentToDecorator ? ' ' : ''}${accessibility} `;\n\n return (fixer) => fixer.insertTextBefore(token, text);\n};\n\nconst autoFixOf = (\n node: Member,\n accessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): AutoFix => {\n if (accessibility === 'none') {\n const noAutoFix: AutoFix = {};\n\n return noAutoFix;\n }\n\n const fix = insertModifier(node, accessibility, sourceCode);\n const autoFix: AutoFix = { fix };\n\n return autoFix;\n};\n\nconst suggestionOf = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const data = { accessibility };\n const fix = insertModifier(node, accessibility, sourceCode);\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'setAccessibility',\n data,\n fix\n };\n\n return suggestion;\n};\n\nconst suggestionsOf = (\n node: Member,\n fixAccessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds>[] => {\n const isOtherAccessibility = (accessibility: Accessibility): boolean => {\n return accessibility !== fixAccessibility;\n };\n\n const suggestionFor = (\n accessibility: Accessibility\n ): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n return suggestionOf(node, accessibility, sourceCode);\n };\n\n return accessibilities.filter(isOtherAccessibility).map(suggestionFor);\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'explicit-accessibility',\n meta,\n defaultOptions,\n create(context, [{ defaultAccessibility = 'public' }]) {\n const { sourceCode } = context;\n\n const check = (node: Member): void => {\n const isPrivate = isPrivateMember(node);\n\n if (node.accessibility || isPrivate) return;\n\n const target = reportTarget(node);\n const isConstructorMember = isConstructor(node);\n const usesPublic = isConstructorMember && defaultAccessibility !== 'none';\n const fixAccessibility: FixAccessibility = usesPublic\n ? 'public'\n : defaultAccessibility;\n const autoFix = autoFixOf(node, fixAccessibility, sourceCode);\n const name = memberName(target, sourceCode);\n const data = { name };\n const suggest = suggestionsOf(node, fixAccessibility, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: target,\n messageId: 'missingAccessibility',\n data,\n ...autoFix,\n suggest\n };\n\n context.report(report);\n };\n\n const listeners: TSESLint.RuleListener = {\n AccessorProperty: check,\n MethodDefinition: check,\n PropertyDefinition: check,\n TSAbstractAccessorProperty: check,\n TSAbstractMethodDefinition: check,\n TSAbstractPropertyDefinition: check,\n TSParameterProperty: check\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type {\n Accessibility,\n MessageIds,\n Options\n} from './explicit-accessibility.type.ts';\n\nexport const accessibilities: Accessibility[] = [\n 'public',\n 'private',\n 'protected'\n];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description: 'Require explicit accessibility modifiers on class members'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingAccessibility:\n \"Class member '{{ name }}' is missing an explicit accessibility modifier (public/private/protected).\",\n setAccessibility: \"Add the '{{ accessibility }}' modifier.\"\n};\n\nconst defaultAccessibilitySchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['public', 'private', 'protected', 'none'],\n description:\n \"The accessibility modifier inserted by the auto-fix; constructors always get public. 'none' reports without an auto-fix and offers all three levels as suggestions.\"\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n defaultAccessibility: defaultAccessibilitySchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n hasSuggestions: true,\n schema,\n messages\n};\n\nexport const defaultOptions: Options = [{ defaultAccessibility: 'public' }];\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { JSONSchema, TSESLint } from '@typescript-eslint/utils';\n\ntype MaxConditionOperandsOptions = { readonly max: number };\ntype Options = [MaxConditionOperandsOptions];\ntype MessageIds = 'tooManyOperands';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Limit the number of operands in an if statement condition to keep it readable'\n};\n\nconst messages: Record<MessageIds, string> = {\n tooManyOperands:\n 'This condition has {{ count }} operands; extract it into a named const when it exceeds {{ max }}.'\n};\n\nconst maxSchema: JSONSchema.JSONSchema4 = { type: 'integer', minimum: 1 };\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n max: maxSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n schema,\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#max-condition-operands'\n);\n\nconst countOperands = (node: TSESTree.Expression): number => {\n if (node.type !== TSESTree.AST_NODE_TYPES.LogicalExpression) return 1;\n\n return countOperands(node.left) + countOperands(node.right);\n};\n\nconst defaultOptions: Options = [{ max: 3 }];\n\nexport default createRule<Options, MessageIds>({\n name: 'max-condition-operands',\n meta,\n defaultOptions,\n create(context, [{ max }]) {\n const listeners: TSESLint.RuleListener = {\n IfStatement(node): void {\n const count = countOperands(node.test);\n\n if (count <= max) return;\n\n const data = { count, max };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: node.test,\n messageId: 'tooManyOperands',\n data\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type {\n ParserServicesWithTypeInformation,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport {\n PREDICATE_PATTERNS,\n defaultOptions,\n meta\n} from './common/no-call-in-condition.const.ts';\nimport type {\n CallExemptions,\n MessageIds,\n Options,\n RuleContext\n} from './common/no-call-in-condition.type.ts';\nimport { isExemptCall } from './utils/call-exemptions.util.ts';\nimport {\n calleeName,\n conditionParts,\n constFeed\n} from './utils/condition-calls.util.ts';\nimport { toRegExp } from '../utils/to-regexp.util.ts';\n\ntype HoistTarget = TSESTree.IfStatement | TSESTree.VariableDeclaration;\ntype Suggestions = TSESLint.SuggestionReportDescriptor<MessageIds>[];\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-call-in-condition'\n);\n\nconst HOISTABLE_PARENTS = new Set([\n TSESTree.AST_NODE_TYPES.BlockStatement,\n TSESTree.AST_NODE_TYPES.Program,\n TSESTree.AST_NODE_TYPES.StaticBlock,\n TSESTree.AST_NODE_TYPES.SwitchCase,\n TSESTree.AST_NODE_TYPES.TSModuleBlock\n]);\n\nconst INDENT_PATTERN = /^[\\t ]*/u;\n\nconst typedServices = (\n context: RuleContext\n): ParserServicesWithTypeInformation | undefined => {\n const { parserServices } = context.sourceCode;\n\n if (!parserServices?.program) return undefined;\n\n return ESLintUtils.getParserServices(context);\n};\n\nconst statementIndent = (\n statement: HoistTarget,\n sourceCode: TSESLint.SourceCode\n): string => {\n const line = sourceCode.lines[statement.loc.start.line - 1] ?? '';\n const indent = INDENT_PATTERN.exec(line)?.[0];\n\n return indent ?? '';\n};\n\nconst suggestionsOf = (\n call: TSESTree.CallExpression,\n statement: HoistTarget,\n sourceCode: TSESLint.SourceCode\n): Suggestions => {\n const empty: Suggestions = [];\n const isHoistable = HOISTABLE_PARENTS.has(statement.parent.type);\n\n if (!isHoistable) return empty;\n\n const name = calleeName(call.callee);\n\n if (name === undefined) return empty;\n\n const constName = `${name}Result`;\n const callText = sourceCode.getText(call);\n const indent = statementIndent(statement, sourceCode);\n const declaration = `const ${constName} = ${callText};\\n${indent}`;\n const fix: TSESLint.ReportFixFunction = (fixer) => {\n const hoisted = fixer.insertTextBefore(statement, declaration);\n const replaced = fixer.replaceText(call, constName);\n const fixes = [hoisted, replaced];\n\n return fixes;\n };\n const data = { name: constName };\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'hoistCall',\n data,\n fix\n };\n const suggestions: Suggestions = [suggestion];\n\n return suggestions;\n};\n\nconst reportOf = (\n call: TSESTree.CallExpression,\n statement: HoistTarget,\n sourceCode: TSESLint.SourceCode\n): TSESLint.ReportDescriptor<MessageIds> => {\n const suggest = suggestionsOf(call, statement, sourceCode);\n const callee = sourceCode.getText(call.callee);\n const data = { callee };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: call,\n messageId: 'callInCondition',\n data,\n suggest\n };\n\n return report;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-call-in-condition',\n meta,\n defaultOptions,\n create(context, [{ allowPredicates = PREDICATE_PATTERNS }]) {\n const { sourceCode } = context;\n const services = typedServices(context);\n const allowed = allowPredicates.map(toRegExp);\n const reported = new Set<TSESTree.CallExpression>();\n\n const reportCalls = (\n calls: TSESTree.CallExpression[],\n statement: HoistTarget,\n exemptions: CallExemptions\n ): void => {\n for (const call of calls) {\n const isReported = reported.has(call);\n\n if (isReported) continue;\n\n const isExempt = isExemptCall(call, exemptions);\n\n if (isExempt) continue;\n\n reported.add(call);\n\n const report = reportOf(call, statement, sourceCode);\n\n context.report(report);\n }\n };\n\n const listeners: TSESLint.RuleListener = {\n IfStatement(node): void {\n const { calls, identifiers } = conditionParts(node.test);\n const isEmpty = calls.length === 0 && identifiers.length === 0;\n\n if (isEmpty) return;\n\n const scope = sourceCode.getScope(node);\n const exemptions: CallExemptions = { allowed, scope, services };\n\n reportCalls(calls, node, exemptions);\n\n for (const identifier of identifiers) {\n const feed = constFeed(identifier, scope);\n\n if (feed) {\n const fed = conditionParts(feed.init);\n\n reportCalls(fed.calls, feed.statement, exemptions);\n }\n }\n }\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type {\n MessageIds,\n Options,\n RuleOptions\n} from './no-call-in-condition.type.ts';\n\nexport const PREDICATE_PATTERNS: string[] = ['^(is|has)[A-Z]'];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow a function call inside an if condition or a boolean const that feeds one'\n};\n\nconst messages: Record<MessageIds, string> = {\n callInCondition:\n \"Call '{{ callee }}' decides inside a condition; assign it to a named const first.\",\n hoistCall: \"Assign the call to '{{ name }}' above the statement.\"\n};\n\nconst patternSchema: JSONSchema.JSONSchema4 = { type: 'string' };\n\nconst allowPredicatesSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: patternSchema,\n description:\n 'Regular expression sources for callee names treated as type predicates when no TypeScript program is available.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n allowPredicates: allowPredicatesSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'suggestion',\n docs,\n hasSuggestions: true,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = {\n allowPredicates: PREDICATE_PATTERNS\n};\n\nexport const defaultOptions: Options = [ruleDefaults];\n", "import { ASTUtils, TSESTree } from '@typescript-eslint/utils';\nimport type {\n ParserServicesWithTypeInformation,\n TSESLint\n} from '@typescript-eslint/utils';\nimport type { Signature } from 'typescript';\n\nimport { calleeName } from './condition-calls.util.ts';\nimport type { CallExemptions } from '../common/no-call-in-condition.type.ts';\n\nconst PREDICATE_HOLDERS = [\n TSESTree.AST_NODE_TYPES.ArrowFunctionExpression,\n TSESTree.AST_NODE_TYPES.FunctionDeclaration,\n TSESTree.AST_NODE_TYPES.FunctionExpression,\n TSESTree.AST_NODE_TYPES.TSDeclareFunction\n] as const;\n\nconst isPredicateHolder = ASTUtils.isNodeOfTypes(PREDICATE_HOLDERS);\n\nconst hasPredicateReturn = (node: TSESTree.Node): boolean => {\n if (!isPredicateHolder(node)) return false;\n\n const returned = node.returnType?.typeAnnotation.type;\n\n return returned === TSESTree.AST_NODE_TYPES.TSTypePredicate;\n};\n\nconst declaredFunction = (\n definition: TSESLint.Scope.Definition\n): TSESTree.Node | undefined => {\n const { node } = definition;\n\n if (node.type !== TSESTree.AST_NODE_TYPES.VariableDeclarator) return node;\n\n return node.init ?? undefined;\n};\n\nconst isThisSignalRead = (call: TSESTree.CallExpression): boolean => {\n if (call.arguments.length > 0) return false;\n\n const { callee } = call;\n\n if (callee.type !== TSESTree.AST_NODE_TYPES.MemberExpression) return false;\n\n if (callee.computed) return false;\n\n return callee.object.type === TSESTree.AST_NODE_TYPES.ThisExpression;\n};\n\nconst isScopePredicate = (\n callee: TSESTree.Node,\n scope: TSESLint.Scope.Scope\n): boolean => {\n if (callee.type !== TSESTree.AST_NODE_TYPES.Identifier) return false;\n\n const variable = ASTUtils.findVariable(scope, callee);\n const definition = variable?.defs.at(0);\n\n if (!definition) return false;\n\n const declaration = declaredFunction(definition);\n\n if (!declaration) return false;\n\n return hasPredicateReturn(declaration);\n};\n\nconst isCheckerPredicate = (\n callee: TSESTree.Expression,\n services: ParserServicesWithTypeInformation\n): boolean => {\n const checker = services.program.getTypeChecker();\n const calleeType = services.getTypeAtLocation(callee);\n const signatures = calleeType.getCallSignatures();\n const isPredicateSignature = (signature: Signature): boolean => {\n const predicate = checker.getTypePredicateOfSignature(signature);\n\n return predicate !== undefined;\n };\n\n return signatures.some(isPredicateSignature);\n};\n\nconst isAllowedName = (\n callee: TSESTree.Expression,\n allowed: RegExp[]\n): boolean => {\n const name = calleeName(callee);\n\n if (name === undefined) return false;\n\n return allowed.some((pattern) => pattern.test(name));\n};\n\nexport const isExemptCall = (\n call: TSESTree.CallExpression,\n exemptions: CallExemptions\n): boolean => {\n const isSignalRead = isThisSignalRead(call);\n\n if (isSignalRead) return true;\n\n const { allowed, scope, services } = exemptions;\n const { callee } = call;\n const isDeclaredPredicate = isScopePredicate(callee, scope);\n\n if (isDeclaredPredicate) return true;\n\n if (services) return isCheckerPredicate(callee, services);\n\n return isAllowedName(callee, allowed);\n};\n", "import { ASTUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n ConditionParts,\n ConstFeed\n} from '../common/no-call-in-condition.type.ts';\n\nconst collectParts = (node: TSESTree.Node, parts: ConditionParts): void => {\n if (node.type === TSESTree.AST_NODE_TYPES.CallExpression) {\n parts.calls.push(node);\n\n return;\n }\n\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) {\n parts.identifiers.push(node);\n\n return;\n }\n\n if (node.type === TSESTree.AST_NODE_TYPES.UnaryExpression) {\n collectParts(node.argument, parts);\n\n return;\n }\n\n const isLogical = node.type === TSESTree.AST_NODE_TYPES.LogicalExpression;\n const isBinary = node.type === TSESTree.AST_NODE_TYPES.BinaryExpression;\n\n if (!isLogical && !isBinary) return;\n\n collectParts(node.left, parts);\n collectParts(node.right, parts);\n};\n\nexport const conditionParts = (node: TSESTree.Node): ConditionParts => {\n const parts: ConditionParts = { calls: [], identifiers: [] };\n\n collectParts(node, parts);\n\n return parts;\n};\n\nexport const calleeName = (callee: TSESTree.Node): string | undefined => {\n if (callee.type === TSESTree.AST_NODE_TYPES.Identifier) return callee.name;\n\n if (callee.type !== TSESTree.AST_NODE_TYPES.MemberExpression) {\n return undefined;\n }\n\n const { property } = callee;\n\n if (property.type !== TSESTree.AST_NODE_TYPES.Identifier) return undefined;\n\n return property.name;\n};\n\nexport const constFeed = (\n identifier: TSESTree.Identifier,\n scope: TSESLint.Scope.Scope\n): ConstFeed | undefined => {\n const variable = ASTUtils.findVariable(scope, identifier);\n\n if (variable?.defs.length !== 1) return undefined;\n\n const definition = variable.defs.at(0);\n\n if (!definition) return undefined;\n\n const declaration = definition.parent;\n\n if (declaration?.type !== TSESTree.AST_NODE_TYPES.VariableDeclaration) {\n return undefined;\n }\n\n if (declaration.kind !== 'const') return undefined;\n\n const { node } = definition;\n\n if (node.type !== TSESTree.AST_NODE_TYPES.VariableDeclarator) {\n return undefined;\n }\n\n const { init } = node;\n\n if (!init) return undefined;\n\n if (init.type === TSESTree.AST_NODE_TYPES.CallExpression) return undefined;\n\n const feed: ConstFeed = { init, statement: declaration };\n\n return feed;\n};\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'groupedCondition' | 'hoistGroup';\n\ntype ReportRoot = { readonly statement: TSESTree.Statement };\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require a mixed-operator group inside a logical condition to be hoisted into a named const'\n};\n\nconst messages: Record<MessageIds, string> = {\n groupedCondition:\n 'This group mixes a different operator than its enclosing condition; hoist it into a named const.',\n hoistGroup: 'Extract the group into a named const.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n hasSuggestions: true,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-grouped-condition'\n);\n\nconst GROUP_NAME = 'isGroup';\n\nconst outermostLogical = (\n node: TSESTree.LogicalExpression\n): TSESTree.LogicalExpression => {\n let current = node;\n\n while (current.parent.type === TSESTree.AST_NODE_TYPES.LogicalExpression) {\n current = current.parent;\n }\n\n return current;\n};\n\nconst reportRootOf = (\n node: TSESTree.LogicalExpression\n): ReportRoot | undefined => {\n const outermost = outermostLogical(node);\n const { parent } = outermost;\n\n if (parent.type === TSESTree.AST_NODE_TYPES.IfStatement) {\n if (parent.test !== outermost) return undefined;\n\n const reportRoot: ReportRoot = { statement: parent };\n\n return reportRoot;\n }\n\n if (parent.type !== TSESTree.AST_NODE_TYPES.VariableDeclarator) {\n return undefined;\n }\n\n const isConstInit = parent.init === outermost && parent.parent.kind === 'const';\n\n if (!isConstInit) return undefined;\n\n const reportRoot: ReportRoot = { statement: parent.parent };\n\n return reportRoot;\n};\n\nconst suggestionFor = (\n node: TSESTree.LogicalExpression,\n statement: TSESTree.Statement,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const groupText = sourceCode.getText(node);\n const line = sourceCode.lines[statement.loc.start.line - 1] ?? '';\n const indent = line.slice(0, statement.loc.start.column);\n const declaration = `const ${GROUP_NAME} = ${groupText};\\n${indent}`;\n const fix: TSESLint.ReportFixFunction = (fixer) => {\n const hoisted = fixer.insertTextBefore(statement, declaration);\n const replaced = fixer.replaceText(node, GROUP_NAME);\n const fixes = [hoisted, replaced];\n\n return fixes;\n };\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'hoistGroup',\n fix\n };\n\n return suggestion;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-grouped-condition',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n 'LogicalExpression > LogicalExpression'(\n node: TSESTree.LogicalExpression\n ): void {\n const { parent } = node;\n\n if (parent.type !== TSESTree.AST_NODE_TYPES.LogicalExpression) return;\n\n const hasSameOperator = node.operator === parent.operator;\n\n if (hasSameOperator) return;\n\n const reportRoot = reportRootOf(node);\n\n if (!reportRoot) return;\n\n const suggestion = suggestionFor(\n node,\n reportRoot.statement,\n sourceCode\n );\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'groupedCondition',\n suggest: [suggestion]\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'inlineObjectType';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require every object type literal to be the body of a named type alias'\n};\n\nconst messages: Record<MessageIds, string> = {\n inlineObjectType:\n 'Object type literal must be the body of a named type alias.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-inline-object-types'\n);\n\nexport default createRule<Options, MessageIds>({\n name: 'no-inline-object-types',\n meta,\n defaultOptions: [],\n create(context) {\n const listeners: TSESLint.RuleListener = {\n TSTypeLiteral(node): void {\n const isAliasBody =\n node.parent.type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration;\n\n if (isAliasBody) return;\n\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'inlineObjectType'\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { indentOf } from '../utils/indent-of.util.ts';\n\ntype Options = [];\ntype MessageIds = 'inlineReturnObject';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require an inline returned object literal to be named as a constant first'\n};\n\nconst messages: Record<MessageIds, string> = {\n inlineReturnObject:\n 'Object literal is returned inline; name it as a constant first.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n hasSuggestions: true,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-inline-return-object'\n);\n\nconst wrappingRange = (\n objectExpression: TSESTree.ObjectExpression,\n sourceCode: TSESLint.SourceCode\n): Readonly<[number, number]> => {\n const before = sourceCode.getTokenBefore(objectExpression);\n const after = sourceCode.getTokenAfter(objectExpression);\n const isWrapped = before?.value === '(' && after?.value === ')';\n\n if (!isWrapped) return objectExpression.range;\n\n return [before.range[0], after.range[1]];\n};\n\nconst returnSuggestion = (\n node: TSESTree.ReturnStatement,\n objectExpression: TSESTree.ObjectExpression,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const indent = indentOf(node, sourceCode);\n const objectText = sourceCode.getText(objectExpression);\n const fix: TSESLint.ReportFixFunction = (fixer) => {\n const declaration = fixer.insertTextBefore(\n node,\n `const result = ${objectText};\\n\\n${indent}`\n );\n const replaced = fixer.replaceText(objectExpression, 'result');\n const fixes = [declaration, replaced];\n\n return fixes;\n };\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'inlineReturnObject',\n fix\n };\n\n return suggestion;\n};\n\nconst arrowSuggestion = (\n node: TSESTree.ArrowFunctionExpression,\n objectExpression: TSESTree.ObjectExpression,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const indent = indentOf(node, sourceCode);\n const bodyIndent = `${indent} `;\n const objectText = sourceCode.getText(objectExpression);\n const replacement = `{\\n${bodyIndent}const result = ${objectText};\\n\\n${bodyIndent}return result;\\n${indent}}`;\n const range = wrappingRange(objectExpression, sourceCode);\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceTextRange(range, replacement);\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'inlineReturnObject',\n fix\n };\n\n return suggestion;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-inline-return-object',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n ReturnStatement(node): void {\n if (node.argument?.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) {\n return;\n }\n\n const objectExpression = node.argument;\n const suggest = [returnSuggestion(node, objectExpression, sourceCode)];\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'inlineReturnObject',\n suggest\n };\n\n context.report(report);\n },\n ArrowFunctionExpression(node): void {\n if (!node.expression) return;\n\n if (node.body.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return;\n\n const objectExpression = node.body;\n const suggest = [arrowSuggestion(node, objectExpression, sourceCode)];\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'inlineReturnObject',\n suggest\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport type { GlobMatcher } from '../common/glob-matcher.type.ts';\nimport { compileGlobs } from '../utils/glob-matcher.util.ts';\nimport { defaultOptions, meta } from './common/no-nested-object-value.const.ts';\nimport type {\n MessageIds,\n Options\n} from './common/no-nested-object-value.type.ts';\nimport { isInsideDecoratorConfig } from './utils/decorator-config.util.ts';\nimport { enclosingStatement } from '../utils/enclosing-statement.util.ts';\nimport { indentOf } from '../utils/indent-of.util.ts';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-nested-object-value'\n);\n\nconst isChainedCall = (node: TSESTree.CallExpression): boolean => {\n const { callee } = node;\n\n if (callee.type !== TSESTree.AST_NODE_TYPES.MemberExpression) return false;\n\n return callee.object.type === TSESTree.AST_NODE_TYPES.CallExpression;\n};\n\nconst isObjectElement = (\n element: TSESTree.ArrayExpression['elements'][number]\n): boolean => {\n return element?.type === TSESTree.AST_NODE_TYPES.ObjectExpression;\n};\n\nconst hasNestedObjectElement = (node: TSESTree.ArrayExpression): boolean => {\n return node.elements.some(isObjectElement);\n};\n\nconst isNestedValue = (value: TSESTree.Property['value']): boolean => {\n if (value.type === TSESTree.AST_NODE_TYPES.ObjectExpression) {\n return value.properties.length > 0;\n }\n\n if (value.type === TSESTree.AST_NODE_TYPES.ArrayExpression) {\n return hasNestedObjectElement(value);\n }\n\n if (value.type === TSESTree.AST_NODE_TYPES.ConditionalExpression) return true;\n\n if (value.type === TSESTree.AST_NODE_TYPES.CallExpression) {\n return isChainedCall(value);\n }\n\n return false;\n};\n\nconst CONFIG_FILE_MATCHERS = new WeakMap<string[], GlobMatcher>();\n\nconst configFileMatcher = (configFiles: string[]): GlobMatcher => {\n const cached = CONFIG_FILE_MATCHERS.get(configFiles);\n\n if (cached) return cached;\n\n const matcher = compileGlobs(configFiles);\n\n CONFIG_FILE_MATCHERS.set(configFiles, matcher);\n\n return matcher;\n};\n\nconst isConfigFile = (filename: string, configFiles: string[]): boolean => {\n const matchesConfig = configFileMatcher(configFiles);\n\n return matchesConfig(filename);\n};\n\nconst suggestionsFor = (\n property: TSESTree.Property,\n key: string,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds>[] => {\n const empty: TSESLint.SuggestionReportDescriptor<MessageIds>[] = [];\n const isNamedKey =\n property.key.type === TSESTree.AST_NODE_TYPES.Identifier &&\n !property.computed;\n\n if (!isNamedKey) return empty;\n\n const statement = enclosingStatement(property);\n const indent = indentOf(statement, sourceCode);\n const valueText = sourceCode.getText(property.value);\n const fix: TSESLint.ReportFixFunction = (fixer) => {\n const declaration = fixer.insertTextBefore(\n statement,\n `const ${key} = ${valueText};\\n${indent}`\n );\n const replaced = fixer.replaceText(property.value, key);\n const fixes = [declaration, replaced];\n\n return fixes;\n };\n const data = { key };\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'nestedValue',\n data,\n fix\n };\n\n const suggestions: TSESLint.SuggestionReportDescriptor<MessageIds>[] = [\n suggestion\n ];\n\n return suggestions;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-nested-object-value',\n meta,\n defaultOptions,\n create(context, [{ configFiles }]) {\n const isExemptFile = isConfigFile(context.filename, configFiles);\n\n if (isExemptFile) {\n const noListeners: TSESLint.RuleListener = {};\n\n return noListeners;\n }\n\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n Property(node): void {\n if (node.parent.type !== TSESTree.AST_NODE_TYPES.ObjectExpression)\n return;\n\n const isNested = isNestedValue(node.value);\n\n if (!isNested) return;\n\n const ancestors = sourceCode.getAncestors(node.parent);\n const isDecoratorConfig = isInsideDecoratorConfig(\n node.parent,\n ancestors\n );\n\n if (isDecoratorConfig) return;\n\n const key = sourceCode.getText(node.key);\n const suggest = suggestionsFor(node, key, sourceCode);\n const data = { key };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'nestedValue',\n data,\n suggest\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import type { GlobMatcher } from '../common/glob-matcher.type.ts';\n\nconst GLOB_TOKEN = /\\*\\*\\/|\\*\\*|\\*|\\?|\\{[^}]*\\}|[^*?{]+/gu;\nconst REGEXP_ESCAPE = /[.*+?^${}()|[\\]\\\\]/gu;\n\nconst escapeLiteral = (value: string): string =>\n value.replaceAll(REGEXP_ESCAPE, '\\\\$&');\n\nconst braceAlternatives = (token: string): string => {\n const inner = token.slice(1, -1);\n const alternatives = inner.split(',').map(escapeLiteral);\n\n return `(?:${alternatives.join('|')})`;\n};\n\nconst translateToken = (token: string): string => {\n if (token === '**/') return '(?:.*/)?';\n\n if (token === '**') return '.*';\n\n if (token === '*') return '[^/]*';\n\n if (token === '?') return '[^/]';\n\n const startsWithBrace = token.startsWith('{');\n const endsWithBrace = token.endsWith('}');\n\n if (startsWithBrace && endsWithBrace) return braceAlternatives(token);\n\n return escapeLiteral(token);\n};\n\nconst globSource = (pattern: string): string => {\n const tokens = pattern.match(GLOB_TOKEN) ?? [];\n\n return tokens.map(translateToken).join('');\n};\n\nconst ALL_DEPTH_PREFIX = '**/';\nconst ALL_DEPTH_GROUP = '(?:.*/)?';\n\nconst stripAllDepthPrefix = (pattern: string): string => {\n const hasPrefix = pattern.startsWith(ALL_DEPTH_PREFIX);\n\n if (!hasPrefix) return pattern;\n\n return pattern.slice(ALL_DEPTH_PREFIX.length);\n};\n\nconst sharesAllDepthPrefix = (patterns: string[]): boolean =>\n patterns.every((pattern) => pattern.startsWith(ALL_DEPTH_PREFIX));\n\nconst combinedSource = (patterns: string[]): string => {\n const hoistPrefix = sharesAllDepthPrefix(patterns);\n\n if (!hoistPrefix) {\n const sources = patterns.map(globSource);\n\n return `(?:${sources.join('|')})`;\n }\n\n const bodies = patterns.map(stripAllDepthPrefix);\n const sources = bodies.map(globSource);\n\n return `${ALL_DEPTH_GROUP}(?:${sources.join('|')})`;\n};\n\nexport const compileGlobs = (patterns: string[]): GlobMatcher => {\n const source = combinedSource(patterns);\n const combined = new RegExp(`^${source}$`, 'u');\n const matchPath = (path: string): boolean => {\n const normalised = path.replaceAll('\\\\', '/');\n\n return combined.test(normalised);\n };\n\n return matchPath;\n};\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type { MessageIds, Options } from './no-nested-object-value.type.ts';\n\nconst DEFAULT_CONFIG_FILES: string[] = [\n '**/*.config.{ts,js,mjs,cjs}',\n '**/eslint.config.*',\n '**/*.schema.ts'\n];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require a nested object literal, array of objects, conditional, or chained call used as a property value to be named as a constant first'\n};\n\nconst messages: Record<MessageIds, string> = {\n nestedValue:\n \"Property '{{ key }}' holds a nested value inline; name it as a constant first.\"\n};\n\nconst configFilesItemsSchema: JSONSchema.JSONSchema4 = { type: 'string' };\n\nconst configFilesSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: configFilesItemsSchema\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n configFiles: configFilesSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'suggestion',\n docs,\n hasSuggestions: true,\n schema,\n messages\n};\n\nexport const defaultOptions: Options = [{ configFiles: DEFAULT_CONFIG_FILES }];\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nconst MAX_DECORATOR_OBJECT_HOPS = 3;\n\nconst isDecoratorArgument = (node: TSESTree.ObjectExpression): boolean => {\n const { parent } = node;\n\n if (parent.type !== TSESTree.AST_NODE_TYPES.CallExpression) return false;\n\n const { parent: grandparent } = parent;\n\n return grandparent.type === TSESTree.AST_NODE_TYPES.Decorator;\n};\n\nexport const isInsideDecoratorConfig = (\n objectExpression: TSESTree.ObjectExpression,\n ancestors: TSESTree.Node[]\n): boolean => {\n let objectHops = 0;\n const isDecoratorConfig = isDecoratorArgument(objectExpression);\n\n if (isDecoratorConfig) return true;\n\n for (let index = ancestors.length - 1; index >= 0; index -= 1) {\n const ancestor = ancestors[index];\n\n if (ancestor?.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) continue;\n\n objectHops += 1;\n\n const isAncestorDecoratorConfig = isDecoratorArgument(ancestor);\n\n if (isAncestorDecoratorConfig) return true;\n\n if (objectHops >= MAX_DECORATOR_OBJECT_HOPS) return false;\n }\n\n return false;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\ntype BodyContainer =\n TSESTree.BlockStatement | TSESTree.Program | TSESTree.StaticBlock;\n\nconst isBodyContainer = (node: TSESTree.Node): node is BodyContainer => {\n return (\n node.type === TSESTree.AST_NODE_TYPES.Program ||\n node.type === TSESTree.AST_NODE_TYPES.BlockStatement ||\n node.type === TSESTree.AST_NODE_TYPES.StaticBlock\n );\n};\n\nexport const enclosingStatement = (node: TSESTree.Node): TSESTree.Node => {\n let current = node;\n\n for (;;) {\n const { parent } = current;\n\n if (!parent || isBodyContainer(parent)) return current;\n\n current = parent;\n }\n};\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { enclosingStatement } from '../utils/enclosing-statement.util.ts';\nimport { indentOf } from '../utils/indent-of.util.ts';\n\ntype Options = [];\ntype MessageIds = 'spreadExpression';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require a spread argument to be an identifier or member access, not an inline expression'\n};\n\nconst messages: Record<MessageIds, string> = {\n spreadExpression:\n 'Spread argument is an inline expression; name it as a constant first.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n hasSuggestions: true,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-spread-expression'\n);\n\nconst ALLOWED_ARGUMENT_TYPES = new Set([\n TSESTree.AST_NODE_TYPES.Identifier,\n TSESTree.AST_NODE_TYPES.MemberExpression\n]);\n\nexport default createRule<Options, MessageIds>({\n name: 'no-spread-expression',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n SpreadElement(node): void {\n const isAllowed = ALLOWED_ARGUMENT_TYPES.has(node.argument.type);\n\n if (isAllowed) return;\n\n const statement = enclosingStatement(node);\n const indent = indentOf(statement, sourceCode);\n const argumentText = sourceCode.getText(node.argument);\n const fix: TSESLint.ReportFixFunction = (fixer) => {\n const declaration = fixer.insertTextBefore(\n statement,\n `const spread = ${argumentText};\\n${indent}`\n );\n const replaced = fixer.replaceText(node.argument, 'spread');\n const fixes = [declaration, replaced];\n\n return fixes;\n };\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'spreadExpression',\n fix\n };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'spreadExpression',\n suggest: [suggestion]\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils } from '@typescript-eslint/utils';\nimport type {\n ParserServicesWithTypeInformation,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type { GlobMatcher } from '../common/glob-matcher.type.ts';\nimport { compileGlobs } from '../utils/glob-matcher.util.ts';\nimport { defaultOptions, meta } from './common/no-unused-exports.const.ts';\nimport type {\n MessageIds,\n Options,\n RuleContext\n} from './common/no-unused-exports.type.ts';\nimport { reportUnusedExports } from './report-unused-exports.ts';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-unused-exports'\n);\n\nconst typedParserServices = (\n context: RuleContext\n): ParserServicesWithTypeInformation | undefined => {\n try {\n const services = ESLintUtils.getParserServices(context, true);\n\n if (!services.program) return undefined;\n\n return services;\n } catch {\n return undefined;\n }\n};\n\nconst ENTRY_POINT_MATCHERS = new WeakMap<string[], GlobMatcher>();\n\nconst entryPointMatcher = (entryPoints: string[]): GlobMatcher => {\n const cached = ENTRY_POINT_MATCHERS.get(entryPoints);\n\n if (cached) return cached;\n\n const matcher = compileGlobs(entryPoints);\n\n ENTRY_POINT_MATCHERS.set(entryPoints, matcher);\n\n return matcher;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-unused-exports',\n meta,\n defaultOptions,\n create(context, [{ entryPoints }]): TSESLint.RuleListener {\n const noListeners: TSESLint.RuleListener = {};\n const isEntry = entryPointMatcher(entryPoints);\n const isEntryFile = isEntry(context.filename);\n\n if (isEntryFile) return noListeners;\n\n const services = typedParserServices(context);\n\n if (!services) return noListeners;\n\n const listeners: TSESLint.RuleListener = {\n Program(node): void {\n reportUnusedExports({ context, isEntry, node, services });\n }\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type {\n MessageIds,\n Options,\n RuleOptions\n} from './no-unused-exports.type.ts';\n\n// eslint-disable-next-line local/no-unused-exports -- read by eslint.config.ts\nexport const entryPointDefaults: string[] = [\n '**/main.ts',\n '**/main.*.ts',\n '**/public-api.ts',\n '**/index.ts',\n '**/*.config.ts',\n '**/*.config.mts',\n '**/*.config.cts',\n '**/*.spec.ts',\n '**/*.spec.util.ts',\n '**/*.stub.ts',\n '**/*.mock.ts',\n '**/*.d.ts',\n '**/*.stories.ts',\n '**/environment*.ts'\n];\n\nexport const STAR_NAME = '*';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow exports that no other file in the TypeScript program imports'\n};\n\nconst messages: Record<MessageIds, string> = {\n unusedExport: \"Export '{{ name }}' is never imported by another file.\",\n unusedModule: 'This module exports names but is never imported.'\n};\n\nconst entryPointItemsSchema: JSONSchema.JSONSchema4 = { type: 'string' };\n\nconst entryPointsSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: entryPointItemsSchema,\n description: 'Globs whose files are treated as project entry points.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n entryPoints: entryPointsSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = { entryPoints: [...entryPointDefaults] };\n\nexport const defaultOptions: Options = [ruleDefaults];\n", "import { dirname } from 'node:path';\n\nimport type { Program, SourceFile, TypeChecker } from 'typescript';\n\nimport type {\n Aggregate,\n FileEdges,\n IsExternalFile,\n PublicExports,\n UsageContext\n} from './common/no-unused-exports.type.ts';\nimport {\n buildAggregate,\n updateAggregate\n} from './utils/aggregate-update.util.ts';\nimport { fileChanges, isIncremental } from './utils/file-changes.util.ts';\nimport { moduleEdges } from './utils/module-edges.util.ts';\nimport { publicExports } from './utils/public-exports.util.ts';\nimport type { GlobMatcher } from '../common/glob-matcher.type.ts';\n\nconst FILE_EDGES = new WeakMap<SourceFile, FileEdges>();\n\nconst AGGREGATES = new WeakMap<Program, Aggregate>();\n\nconst PUBLIC = new WeakMap<Aggregate, WeakMap<GlobMatcher, PublicExports>>();\n\nconst LAST_AGGREGATE = new Map<string, Aggregate>();\n\nconst projectKey = (program: Program): string => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n if (typeof configFilePath === 'string') return configFilePath;\n\n const directories = program.getRootFileNames().map(dirname);\n const uniqueDirectorySet = new Set(directories);\n const uniqueDirectories = [...uniqueDirectorySet];\n const sortedDirectories = uniqueDirectories.sort();\n\n return sortedDirectories.join('|');\n};\n\nconst fileEdges = (\n sourceFile: SourceFile,\n checker: TypeChecker,\n isExternal: IsExternalFile\n): FileEdges => {\n const cached = FILE_EDGES.get(sourceFile);\n\n if (cached) return cached;\n\n const edges = moduleEdges(sourceFile, checker, isExternal);\n\n FILE_EDGES.set(sourceFile, edges);\n\n return edges;\n};\n\nconst programEdges = (program: Program): Map<string, FileEdges> => {\n const checker = program.getTypeChecker();\n const isExternal: IsExternalFile = (sourceFile) =>\n program.isSourceFileFromExternalLibrary(sourceFile);\n const byFile = new Map<string, FileEdges>();\n\n for (const sourceFile of program.getSourceFiles()) {\n if (sourceFile.isDeclarationFile) continue;\n\n const isSourceExternal = isExternal(sourceFile);\n\n if (isSourceExternal) continue;\n\n byFile.set(sourceFile.fileName, fileEdges(sourceFile, checker, isExternal));\n }\n\n return byFile;\n};\n\nconst nextAggregate = (\n byFile: Map<string, FileEdges>,\n previous: Aggregate | undefined\n): Aggregate => {\n if (!previous) return buildAggregate(byFile);\n\n const changes = fileChanges(previous.byFile, byFile);\n const isPatchable = isIncremental(changes, previous.starTouched);\n\n if (!isPatchable) return buildAggregate(byFile);\n\n updateAggregate(previous, changes);\n PUBLIC.delete(previous);\n\n return previous;\n};\n\nexport const exportIndex = (program: Program): Aggregate => {\n const cached = AGGREGATES.get(program);\n\n if (cached) return cached;\n\n const key = projectKey(program);\n const byFile = programEdges(program);\n const aggregate = nextAggregate(byFile, LAST_AGGREGATE.get(key));\n\n AGGREGATES.set(program, aggregate);\n LAST_AGGREGATE.set(key, aggregate);\n\n return aggregate;\n};\n\nexport const publicExportIndex = (\n aggregate: Aggregate,\n isEntry: GlobMatcher\n): PublicExports => {\n const byMatcher =\n PUBLIC.get(aggregate) ?? new WeakMap<GlobMatcher, PublicExports>();\n const cached = byMatcher.get(isEntry);\n\n if (cached) return cached;\n\n const keys = aggregate.byFile.keys();\n const fileNames = [...keys];\n const entryFiles = fileNames.filter(isEntry);\n const context: UsageContext = {\n byFile: aggregate.byFile,\n reExportsByName: aggregate.reExportsByName\n };\n const index = publicExports(context, entryFiles);\n\n byMatcher.set(isEntry, index);\n PUBLIC.set(aggregate, byMatcher);\n\n return index;\n};\n", "import { STAR_NAME } from '../common/no-unused-exports.const.ts';\nimport type {\n ReExportEdge,\n ReExportIndex,\n UsageContext,\n UsageKey,\n UsageWalk\n} from '../common/no-unused-exports.type.ts';\n\nconst MAX_DEPTH = 50;\n\nexport const reExportIndex = (\n byFile: UsageContext['byFile']\n): ReExportIndex => {\n const index: ReExportIndex = new Map();\n\n for (const [fileName, edges] of byFile) {\n const names = new Map<string, ReExportEdge>();\n\n for (const edge of edges.reExports) {\n names.set(edge.exported, edge);\n }\n\n index.set(fileName, names);\n }\n\n return index;\n};\n\nconst push = (walk: UsageWalk, fileName: string, name: string): void => {\n const key: UsageKey = { fileName, name };\n\n walk.keys.push(key);\n};\n\nconst deeper = (walk: UsageWalk): UsageWalk => {\n const next: UsageWalk = {\n visited: walk.visited,\n depth: walk.depth + 1,\n keys: walk.keys\n };\n\n return next;\n};\n\nconst isNewStep = (walk: UsageWalk, key: string): boolean => {\n if (walk.depth > MAX_DEPTH) return false;\n\n const isVisited = walk.visited.has(key);\n\n if (isVisited) return false;\n\n walk.visited.add(key);\n\n return true;\n};\n\nconst markName = (\n context: UsageContext,\n fileName: string,\n name: string,\n walk: UsageWalk\n): void => {\n const isNew = isNewStep(walk, `${fileName} ${name}`);\n\n if (!isNew) return;\n\n const edges = context.byFile.get(fileName);\n\n if (!edges) return;\n\n push(walk, fileName, name);\n\n const reExport = context.reExportsByName.get(fileName)?.get(name);\n\n if (reExport) {\n markName(context, reExport.target, reExport.source, deeper(walk));\n }\n\n const isDeclaredLocally = edges.declared.has(name);\n\n if (isDeclaredLocally) return;\n\n for (const target of edges.starTargets) {\n markName(context, target, name, deeper(walk));\n }\n};\n\nconst markAll = (\n context: UsageContext,\n fileName: string,\n walk: UsageWalk\n): void => {\n const isNew = isNewStep(walk, `${fileName} ${STAR_NAME}`);\n\n if (!isNew) return;\n\n const edges = context.byFile.get(fileName);\n\n if (!edges) return;\n\n for (const name of edges.exports) {\n push(walk, fileName, name);\n }\n\n for (const edge of edges.reExports) {\n markName(context, edge.target, edge.source, deeper(walk));\n }\n\n for (const target of edges.starTargets) {\n markAll(context, target, deeper(walk));\n }\n};\n\nexport const markUsage = (\n context: UsageContext,\n target: string,\n name: string\n): UsageKey[] => {\n const keys: UsageKey[] = [];\n const walk: UsageWalk = { visited: new Set(), depth: 0, keys };\n\n if (name === STAR_NAME) {\n markAll(context, target, walk);\n\n return keys;\n }\n\n markName(context, target, name, walk);\n\n return keys;\n};\n", "import { markUsage, reExportIndex } from './export-usage.util.ts';\nimport { STAR_NAME } from '../common/no-unused-exports.const.ts';\nimport type {\n Aggregate,\n ExportUsage,\n FileChange,\n FileContribution,\n FileEdges,\n UsageContext,\n UsageKey\n} from '../common/no-unused-exports.type.ts';\n\nconst countDelta = (\n counts: Map<string, number>,\n key: string,\n delta: number\n): void => {\n const current = counts.get(key);\n const next = (current ?? 0) + delta;\n\n if (next > 0) {\n counts.set(key, next);\n\n return;\n }\n\n counts.delete(key);\n};\n\nconst usageDelta = (\n usage: ExportUsage,\n key: UsageKey,\n delta: number\n): void => {\n const existing = usage.get(key.fileName);\n const names = existing ?? new Map<string, number>();\n const current = names.get(key.name);\n const next = (current ?? 0) + delta;\n\n if (next > 0) names.set(key.name, next);\n else names.delete(key.name);\n\n if (names.size > 0) usage.set(key.fileName, names);\n else usage.delete(key.fileName);\n};\n\nconst fileContribution = (\n context: UsageContext,\n edges: FileEdges\n): FileContribution => {\n const usage: UsageKey[] = [];\n const imported: string[] = [];\n const starTouched: string[] = [];\n\n for (const edge of edges.imports) {\n imported.push(edge.target);\n\n for (const name of edge.names) {\n if (name === STAR_NAME) starTouched.push(edge.target);\n\n const keys = markUsage(context, edge.target, name);\n\n for (const key of keys) usage.push(key);\n }\n }\n\n for (const edge of edges.reExports) {\n imported.push(edge.target);\n starTouched.push(edge.target);\n }\n\n for (const target of edges.starTargets) {\n imported.push(target);\n starTouched.push(target);\n }\n\n const contribution: FileContribution = { usage, imported, starTouched };\n\n return contribution;\n};\n\nconst applyContribution = (\n aggregate: Aggregate,\n contribution: FileContribution,\n delta: number\n): void => {\n for (const key of contribution.usage) {\n usageDelta(aggregate.usage, key, delta);\n }\n\n for (const target of contribution.imported) {\n countDelta(aggregate.imported, target, delta);\n }\n\n for (const target of contribution.starTouched) {\n countDelta(aggregate.starTouched, target, delta);\n }\n};\n\nconst contextOf = (aggregate: Aggregate): UsageContext => {\n const context: UsageContext = {\n byFile: aggregate.byFile,\n reExportsByName: aggregate.reExportsByName\n };\n\n return context;\n};\n\nconst addFile = (aggregate: Aggregate, edges: FileEdges): void => {\n const context = contextOf(aggregate);\n const contribution = fileContribution(context, edges);\n\n aggregate.contributions.set(edges.fileName, contribution);\n applyContribution(aggregate, contribution, 1);\n};\n\nexport const buildAggregate = (byFile: Map<string, FileEdges>): Aggregate => {\n const aggregate: Aggregate = {\n byFile,\n usage: new Map(),\n imported: new Map(),\n reExportsByName: reExportIndex(byFile),\n contributions: new Map(),\n starTouched: new Map()\n };\n\n for (const edges of byFile.values()) {\n addFile(aggregate, edges);\n }\n\n return aggregate;\n};\n\nconst dropFile = (aggregate: Aggregate, fileName: string): void => {\n const contribution = aggregate.contributions.get(fileName);\n\n if (!contribution) return;\n\n applyContribution(aggregate, contribution, -1);\n aggregate.contributions.delete(fileName);\n};\n\nconst replaceEdges = (aggregate: Aggregate, change: FileChange): void => {\n if (!change.after) {\n aggregate.byFile.delete(change.fileName);\n aggregate.reExportsByName.delete(change.fileName);\n\n return;\n }\n\n aggregate.byFile.set(change.fileName, change.after);\n aggregate.reExportsByName.set(change.fileName, new Map());\n};\n\nexport const updateAggregate = (\n aggregate: Aggregate,\n changes: FileChange[]\n): void => {\n for (const change of changes) {\n dropFile(aggregate, change.fileName);\n replaceEdges(aggregate, change);\n }\n\n for (const change of changes) {\n if (change.after) addFile(aggregate, change.after);\n }\n};\n", "import type {\n FileChange,\n FileEdges\n} from '../common/no-unused-exports.type.ts';\n\nexport const fileChanges = (\n before: Map<string, FileEdges>,\n after: Map<string, FileEdges>\n): FileChange[] => {\n const changes: FileChange[] = [];\n\n for (const [fileName, edges] of after) {\n const previous = before.get(fileName);\n\n if (previous === edges) continue;\n\n const change: FileChange = { fileName, before: previous, after: edges };\n\n changes.push(change);\n }\n\n for (const [fileName, edges] of before) {\n const isKept = after.has(fileName);\n\n if (isKept) continue;\n\n const change: FileChange = { fileName, before: edges, after: undefined };\n\n changes.push(change);\n }\n\n return changes;\n};\n\nconst isBarrel = (edges: FileEdges | undefined): boolean => {\n if (!edges) return false;\n\n const hasStarTargets = edges.starTargets.length > 0;\n\n return edges.reExports.length > 0 || hasStarTargets;\n};\n\nconst hasSameExports = (change: FileChange): boolean => {\n const before = change.before?.exports ?? [];\n const after = change.after?.exports ?? [];\n\n if (before.length !== after.length) return false;\n\n return before.every((name, index) => name === after[index]);\n};\n\nexport const isIncremental = (\n changes: FileChange[],\n starTouched: Map<string, number>\n): boolean => {\n for (const change of changes) {\n const wasBarrel = isBarrel(change.before);\n const isNowBarrel = isBarrel(change.after);\n const touchesBarrel = wasBarrel || isNowBarrel;\n\n if (touchesBarrel) return false;\n\n const isStarTouched = starTouched.has(change.fileName);\n\n if (!isStarTouched) continue;\n\n const sameExports = hasSameExports(change);\n\n if (!sameExports) return false;\n }\n\n return true;\n};\n", "import {\n SyntaxKind,\n forEachChild,\n isCallExpression,\n isExportAssignment,\n isExportDeclaration,\n isImportDeclaration,\n isModuleDeclaration,\n isNamespaceImport\n} from 'typescript';\nimport type {\n ImportClause,\n ImportDeclaration,\n Node,\n SourceFile,\n Statement,\n TypeChecker\n} from 'typescript';\n\nimport { addExportFrom, addLocalExport } from './export-edges.util.ts';\nimport { exportedNames } from './exported-names.util.ts';\nimport { moduleTarget } from './module-target.util.ts';\nimport type {\n EdgeAccumulator,\n FileEdges,\n ImportEdge,\n IsExternalFile,\n ModuleResolver\n} from '../common/no-unused-exports.type.ts';\n\nconst importNames = (clause: ImportClause | undefined): string[] => {\n if (!clause) return [];\n\n const names: string[] = [];\n\n if (clause.name) names.push('default');\n\n const bindings = clause.namedBindings;\n\n if (!bindings) return names;\n\n if (isNamespaceImport(bindings)) {\n names.push('*');\n\n return names;\n }\n\n for (const element of bindings.elements) {\n const origin = element.propertyName ?? element.name;\n\n names.push(origin.text);\n }\n\n return names;\n};\n\nconst addImport = (\n statement: ImportDeclaration,\n edges: EdgeAccumulator,\n resolve: ModuleResolver\n): void => {\n const target = resolve(statement.moduleSpecifier);\n\n if (target === undefined) return;\n\n const names = importNames(statement.importClause);\n const edge: ImportEdge = { target, names };\n\n edges.imports.push(edge);\n};\n\nconst DYNAMIC_IMPORT_TEXT = 'import(';\n\nconst dynamicImportTarget = (\n node: Node,\n resolve: ModuleResolver\n): string | undefined => {\n if (!isCallExpression(node)) return undefined;\n\n const isDynamicImport = node.expression.kind === SyntaxKind.ImportKeyword;\n\n if (!isDynamicImport) return undefined;\n\n return resolve(node.arguments[0]);\n};\n\nconst collectDynamicImports = (\n node: Node,\n resolve: ModuleResolver,\n targets: string[]\n): void => {\n const target = dynamicImportTarget(node, resolve);\n\n if (target !== undefined) targets.push(target);\n\n forEachChild(node, (child) => {\n collectDynamicImports(child, resolve, targets);\n });\n};\n\nconst addDynamicImports = (\n sourceFile: SourceFile,\n edges: EdgeAccumulator,\n resolve: ModuleResolver\n): void => {\n const hasDynamicImport = sourceFile.text.includes(DYNAMIC_IMPORT_TEXT);\n\n if (!hasDynamicImport) return;\n\n const targets: string[] = [];\n\n collectDynamicImports(sourceFile, resolve, targets);\n\n for (const target of targets) {\n const edge: ImportEdge = { target, names: ['*'] };\n\n edges.imports.push(edge);\n }\n};\n\nconst addDefaultExport = (edges: EdgeAccumulator): void => {\n edges.exports.push('default');\n edges.declared.add('default');\n};\n\nconst addDeclaredExports = (\n statement: Statement,\n edges: EdgeAccumulator\n): void => {\n for (const name of exportedNames(statement)) {\n edges.exports.push(name);\n edges.declared.add(name);\n }\n};\n\nconst emptyEdges = (): EdgeAccumulator => {\n const edges: EdgeAccumulator = {\n exports: [],\n declared: new Set(),\n imports: [],\n reExports: [],\n starTargets: []\n };\n\n return edges;\n};\n\nexport const moduleEdges = (\n sourceFile: SourceFile,\n checker: TypeChecker,\n isExternal: IsExternalFile\n): FileEdges => {\n const resolve: ModuleResolver = (specifier) =>\n moduleTarget(specifier, checker, isExternal);\n const edges = emptyEdges();\n let skipped = false;\n\n for (const statement of sourceFile.statements) {\n if (isImportDeclaration(statement)) {\n addImport(statement, edges, resolve);\n } else if (isExportDeclaration(statement)) {\n if (statement.moduleSpecifier) addExportFrom(statement, edges, resolve);\n else addLocalExport(statement, edges);\n } else if (isExportAssignment(statement)) {\n if (statement.isExportEquals) skipped = true;\n else addDefaultExport(edges);\n } else if (isModuleDeclaration(statement)) {\n skipped = true;\n } else {\n addDeclaredExports(statement, edges);\n }\n }\n\n addDynamicImports(sourceFile, edges, resolve);\n\n const fileEdges: FileEdges = {\n fileName: sourceFile.fileName,\n ...edges,\n skipped\n };\n\n return fileEdges;\n};\n", "import { isNamespaceExport } from 'typescript';\nimport type { ExportDeclaration, NamespaceExport } from 'typescript';\n\nimport type {\n EdgeAccumulator,\n ImportEdge,\n ModuleResolver,\n ReExportEdge\n} from '../common/no-unused-exports.type.ts';\n\nconst addNamespaceExport = (\n clause: NamespaceExport,\n edges: EdgeAccumulator,\n target: string | undefined\n): void => {\n const exported = clause.name.text;\n\n edges.exports.push(exported);\n edges.declared.add(exported);\n\n if (target === undefined) return;\n\n const edge: ImportEdge = { target, names: ['*'] };\n\n edges.imports.push(edge);\n};\n\nexport const addExportFrom = (\n statement: ExportDeclaration,\n edges: EdgeAccumulator,\n resolve: ModuleResolver\n): void => {\n const target = resolve(statement.moduleSpecifier);\n const clause = statement.exportClause;\n\n if (!clause) {\n if (target !== undefined) edges.starTargets.push(target);\n\n return;\n }\n\n if (isNamespaceExport(clause)) {\n addNamespaceExport(clause, edges, target);\n\n return;\n }\n\n for (const element of clause.elements) {\n const origin = element.propertyName ?? element.name;\n const exported = element.name.text;\n\n edges.exports.push(exported);\n\n if (target === undefined) continue;\n\n const edge: ReExportEdge = { target, source: origin.text, exported };\n\n edges.reExports.push(edge);\n }\n};\n\nexport const addLocalExport = (\n statement: ExportDeclaration,\n edges: EdgeAccumulator\n): void => {\n const clause = statement.exportClause;\n\n if (!clause) return;\n\n if (isNamespaceExport(clause)) return;\n\n for (const element of clause.elements) {\n const exported = element.name.text;\n\n edges.exports.push(exported);\n edges.declared.add(exported);\n }\n};\n", "import {\n SyntaxKind,\n canHaveModifiers,\n getModifiers,\n isClassDeclaration,\n isEnumDeclaration,\n isFunctionDeclaration,\n isIdentifier,\n isInterfaceDeclaration,\n isTypeAliasDeclaration,\n isVariableStatement\n} from 'typescript';\nimport type { Statement, VariableStatement } from 'typescript';\n\nconst hasModifier = (statement: Statement, kind: SyntaxKind): boolean => {\n if (!canHaveModifiers(statement)) return false;\n\n const modifiers = getModifiers(statement);\n const matched = modifiers?.some((modifier) => modifier.kind === kind);\n\n return matched === true;\n};\n\nconst variableNames = (statement: VariableStatement): string[] => {\n const names: string[] = [];\n\n for (const declaration of statement.declarationList.declarations) {\n if (!isIdentifier(declaration.name)) continue;\n\n names.push(declaration.name.text);\n }\n\n return names;\n};\n\nconst declaredName = (statement: Statement): string | undefined => {\n if (isFunctionDeclaration(statement)) return statement.name?.text;\n\n if (isClassDeclaration(statement)) return statement.name?.text;\n\n if (isTypeAliasDeclaration(statement)) return statement.name.text;\n\n if (isInterfaceDeclaration(statement)) return statement.name.text;\n\n if (isEnumDeclaration(statement)) return statement.name.text;\n\n return undefined;\n};\n\nexport const exportedNames = (statement: Statement): string[] => {\n const isExported = hasModifier(statement, SyntaxKind.ExportKeyword);\n\n if (!isExported) return [];\n\n const isDefault = hasModifier(statement, SyntaxKind.DefaultKeyword);\n\n if (isDefault) return ['default'];\n\n if (isVariableStatement(statement)) return variableNames(statement);\n\n const name = declaredName(statement);\n\n if (name === undefined) return [];\n\n return [name];\n};\n", "import type { Expression, Node, TypeChecker } from 'typescript';\n\nimport type { IsExternalFile } from '../common/no-unused-exports.type.ts';\n\nconst declarationOf = (\n specifier: Expression,\n checker: TypeChecker\n): Node | undefined => {\n const symbol = checker.getSymbolAtLocation(specifier);\n\n if (!symbol) return undefined;\n\n return symbol.valueDeclaration ?? symbol.declarations?.[0];\n};\n\nexport const moduleTarget = (\n specifier: Expression | undefined,\n checker: TypeChecker,\n isExternal: IsExternalFile\n): string | undefined => {\n if (!specifier) return undefined;\n\n const declaration = declarationOf(specifier, checker);\n\n if (!declaration) return undefined;\n\n const sourceFile = declaration.getSourceFile();\n\n if (sourceFile.isDeclarationFile) return undefined;\n\n const isSourceExternal = isExternal(sourceFile);\n\n if (isSourceExternal) return undefined;\n\n return sourceFile.fileName;\n};\n", "import { markUsage } from './export-usage.util.ts';\nimport { STAR_NAME } from '../common/no-unused-exports.const.ts';\nimport type {\n PublicExports,\n UsageContext\n} from '../common/no-unused-exports.type.ts';\n\nexport const publicExports = (\n context: UsageContext,\n entryFiles: string[]\n): PublicExports => {\n const index: PublicExports = new Map();\n\n for (const entryFile of entryFiles) {\n const keys = markUsage(context, entryFile, STAR_NAME);\n\n for (const key of keys) {\n const names = index.get(key.fileName) ?? new Set<string>();\n\n names.add(key.name);\n index.set(key.fileName, names);\n }\n }\n\n return index;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\ntype ExportNodes = Map<string, TSESTree.Node>;\n\ntype NamedDeclaration = Exclude<\n TSESTree.NamedExportDeclarations,\n TSESTree.VariableDeclaration\n>;\n\nconst { AST_NODE_TYPES } = TSESTree;\n\nconst exportedName = (\n exported: TSESTree.Identifier | TSESTree.StringLiteral\n): string => {\n if (exported.type === AST_NODE_TYPES.Identifier) return exported.name;\n\n return exported.value;\n};\n\nconst addVariableNodes = (\n declaration: TSESTree.VariableDeclaration,\n nodes: ExportNodes\n): void => {\n for (const declarator of declaration.declarations) {\n const { id } = declarator;\n\n if (id.type !== AST_NODE_TYPES.Identifier) continue;\n\n nodes.set(id.name, id);\n }\n};\n\nconst addNamedDeclarationNode = (\n declaration: NamedDeclaration,\n nodes: ExportNodes\n): void => {\n const { id } = declaration;\n\n if (!id) return;\n\n if (id.type !== AST_NODE_TYPES.Identifier) return;\n\n nodes.set(id.name, id);\n};\n\nconst addNamedExportNodes = (\n statement: TSESTree.ExportNamedDeclaration,\n nodes: ExportNodes\n): void => {\n for (const specifier of statement.specifiers) {\n const name = exportedName(specifier.exported);\n\n nodes.set(name, specifier);\n }\n\n const { declaration } = statement;\n\n if (!declaration) return;\n\n if (declaration.type === AST_NODE_TYPES.VariableDeclaration) {\n addVariableNodes(declaration, nodes);\n\n return;\n }\n\n addNamedDeclarationNode(declaration, nodes);\n};\n\nexport const exportNodes = (program: TSESTree.Program): ExportNodes => {\n const nodes: ExportNodes = new Map();\n\n for (const statement of program.body) {\n if (statement.type === AST_NODE_TYPES.ExportDefaultDeclaration) {\n nodes.set('default', statement);\n continue;\n }\n\n if (statement.type !== AST_NODE_TYPES.ExportNamedDeclaration) continue;\n\n addNamedExportNodes(statement, nodes);\n }\n\n return nodes;\n};\n", "import type {\n ParserServicesWithTypeInformation,\n TSESLint,\n TSESTree\n} from '@typescript-eslint/utils';\n\nimport type {\n FileEdges,\n MessageIds,\n RuleContext\n} from './common/no-unused-exports.type.ts';\nimport { exportIndex, publicExportIndex } from './export-index.ts';\nimport { exportNodes } from './utils/export-nodes.util.ts';\nimport type { GlobMatcher } from '../common/glob-matcher.type.ts';\n\ntype ReportOptions = {\n readonly context: RuleContext;\n readonly isEntry: GlobMatcher;\n readonly node: TSESTree.Program;\n readonly services: ParserServicesWithTypeInformation;\n};\n\ntype NameReportOptions = {\n readonly context: RuleContext;\n readonly edges: FileEdges;\n readonly node: TSESTree.Program;\n readonly publicNames: Set<string> | undefined;\n readonly used: Map<string, number> | undefined;\n};\n\nconst reportModule = (context: RuleContext, node: TSESTree.Program): void => {\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'unusedModule'\n };\n\n context.report(report);\n};\n\nconst reportNames = ({\n context,\n edges,\n node,\n publicNames,\n used\n}: NameReportOptions): void => {\n const nodes = exportNodes(node);\n const uniqueExports = new Set(edges.exports);\n\n for (const name of uniqueExports) {\n const count = used?.get(name) ?? 0;\n const isPublic = publicNames?.has(name) ?? false;\n\n if (count > 0 || isPublic) continue;\n\n const data = { name };\n const target = nodes.get(name) ?? node;\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: target,\n messageId: 'unusedExport',\n data\n };\n\n context.report(report);\n }\n};\n\nexport const reportUnusedExports = ({\n context,\n isEntry,\n node,\n services\n}: ReportOptions): void => {\n const sourceFile = services.esTreeNodeToTSNodeMap.get(node);\n const aggregate = exportIndex(services.program);\n const edges = aggregate.byFile.get(sourceFile.fileName);\n\n if (!edges) return;\n\n if (edges.skipped) return;\n\n const hasStarExports = edges.starTargets.length > 0;\n const hasExports = edges.exports.length > 0 || hasStarExports;\n\n if (!hasExports) return;\n\n const isImported = aggregate.imported.has(edges.fileName);\n\n if (!isImported) {\n reportModule(context, node);\n\n return;\n }\n\n const used = aggregate.usage.get(edges.fileName);\n const publicIndex = publicExportIndex(aggregate, isEntry);\n const publicNames = publicIndex.get(edges.fileName);\n const nameOptions: NameReportOptions = {\n context,\n edges,\n node,\n publicNames,\n used\n };\n\n reportNames(nameOptions);\n};\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { JSONSchema, TSESLint } from '@typescript-eslint/utils';\n\ntype OneLineGuardOptions = { readonly maxLineLength: number };\ntype Options = [OneLineGuardOptions];\ntype MessageIds = 'oneLineGuard';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require a lone return/throw/continue/break guard to drop its braces when the whole if statement fits on one line'\n};\n\nconst messages: Record<MessageIds, string> = {\n oneLineGuard:\n 'Lone {{ keyword }} guard fits within {{ max }} columns; write it on one line without braces.'\n};\n\nconst maxLineLengthSchema: JSONSchema.JSONSchema4 = {\n type: 'integer',\n minimum: 1\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n maxLineLength: maxLineLengthSchema\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [\n {\n type: 'object',\n properties,\n additionalProperties: false\n }\n];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n schema,\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#one-line-guard'\n);\n\nconst GUARD_KEYWORDS = new Set([\n TSESTree.AST_NODE_TYPES.ReturnStatement,\n TSESTree.AST_NODE_TYPES.ThrowStatement,\n TSESTree.AST_NODE_TYPES.ContinueStatement,\n TSESTree.AST_NODE_TYPES.BreakStatement\n]);\n\nconst soleStatement = (\n body: TSESTree.Statement\n): TSESTree.Statement | undefined => {\n if (body.type !== TSESTree.AST_NODE_TYPES.BlockStatement) return undefined;\n\n if (body.body.length !== 1) return undefined;\n\n return body.body[0];\n};\n\nconst guardStatement = (\n node: TSESTree.IfStatement\n): TSESTree.Statement | undefined => {\n if (node.alternate) return undefined;\n\n const statement = soleStatement(node.consequent);\n\n if (!statement) return undefined;\n\n const isGuardKeyword = GUARD_KEYWORDS.has(statement.type);\n\n if (!isGuardKeyword) return undefined;\n\n return statement;\n};\n\nconst headText = (\n node: TSESTree.IfStatement,\n sourceCode: TSESLint.SourceCode\n): string => {\n const start = node.range[0];\n const end = node.consequent.range[0];\n const rawHead = sourceCode.text.slice(start, end);\n\n return rawHead.trimEnd();\n};\n\nconst collapsedLine = (\n node: TSESTree.IfStatement,\n head: string,\n bodyText: string,\n sourceCode: TSESLint.SourceCode\n): string => {\n const line = sourceCode.lines[node.loc.start.line - 1] ?? '';\n const prefix = line.slice(0, node.loc.start.column);\n\n return `${prefix}${head} ${bodyText}`;\n};\n\nconst defaultOptions: Options = [{ maxLineLength: 80 }];\n\nexport default createRule<Options, MessageIds>({\n name: 'one-line-guard',\n meta,\n defaultOptions,\n create(context, [{ maxLineLength }]) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n IfStatement(node): void {\n const statement = guardStatement(node);\n\n if (!statement) return;\n\n const hasComments =\n sourceCode.getCommentsInside(node.consequent).length > 0;\n\n if (hasComments) return;\n\n const head = headText(node, sourceCode);\n const isMultiLineHead = head.includes('\\n');\n\n if (isMultiLineHead) return;\n\n const bodyText = sourceCode.getText(statement);\n const isMultiLineBody = bodyText.includes('\\n');\n\n if (isMultiLineBody) return;\n\n const collapsed = collapsedLine(node, head, bodyText, sourceCode);\n\n if (collapsed.length > maxLineLength) return;\n\n const [keywordToken] = sourceCode.getTokens(statement);\n\n if (keywordToken === undefined) return;\n\n const keyword = keywordToken.value;\n const data = { keyword, max: maxLineLength };\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceText(node.consequent, bodyText);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'oneLineGuard',\n data,\n fix\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'missingReadonly' | 'readonlyArray';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require readonly on primitive-typed type and interface properties, and require array types to be written as T[] instead of readonly T[] or ReadonlyArray<T>'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingReadonly:\n \"Type property '{{ name }}' should be readonly. Disable this rule on the line if mutation is required.\",\n readonlyArray: 'Write a readonly array type as T[].'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#readonly-type-properties'\n);\n\nconst propertyName = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (node.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return node.key.name;\n }\n\n return sourceCode.getText(node.key);\n};\n\nconst PRIMITIVE_KEYWORDS = new Set([\n TSESTree.AST_NODE_TYPES.TSStringKeyword,\n TSESTree.AST_NODE_TYPES.TSNumberKeyword,\n TSESTree.AST_NODE_TYPES.TSBooleanKeyword,\n TSESTree.AST_NODE_TYPES.TSBigIntKeyword,\n TSESTree.AST_NODE_TYPES.TSSymbolKeyword,\n TSESTree.AST_NODE_TYPES.TSNullKeyword,\n TSESTree.AST_NODE_TYPES.TSUndefinedKeyword\n]);\n\nconst isPrimitive = (type: TSESTree.TypeNode): boolean => {\n const isPrimitiveKeyword = PRIMITIVE_KEYWORDS.has(type.type);\n\n if (isPrimitiveKeyword) return true;\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSLiteralType ||\n type.type === TSESTree.AST_NODE_TYPES.TSTemplateLiteralType\n ) {\n return true;\n }\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSUnionType ||\n type.type === TSESTree.AST_NODE_TYPES.TSIntersectionType\n ) {\n return type.types.every(isPrimitive);\n }\n\n return false;\n};\n\nconst readonlyFix = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): TSESLint.ReportFixFunction => {\n return (fixer) => {\n const firstToken = sourceCode.getFirstToken(node);\n\n if (!firstToken) return null;\n\n return fixer.insertTextBefore(firstToken, 'readonly ');\n };\n};\n\nconst NEEDS_PARENS = new Set([\n TSESTree.AST_NODE_TYPES.TSUnionType,\n TSESTree.AST_NODE_TYPES.TSIntersectionType,\n TSESTree.AST_NODE_TYPES.TSFunctionType,\n TSESTree.AST_NODE_TYPES.TSConditionalType\n]);\n\nconst arrayTypeText = (\n argument: TSESTree.TypeNode,\n sourceCode: TSESLint.SourceCode\n): string => {\n const argumentText = sourceCode.getText(argument);\n const needsParens = NEEDS_PARENS.has(argument.type);\n\n if (needsParens) return `(${argumentText})[]`;\n\n return `${argumentText}[]`;\n};\n\nconst readonlyArrayReport = (\n node: TSESTree.Node,\n fix: TSESLint.ReportFixFunction\n): TSESLint.ReportDescriptor<MessageIds> => {\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'readonlyArray',\n fix\n };\n\n return report;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'readonly-type-properties',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n TSPropertySignature(node): void {\n if (node.readonly || !node.typeAnnotation) return;\n\n const isPrimitiveType = isPrimitive(node.typeAnnotation.typeAnnotation);\n\n if (!isPrimitiveType) return;\n\n const name = propertyName(node, sourceCode);\n const data = { name };\n const fix = readonlyFix(node, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: node.key,\n messageId: 'missingReadonly',\n data,\n fix\n };\n\n context.report(report);\n },\n TSTypeOperator(node): void {\n if (node.operator !== 'readonly' || !node.typeAnnotation) return;\n\n const isArray =\n node.typeAnnotation.type === TSESTree.AST_NODE_TYPES.TSArrayType;\n\n if (!isArray) return;\n\n const replacement = sourceCode.getText(node.typeAnnotation);\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceText(node, replacement);\n\n context.report(readonlyArrayReport(node, fix));\n },\n TSTypeReference(node): void {\n if (node.typeName.type !== TSESTree.AST_NODE_TYPES.Identifier) return;\n\n if (node.typeName.name !== 'ReadonlyArray') return;\n\n const params = node.typeArguments?.params ?? [];\n\n if (params.length !== 1) return;\n\n const [argument] = params;\n\n if (!argument) return;\n\n const replacement = arrayTypeText(argument, sourceCode);\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceText(node, replacement);\n\n context.report(readonlyArrayReport(node, fix));\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'ternaryBranch';\ntype Branch = 'alternate' | 'consequent';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require ternary branches to hold only names, literals, or plain member access'\n};\n\nconst messages: Record<MessageIds, string> = {\n ternaryBranch:\n 'Ternary {{ branch }} must be a name, literal, or plain member access; name the expression first.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#ternary-branch-shape'\n);\n\nconst isPlainMemberAccess = (node: TSESTree.MemberExpression): boolean => {\n let current: TSESTree.Expression = node;\n\n while (current.type === TSESTree.AST_NODE_TYPES.MemberExpression) {\n current = current.object;\n }\n\n return current.type !== TSESTree.AST_NODE_TYPES.CallExpression;\n};\n\nconst isAllowedBranch = (node: TSESTree.Expression): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) return true;\n\n if (node.type === TSESTree.AST_NODE_TYPES.Literal) return true;\n\n if (node.type === TSESTree.AST_NODE_TYPES.TemplateLiteral) return true;\n\n if (node.type === TSESTree.AST_NODE_TYPES.UnaryExpression) {\n return node.argument.type === TSESTree.AST_NODE_TYPES.Literal;\n }\n\n if (node.type === TSESTree.AST_NODE_TYPES.MemberExpression) {\n return isPlainMemberAccess(node);\n }\n\n return false;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'ternary-branch-shape',\n meta,\n defaultOptions: [],\n create(context) {\n const check = (node: TSESTree.Expression, branch: Branch): void => {\n const isAllowed = isAllowedBranch(node);\n\n if (isAllowed) return;\n\n const data = { branch };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'ternaryBranch',\n data\n };\n\n context.report(report);\n };\n\n const listeners: TSESLint.RuleListener = {\n ConditionalExpression(node): void {\n check(node.consequent, 'consequent');\n check(node.alternate, 'alternate');\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n FIXTURES_SEGMENT,\n FORBIDDEN_SHAPES,\n MOCK_FILE_PATTERN,\n SPEC_UTIL_FILE_PATTERN,\n STUB_FILE_PATTERN,\n TESTING_LIB_SEGMENT,\n TEST_FIXTURES_SEGMENT,\n defaultOptions,\n meta\n} from './common/test-file-shape.const.ts';\nimport type { MessageIds, Options } from './common/test-file-shape.type.ts';\nimport { isMockFile, mockExportListeners } from './mock-exports.ts';\nimport { isStubFile, stubExportListeners } from './stub-exports.ts';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#test-file-shape'\n);\n\nconst isUnderTestingLib = (filename: string): boolean =>\n filename.includes(TESTING_LIB_SEGMENT);\n\nconst misplacedFixtures = (filename: string): string | undefined => {\n const hasFixturesSegment = FIXTURES_SEGMENT.test(filename);\n\n if (!hasFixturesSegment) return undefined;\n\n const isTestFixtures = filename.includes(TEST_FIXTURES_SEGMENT);\n\n if (isTestFixtures) return undefined;\n\n return 'fixtures/ outside test/fixtures/';\n};\n\nconst misplacedShape = (filename: string): string | undefined => {\n const isTestingLib = isUnderTestingLib(filename);\n\n if (isTestingLib) return undefined;\n\n const isStub = filename.endsWith('.stub.ts');\n const isPlacedStub = STUB_FILE_PATTERN.test(filename);\n\n if (isStub && !isPlacedStub) return '.stub.ts outside test/stubs/';\n\n const isMock = filename.endsWith('.mock.ts');\n const isPlacedMock = MOCK_FILE_PATTERN.test(filename);\n\n if (isMock && !isPlacedMock) return '.mock.ts outside test/mocks/';\n\n const isSpecUtil = filename.endsWith('.spec.util.ts');\n const isPlacedSpecUtil = SPEC_UTIL_FILE_PATTERN.test(filename);\n\n if (isSpecUtil && !isPlacedSpecUtil) {\n return '.spec.util.ts outside test/utils/';\n }\n\n return misplacedFixtures(filename);\n};\n\nconst forbiddenShape = (filename: string): string | undefined => {\n const match = FORBIDDEN_SHAPES.find((entry) => entry.pattern.test(filename));\n\n if (match) return match.shape;\n\n return misplacedShape(filename);\n};\n\nconst forbiddenTestFileListeners = (\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n shape: string\n): TSESLint.RuleListener => {\n const listeners: TSESLint.RuleListener = {\n Program(node): void {\n const data = { shape };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'forbiddenTestFile',\n data\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'test-file-shape',\n meta,\n defaultOptions,\n create(context) {\n const filename = context.filename.replaceAll('\\\\', '/');\n const shape = forbiddenShape(filename);\n\n if (shape) return forbiddenTestFileListeners(context, shape);\n\n const isStub = isStubFile(filename);\n\n if (isStub) return stubExportListeners(context);\n\n const isMock = isMockFile(filename);\n\n if (isMock) return mockExportListeners(context);\n\n const noListeners: TSESLint.RuleListener = {};\n\n return noListeners;\n }\n});\n", "import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n ForbiddenShape,\n MessageIds,\n Options\n} from './test-file-shape.type.ts';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Restrict test-support file shapes and enforce naming and typing on stub and mock exports'\n};\n\nconst messages: Record<MessageIds, string> = {\n forbiddenTestFile:\n \"Test-support file shape '{{ shape }}' is not allowed; test-only files live under test/stubs, test/mocks, test/fixtures, or test/utils.\",\n stubName:\n \"Stub export '{{ name }}' must be named in SCREAMING_SNAKE_CASE ending in '_STUB'.\",\n stubType: \"Stub export '{{ name }}' is missing an explicit type annotation.\",\n mockName:\n \"Mock export '{{ name }}' must be a camelCase name ending in 'Mock'.\",\n mockFactory:\n \"Mock export '{{ name }}' must be a function that returns fresh spies.\",\n mockReturnType:\n \"Mock export '{{ name }}' is missing an explicit return type.\"\n};\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'problem',\n docs,\n schema: [],\n messages\n};\n\nexport const defaultOptions: Options = [];\n\nexport const FORBIDDEN_SHAPES: ForbiddenShape[] = [\n { pattern: /\\.spec-support\\.ts$/, shape: '.spec-support.ts' },\n { pattern: /\\.spec-helper\\.ts$/, shape: '.spec-helper.ts' },\n { pattern: /\\.test-utils\\.ts$/, shape: '.test-utils.ts' },\n { pattern: /-fixture\\.ts$/, shape: '-fixture.ts' },\n { pattern: /\\/__mocks__\\//, shape: '__mocks__/' },\n { pattern: /\\/helpers\\//, shape: 'helpers/' },\n { pattern: /\\/common\\/stubs\\//, shape: 'common/stubs/' }\n];\n\nexport const STUB_FILE_PATTERN = /\\/test\\/stubs\\/.+\\.stub\\.ts$/;\n\nexport const MOCK_FILE_PATTERN = /\\/test\\/mocks\\/.+\\.mock\\.ts$/;\n\nexport const SPEC_UTIL_FILE_PATTERN = /\\/test\\/utils\\/.+\\.spec\\.util\\.ts$/;\n\nexport const TESTING_LIB_SEGMENT = '/testing/';\n\nexport const TEST_FIXTURES_SEGMENT = '/test/fixtures/';\n\nexport const FIXTURES_SEGMENT = /\\/fixtures\\//;\n\nexport const STUB_NAME_PATTERN = /^[A-Z0-9]+(_[A-Z0-9]+)*_STUB$/;\n\nexport const MOCK_NAME_PATTERN = /^[a-z][A-Za-z0-9]*Mock$/;\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n MOCK_FILE_PATTERN,\n MOCK_NAME_PATTERN,\n TESTING_LIB_SEGMENT\n} from './common/test-file-shape.const.ts';\nimport type { MessageIds, Options } from './common/test-file-shape.type.ts';\n\ntype RuleContext = TSESLint.RuleContext<MessageIds, Options>;\n\nexport const isMockFile = (filename: string): boolean => {\n const isUnderTestMocks = MOCK_FILE_PATTERN.test(filename);\n\n if (isUnderTestMocks) return true;\n\n const isUnderTestingLib = filename.includes(TESTING_LIB_SEGMENT);\n\n return isUnderTestingLib && filename.endsWith('.mock.ts');\n};\n\nconst isMockIdentifier = (\n id: TSESTree.VariableDeclarator['id']\n): id is TSESTree.Identifier => id.type === TSESTree.AST_NODE_TYPES.Identifier;\n\nconst isMockFunction = (\n init: TSESTree.Expression | null\n): init is TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression => {\n if (init === null) return false;\n\n const { type } = init;\n\n if (type === TSESTree.AST_NODE_TYPES.ArrowFunctionExpression) return true;\n\n return type === TSESTree.AST_NODE_TYPES.FunctionExpression;\n};\n\nconst isConstVariableDeclaration = (\n declaration: TSESTree.NamedExportDeclarations\n): declaration is TSESTree.VariableDeclaration => {\n if (declaration.type !== TSESTree.AST_NODE_TYPES.VariableDeclaration) {\n return false;\n }\n\n return declaration.kind === 'const';\n};\n\nconst declarationName = (\n context: Readonly<RuleContext>,\n declaration: TSESTree.NamedExportDeclarations\n): string => {\n if (declaration.type === TSESTree.AST_NODE_TYPES.VariableDeclaration) {\n const [firstDeclarator] = declaration.declarations;\n\n return context.sourceCode.getText(firstDeclarator.id);\n }\n\n if ('id' in declaration && declaration.id !== null) {\n return context.sourceCode.getText(declaration.id);\n }\n\n return context.sourceCode.getText(declaration);\n};\n\nconst reportMock = (\n context: Readonly<RuleContext>,\n node: TSESTree.Node,\n messageId: MessageIds,\n name: string\n): void => {\n const data = { name };\n const descriptor: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId,\n data\n };\n\n context.report(descriptor);\n};\n\nconst checkMockDeclarator = (\n context: Readonly<RuleContext>,\n node: TSESTree.VariableDeclarator\n): void => {\n const fallbackName = context.sourceCode.getText(node.id);\n const name = isMockIdentifier(node.id) ? node.id.name : fallbackName;\n const hasValidPattern = MOCK_NAME_PATTERN.test(name);\n const hasValidName = isMockIdentifier(node.id) && hasValidPattern;\n\n if (!hasValidName) {\n reportMock(context, node.id, 'mockName', name);\n }\n\n if (!isMockFunction(node.init)) {\n reportMock(context, node.id, 'mockFactory', name);\n\n return;\n }\n\n const hasReturnType = node.init.returnType !== undefined;\n\n if (hasReturnType) return;\n\n reportMock(context, node.id, 'mockReturnType', name);\n};\n\nexport const mockExportListeners = (\n context: Readonly<RuleContext>\n): TSESLint.RuleListener => {\n const listeners: TSESLint.RuleListener = {\n ExportNamedDeclaration(node): void {\n if (node.declaration === null) return;\n\n const { declaration } = node;\n const isConstVar = isConstVariableDeclaration(declaration);\n\n if (!isConstVar) {\n const name = declarationName(context, declaration);\n\n reportMock(context, node, 'mockFactory', name);\n\n return;\n }\n\n for (const declarator of declaration.declarations) {\n checkMockDeclarator(context, declarator);\n }\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n STUB_FILE_PATTERN,\n STUB_NAME_PATTERN,\n TESTING_LIB_SEGMENT\n} from './common/test-file-shape.const.ts';\nimport type { MessageIds, Options } from './common/test-file-shape.type.ts';\n\ntype RuleContext = TSESLint.RuleContext<MessageIds, Options>;\n\nexport const isStubFile = (filename: string): boolean => {\n const isUnderTestStubs = STUB_FILE_PATTERN.test(filename);\n\n if (isUnderTestStubs) return true;\n\n const isUnderTestingLib = filename.includes(TESTING_LIB_SEGMENT);\n\n return isUnderTestingLib && filename.endsWith('.stub.ts');\n};\n\nconst isStubIdentifier = (\n id: TSESTree.VariableDeclarator['id']\n): id is TSESTree.Identifier => id.type === TSESTree.AST_NODE_TYPES.Identifier;\n\nconst checkStubDeclarator = (\n context: Readonly<RuleContext>,\n node: TSESTree.VariableDeclarator\n): void => {\n const fallbackName = context.sourceCode.getText(node.id);\n const name = isStubIdentifier(node.id) ? node.id.name : fallbackName;\n const hasValidPattern = STUB_NAME_PATTERN.test(name);\n const hasValidName = isStubIdentifier(node.id) && hasValidPattern;\n\n if (!hasValidName) {\n const nameData = { name };\n const nameReport: TSESLint.ReportDescriptor<MessageIds> = {\n node: node.id,\n messageId: 'stubName',\n data: nameData\n };\n\n context.report(nameReport);\n }\n\n const hasTypeAnnotation = node.id.typeAnnotation !== undefined;\n\n if (hasTypeAnnotation) return;\n\n const typeData = { name };\n const typeReport: TSESLint.ReportDescriptor<MessageIds> = {\n node: node.id,\n messageId: 'stubType',\n data: typeData\n };\n\n context.report(typeReport);\n};\n\nexport const stubExportListeners = (\n context: Readonly<RuleContext>\n): TSESLint.RuleListener => {\n const listeners: TSESLint.RuleListener = {\n 'ExportNamedDeclaration > VariableDeclaration > VariableDeclarator'(\n node: TSESTree.VariableDeclarator\n ): void {\n checkStubDeclarator(context, node);\n }\n };\n\n return listeners;\n};\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { defaultOptions, meta } from './common/type-placement.const.ts';\nimport type { MessageIds, Options } from './common/type-placement.type.ts';\nimport { toRegExp } from '../utils/to-regexp.util.ts';\n\ntype RuleContext = TSESLint.RuleContext<MessageIds, Options>;\n\ntype FileShape = {\n readonly isTypeFile: boolean;\n readonly isConstFile: boolean;\n readonly inCommon: boolean;\n};\n\nconst TYPE_FILE_SUFFIX = '.type.ts';\nconst CONST_FILE_SUFFIX = '.const.ts';\nconst COMMON_SEGMENT = '/common/';\nconst EXEMPT_FILE = /\\.(spec|stub|d)\\.ts$/;\nconst STATE_TYPE_FILE = /(^|[./])state\\.type\\.ts$/;\nconst FIXTURES_SEGMENT = '/fixtures/';\nconst TYPE_FILE_SEGMENT = /\\.type(\\.ts)?$/;\nconst COMMON_BARREL = /(^|\\/)common(\\/index(\\.ts)?)?$/;\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#type-placement'\n);\n\nconst isExemptFile = (filename: string): boolean => {\n const isExemptSuffix = EXEMPT_FILE.test(filename);\n\n if (isExemptSuffix) return true;\n\n const isStateTypeFile = STATE_TYPE_FILE.test(filename);\n\n if (isStateTypeFile) return true;\n\n return filename.includes(FIXTURES_SEGMENT);\n};\n\nconst lastSegment = (source: string): string => {\n const segments = source.split('/');\n\n return segments[segments.length - 1] ?? source;\n};\n\nconst isTypeOnlySource = (source: string): boolean => {\n const isCommonBarrel = COMMON_BARREL.test(source);\n\n if (isCommonBarrel) return true;\n\n return TYPE_FILE_SEGMENT.test(lastSegment(source));\n};\n\nconst isInternalSource = (source: string, patterns: RegExp[]): boolean => {\n const isRelative = source.startsWith('.');\n\n if (isRelative) return true;\n\n return patterns.some((pattern) => pattern.test(source));\n};\n\nconst isTypeDeclaration = (\n declaration: TSESTree.NamedExportDeclarations\n): declaration is\n TSESTree.TSTypeAliasDeclaration | TSESTree.TSInterfaceDeclaration => {\n const { type } = declaration;\n\n if (type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration) return true;\n\n return type === TSESTree.AST_NODE_TYPES.TSInterfaceDeclaration;\n};\n\nconst isConstVariableDeclaration = (\n declaration: TSESTree.NamedExportDeclarations\n): boolean => {\n if (declaration.type !== TSESTree.AST_NODE_TYPES.VariableDeclaration) {\n return false;\n }\n\n return declaration.kind === 'const';\n};\n\nconst report = (\n context: Readonly<RuleContext>,\n node: TSESTree.Node,\n messageId: MessageIds,\n data: Record<string, string> | undefined\n): void => {\n const base: TSESLint.ReportDescriptor<MessageIds> = { node, messageId };\n\n if (data === undefined) {\n context.report(base);\n\n return;\n }\n\n const withData: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId,\n data\n };\n\n context.report(withData);\n};\n\nconst handleExport = (\n context: Readonly<RuleContext>,\n node: TSESTree.ExportNamedDeclaration,\n shape: FileShape\n): void => {\n if (node.declaration === null) return;\n\n const { declaration } = node;\n\n if (isTypeDeclaration(declaration)) {\n const isCommonTypeFile = shape.isTypeFile && shape.inCommon;\n\n if (!isCommonTypeFile) {\n const data = { name: declaration.id.name };\n\n report(context, node, 'typeOutsideTypeFile', data);\n }\n } else if (shape.isTypeFile) {\n report(context, node, 'valueInTypeFile', undefined);\n }\n\n const isConstVar = isConstVariableDeclaration(declaration);\n\n if (shape.isConstFile && !isConstVar) {\n report(context, node, 'nonConstInConstFile', undefined);\n }\n};\n\nconst handleTypeImport = (\n context: Readonly<RuleContext>,\n node: TSESTree.ImportDeclaration,\n patterns: RegExp[]\n): void => {\n const { value: source } = node.source;\n const isInternal = isInternalSource(source, patterns);\n\n if (!isInternal) return;\n\n const isTypeSource = isTypeOnlySource(source);\n\n if (isTypeSource) return;\n\n report(context, node, 'typeImportNotFromTypeFile', { source });\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'type-placement',\n meta,\n defaultOptions,\n create(context, [{ internalPatterns }]) {\n const filename = context.filename.replaceAll('\\\\', '/');\n const isExempt = isExemptFile(filename);\n\n if (isExempt) {\n const noListeners: TSESLint.RuleListener = {};\n\n return noListeners;\n }\n\n const isTypeFile = filename.endsWith(TYPE_FILE_SUFFIX);\n const isConstFile = filename.endsWith(CONST_FILE_SUFFIX);\n const inCommon = filename.includes(COMMON_SEGMENT);\n const shape: FileShape = { isTypeFile, isConstFile, inCommon };\n const internalPatternRegexes = internalPatterns.map(toRegExp);\n\n const listeners: TSESLint.RuleListener = {\n ExportNamedDeclaration(node): void {\n handleExport(context, node, shape);\n },\n 'ImportDeclaration[importKind=\"type\"]'(\n node: TSESTree.ImportDeclaration\n ): void {\n handleTypeImport(context, node, internalPatternRegexes);\n }\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type { MessageIds, Options } from './type-placement.type.ts';\n\nconst DEFAULT_INTERNAL_PATTERNS: string[] = [];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require types to live in common/*.type.ts files, *.const.ts files to export only consts, and type-only imports to come from *.type.ts files or a common barrel'\n};\n\nconst messages: Record<MessageIds, string> = {\n typeOutsideTypeFile:\n \"Exported type '{{ name }}' belongs in a common/*.type.ts or test/common/*.type.ts file, not here.\",\n valueInTypeFile:\n 'A *.type.ts file may only export type aliases and interfaces.',\n nonConstInConstFile:\n 'A *.const.ts file may only export const variable declarations.',\n typeImportNotFromTypeFile:\n \"Type-only import from '{{ source }}' must come from a *.type.ts file or a common barrel.\"\n};\n\nconst stringItems: JSONSchema.JSONSchema4 = { type: 'string' };\n\nconst internalPatternsSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: stringItems,\n description:\n 'Regular expressions matching internal, non-relative import sources that must point at a *.type.ts file. Empty by default: a workspace alias resolves to a library entry point, never to a type file.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n internalPatterns: internalPatternsSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nexport const defaultOptions: Options = [\n { internalPatterns: DEFAULT_INTERNAL_PATTERNS }\n];\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n AMBIENT_SELECTOR,\n CALL_SELECTOR,\n MODULE_LET_SELECTOR,\n MODULE_STATE_SELECTOR,\n NONDETERMINISTIC_SELECTOR,\n defaultOptions,\n meta\n} from './common/util-purity.const.ts';\nimport type { MessageIds, Options } from './common/util-purity.type.ts';\n\ntype RuleContext = TSESLint.RuleContext<MessageIds, Options>;\n\nconst UTIL_FILE = /\\/utils\\/[^/]+\\.util\\.ts$/;\nconst TEST_SEGMENT = '/test/';\nconst TESTING_SEGMENT = '/testing/';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#util-purity'\n);\n\nconst isUtilFile = (filename: string): boolean => {\n const isUtilPath = UTIL_FILE.test(filename);\n\n if (!isUtilPath) return false;\n\n const isUnderTest = filename.includes(TEST_SEGMENT) || filename.includes(TESTING_SEGMENT);\n\n return !isUnderTest;\n};\n\nconst identifierName = (\n node: TSESTree.Expression | TSESTree.PrivateIdentifier\n): string | undefined => {\n if (node.type !== TSESTree.AST_NODE_TYPES.Identifier) return undefined;\n\n return node.name;\n};\n\nconst memberName = (node: TSESTree.MemberExpression): string | undefined => {\n const objectName = identifierName(node.object);\n\n if (objectName === undefined) return undefined;\n\n const propertyName = identifierName(node.property);\n\n if (propertyName === undefined) return undefined;\n\n return `${objectName}.${propertyName}`;\n};\n\nconst report = (\n context: Readonly<RuleContext>,\n node: TSESTree.Node,\n messageId: MessageIds,\n data: Record<string, string> | undefined\n): void => {\n const base: TSESLint.ReportDescriptor<MessageIds> = { node, messageId };\n\n if (data === undefined) {\n context.report(base);\n\n return;\n }\n\n const withData: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId,\n data\n };\n\n context.report(withData);\n};\n\nconst reportAmbient = (\n context: Readonly<RuleContext>,\n node: TSESTree.MemberExpression\n): void => {\n const name = identifierName(node.object);\n\n if (name === undefined) return;\n\n report(context, node, 'ambientAccess', { name });\n};\n\nconst reportNondeterministic = (\n context: Readonly<RuleContext>,\n node: TSESTree.MemberExpression\n): void => {\n const name = memberName(node);\n\n if (name === undefined) return;\n\n report(context, node, 'nondeterministic', { name });\n};\n\nconst reportCall = (\n context: Readonly<RuleContext>,\n node: TSESTree.CallExpression\n): void => {\n const name = identifierName(node.callee);\n\n if (name === undefined) return;\n\n report(context, node, 'impureCall', { name });\n};\n\nconst handleImport = (\n context: Readonly<RuleContext>,\n node: TSESTree.ImportDeclaration,\n banned: Set<string>\n): void => {\n const { source } = node;\n const isBanned = banned.has(source.value);\n\n if (!isBanned) return;\n\n report(context, node, 'impureImport', { source: source.value });\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'util-purity',\n meta,\n defaultOptions,\n create(context, [{ bannedModules }]) {\n const filename = context.filename.replaceAll('\\\\', '/');\n const isUtil = isUtilFile(filename);\n\n if (!isUtil) {\n const noListeners: TSESLint.RuleListener = {};\n\n return noListeners;\n }\n\n const banned = new Set(bannedModules);\n\n const listeners: TSESLint.RuleListener = {\n ImportDeclaration(node): void {\n handleImport(context, node, banned);\n },\n [MODULE_LET_SELECTOR](node: TSESTree.VariableDeclaration): void {\n report(context, node, 'moduleLet', undefined);\n },\n [MODULE_STATE_SELECTOR](node: TSESTree.NewExpression): void {\n report(context, node, 'moduleState', undefined);\n },\n [AMBIENT_SELECTOR](node: TSESTree.MemberExpression): void {\n reportAmbient(context, node);\n },\n [NONDETERMINISTIC_SELECTOR](node: TSESTree.MemberExpression): void {\n reportNondeterministic(context, node);\n },\n [CALL_SELECTOR](node: TSESTree.CallExpression): void {\n reportCall(context, node);\n }\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type { MessageIds, Options } from './util-purity.type.ts';\n\nconst DEFAULT_BANNED_MODULES: string[] = [\n 'node:fs',\n 'fs',\n 'node:fs/promises',\n 'fs/promises',\n 'node:child_process',\n 'child_process',\n 'node:os',\n 'os',\n 'node:process',\n 'process',\n 'node:http',\n 'http',\n 'node:https',\n 'https',\n 'node:net',\n 'net',\n 'node:worker_threads',\n 'worker_threads'\n];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow impure, I/O-touching, or nondeterministic code inside *.util.ts files'\n};\n\nconst messages: Record<MessageIds, string> = {\n impureImport:\n \"Importing '{{ source }}' makes this util impure; utils must not perform I/O.\",\n moduleLet:\n 'Module-level `let` creates mutable shared state; utils must be pure.',\n moduleState:\n 'Module-level Map/Set/WeakMap/WeakSet is mutable shared state; utils must be pure.',\n ambientAccess:\n \"Accessing ambient '{{ name }}' makes this util impure and environment-dependent.\",\n nondeterministic:\n \"'{{ name }}' is nondeterministic; a util must return the same output for the same input.\",\n impureCall: \"Calling '{{ name }}' makes this util impure or side-effecting.\"\n};\n\nconst stringItems: JSONSchema.JSONSchema4 = { type: 'string' };\n\nconst bannedModulesSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: stringItems,\n description: 'Import sources that are forbidden inside util files.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n bannedModules: bannedModulesSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nexport const defaultOptions: Options = [\n { bannedModules: DEFAULT_BANNED_MODULES }\n];\n\nexport const MODULE_LET_SELECTOR = 'Program > VariableDeclaration[kind=\"let\"]';\n\nexport const MODULE_STATE_SELECTOR =\n 'Program > VariableDeclaration > VariableDeclarator > NewExpression[callee.name=/^(Map|Set|WeakMap|WeakSet)$/]';\n\nexport const AMBIENT_SELECTOR =\n 'MemberExpression[object.name=/^(process|globalThis|window|document|localStorage|sessionStorage|console)$/]';\n\nconst NONDETERMINISTIC_SELECTORS: string[] = [\n 'MemberExpression[object.name=\"Date\"][property.name=\"now\"]',\n 'MemberExpression[object.name=\"Math\"][property.name=\"random\"]',\n 'MemberExpression[object.name=\"performance\"][property.name=\"now\"]',\n 'MemberExpression[object.name=\"crypto\"][property.name=\"randomUUID\"]'\n];\n\nexport const NONDETERMINISTIC_SELECTOR = NONDETERMINISTIC_SELECTORS.join(', ');\n\nexport const CALL_SELECTOR =\n 'CallExpression[callee.name=/^(setTimeout|setInterval|fetch|inject|require)$/]';\n", "import arrowBodyFitsLineRule from './rules/arrow-body-fits-line/arrow-body-fits-line.ts';\nimport chainFitsLineRule from './rules/chain-fits-line/chain-fits-line.ts';\nimport chainReceiverIsNameRule from './rules/chain-receiver-is-name/chain-receiver-is-name.ts';\nimport { definePlugin } from './rules/define-plugin.util.ts';\nimport explicitAccessibilityRule from './rules/explicit-accessibility/explicit-accessibility.ts';\nimport maxConditionOperandsRule from './rules/max-condition-operands/max-condition-operands.ts';\nimport noCallInConditionRule from './rules/no-call-in-condition/no-call-in-condition.ts';\nimport noGroupedConditionRule from './rules/no-grouped-condition/no-grouped-condition.ts';\nimport noInlineObjectTypesRule from './rules/no-inline-object-types/no-inline-object-types.ts';\nimport noInlineReturnObjectRule from './rules/no-inline-return-object/no-inline-return-object.ts';\nimport noNestedObjectValueRule from './rules/no-nested-object-value/no-nested-object-value.ts';\nimport noSpreadExpressionRule from './rules/no-spread-expression/no-spread-expression.ts';\nimport noUnusedExportsRule from './rules/no-unused-exports/no-unused-exports.ts';\nimport oneLineGuardRule from './rules/one-line-guard/one-line-guard.ts';\nimport readonlyTypePropertiesRule from './rules/readonly-type-properties/readonly-type-properties.ts';\nimport ternaryBranchShapeRule from './rules/ternary-branch-shape/ternary-branch-shape.ts';\nimport testFileShapeRule from './rules/test-file-shape/test-file-shape.ts';\nimport typePlacementRule from './rules/type-placement/type-placement.ts';\nimport utilPurityRule from './rules/util-purity/util-purity.ts';\n\nexport const localPlugin = definePlugin('local', {\n 'arrow-body-fits-line': arrowBodyFitsLineRule,\n 'chain-fits-line': chainFitsLineRule,\n 'chain-receiver-is-name': chainReceiverIsNameRule,\n 'explicit-accessibility': explicitAccessibilityRule,\n 'max-condition-operands': maxConditionOperandsRule,\n 'no-call-in-condition': noCallInConditionRule,\n 'no-grouped-condition': noGroupedConditionRule,\n 'no-inline-object-types': noInlineObjectTypesRule,\n 'no-inline-return-object': noInlineReturnObjectRule,\n 'no-nested-object-value': noNestedObjectValueRule,\n 'no-spread-expression': noSpreadExpressionRule,\n 'no-unused-exports': noUnusedExportsRule,\n 'one-line-guard': oneLineGuardRule,\n 'readonly-type-properties': readonlyTypePropertiesRule,\n 'ternary-branch-shape': ternaryBranchShapeRule,\n 'test-file-shape': testFileShapeRule,\n 'type-placement': typePlacementRule,\n 'util-purity': utilPurityRule\n});\n", "import vitestEslint from '@vitest/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\n\nimport { localPlugin } from './typescript-local-plugin.ts';\n\nconst vitestPlugin = {\n vitest: vitestEslint,\n local: localPlugin\n};\n\nexport const vitest = defineConfig([\n {\n files: ['**/*.spec.ts', '**/*.spec.js', '**/*.test.ts', '**/*.test.js'],\n plugins: vitestPlugin,\n rules: {\n ...vitestEslint.configs.recommended.rules,\n 'vitest/max-nested-describe': ['error', { max: 3 }],\n // Matcher improvements\n 'vitest/prefer-to-be': 'error',\n 'vitest/prefer-to-contain': 'error',\n 'vitest/prefer-to-have-length': 'error',\n 'vitest/prefer-comparison-matcher': 'error',\n 'vitest/prefer-strict-equal': 'warn',\n // Test quality\n 'vitest/prefer-spy-on': 'error',\n 'vitest/prefer-hooks-on-top': 'error',\n 'vitest/prefer-each': 'warn',\n 'vitest/no-test-return-statement': 'error',\n 'vitest/prefer-mock-promise-shorthand': 'error'\n }\n }\n]);\n", "import type { ConfigArray } from 'typescript-eslint';\n\nimport { angularTemplate } from './lib/angular-template.ts';\nimport { angular } from './lib/angular.ts';\nimport { base } from './lib/base.ts';\nimport { boundaries } from './lib/boundaries.ts';\nimport { javascript } from './lib/javascript.ts';\nimport { json } from './lib/json.ts';\nimport { playwright } from './lib/playwright.ts';\nimport { prettier } from './lib/prettier.ts';\nimport { rxjs } from './lib/rxjs.ts';\nimport { storybook } from './lib/storybook.ts';\nimport { typescript } from './lib/typescript.ts';\nimport { vitest } from './lib/vitest.ts';\n\nexport const recommended: ConfigArray = [\n ...base,\n ...javascript,\n ...typescript,\n ...json,\n ...boundaries,\n ...prettier // Must be last to disable formatting rules that conflict with Prettier\n];\n\nexport {\n base,\n javascript,\n typescript,\n angular,\n angularTemplate,\n rxjs,\n json,\n boundaries,\n storybook,\n vitest,\n playwright,\n prettier\n};\n"],
5
+ "mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,oBAAoB;;;ACItB,IAAM,eAAe,CAAC,MAAc,UAAmC;AAC5E,QAAMA,SAAO,EAAE,KAAK;AACpB,QAAM,SAAS,EAAE,MAAAA,QAAM,MAAM;AAE7B,SAAO;AACT;;;ACRA,SAAS,mBAAmB;;;ACF5B,SAAS,kBAAkB;AAC3B,SAAS,WAAAC,UAAS,eAAe;;;ACDjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACZP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,YAAY;AAM9B,IAAM,uBAAuB;AAE7B,IAAM,SAAS,oBAAI,IAAwB;AAE3C,IAAI,oBAAoB;AAExB,IAAM,iBAAiB,MAAqB;AAC1C,QAAM,EAAE,kBAAkB,qBAAqB,IAAI,QAAQ;AAC3D,QAAM,aAAa,qBAAqB;AAExC,MAAI,WAAY,QAAO;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O,CAAC,gBAAgB;AAAA,IACxB,OAAO;AAAA;AAAA,MAEL,2CAA2C;AAAA,IAC7C;AAAA,EACF;AACF,CAAC;;;ALrJM,IAAM,aAAaC,eAAa;AAAA,EACrC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL,CAAC;;;AmDdD,OAAO,kBAAkB;AACzB,SAAS,gBAAAC,sBAAoB;AAI7B,IAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AACT;AAEO,IAAM,SAASC,eAAa;AAAA,EACjC;AAAA,IACE,OAAO,CAAC,gBAAgB,gBAAgB,gBAAgB,cAAc;AAAA,IACtE,SAAS;AAAA,IACT,OAAO;AAAA,MACL,GAAG,aAAa,QAAQ,YAAY;AAAA,MACpC,8BAA8B,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;AAAA;AAAA,MAElD,uBAAuB;AAAA,MACvB,4BAA4B;AAAA,MAC5B,gCAAgC;AAAA,MAChC,oCAAoC;AAAA,MACpC,8BAA8B;AAAA;AAAA,MAE9B,wBAAwB;AAAA,MACxB,8BAA8B;AAAA,MAC9B,sBAAsB;AAAA,MACtB,mCAAmC;AAAA,MACnC,wCAAwC;AAAA,IAC1C;AAAA,EACF;AACF,CAAC;;;AChBM,IAAM,cAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AACL;",
6
+ "names": ["meta", "dirname", "text", "cache", "parse", "text", "dirname", "base", "dirname", "dirname", "dirname", "existsSync", "dirname", "join", "resolve", "collect", "dirname", "key", "ParseSourceSpan", "key", "text", "ParseSourceSpan", "stylesheets", "report", "configs", "defineConfig", "ESLintUtils", "isIdentifier", "isNamespaceImport", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "dirname", "resolve", "TSESTree", "TSESTree", "metadataValue", "Lexer", "ParseLocation", "ParseSourceFile", "ParseSourceSpan", "Parser", "readFileSync", "statSync", "KeyedRead", "SafeKeyedRead", "KeyedRead", "SafeKeyedRead", "parser", "Parser", "Lexer", "statSync", "readFileSync", "ParseSourceFile", "ParseLocation", "ParseSourceSpan", "TSESTree", "resolve", "dirname", "metadataValue", "report", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "TSESTree", "isDeleteExpression", "TSESTree", "isIdentifier", "isStringLiteralLike", "angularClass", "key", "dirname", "normalize", "readFileSync", "statSync", "dirname", "isIdentifier", "isStringLiteralLike", "R3TargetBinder", "ThisReceiver", "parseTemplate", "isIdentifier", "isObjectLiteralExpression", "isStringLiteralLike", "isThisExpression", "CombinedRecursiveAstVisitor", "ImplicitReceiver", "KeyedRead", "PropertyRead", "SafeKeyedRead", "SafePropertyRead", "ThisReceiver", "PropertyRead", "SafePropertyRead", "ImplicitReceiver", "ThisReceiver", "ReadCollector", "CombinedRecursiveAstVisitor", "KeyedRead", "SafeKeyedRead", "text", "templateBinder", "R3TargetBinder", "ThisReceiver", "key", "parseTemplate", "angularClass", "ReadCollector", "templateReads", "memberNameOf", "isIdentifier", "isStringLiteralLike", "statSync", "dirname", "angularClass", "readFileSync", "templateReads", "forEachChild", "isClassLike", "SyntaxKind", "isIdentifier", "isPrivateIdentifier", "isStringLiteralLike", "memberNames", "propertyName", "isIdentifier", "isPrivateIdentifier", "isStringLiteralLike", "SyntaxKind", "SyntaxKind", "isArrayLiteralExpression", "isObjectLiteralExpression", "isArrayLiteralExpression", "isObjectLiteralExpression", "isPropertyAssignment", "isArrayLiteralExpression", "isObjectLiteralExpression", "isPropertyAssignment", "propertyName", "isIdentifier", "isOmittedExpression", "nestedPattern", "propertyName", "isIdentifier", "arrayElementRead", "isOmittedExpression", "SyntaxKind", "isArrayLiteralExpression", "isObjectLiteralExpression", "SyntaxKind", "isArrayLiteralExpression", "isBinaryExpression", "isObjectLiteralExpression", "isPropertyAssignment", "isSpreadAssignment", "isWriteOnly", "isThisExpression", "isWriteTarget", "isWriteOnly", "isClassLike", "forEachChild", "TypeFlags", "base", "fileEntry", "canHaveDecorators", "forEachChild", "getDecorators", "isCallExpression", "isClassLike", "isObjectLiteralExpression", "SyntaxKind", "isArrayLiteralExpression", "isClassLike", "isIdentifier", "isPropertyAccessExpression", "SymbolFlags", "canHaveDecorators", "getDecorators", "isCallExpression", "isStringLiteralLike", "parentOf", "dirname", "resolve", "isIdentifier", "isNumericLiteral", "isPropertyAccessExpression", "isPropertyAssignment", "isStringLiteralLike", "isStringLiteralLike", "isIdentifier", "isPropertyAccessExpression", "isPropertyAssignment", "isNumericLiteral", "text", "resolve", "dirname", "SyntaxKind", "isClassLike", "isIdentifier", "isPropertyAccessExpression", "isArrayLiteralExpression", "base", "isObjectLiteralExpression", "canHaveDecorators", "getDecorators", "isCallExpression", "isClassLike", "forEachChild", "key", "canHaveDecorators", "forEachChild", "getDecorators", "isClassLike", "isIdentifier", "isStringLiteralLike", "dirname", "normalize", "isIdentifier", "isStringLiteralLike", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "ruleDefaults", "defaultOptions", "createRule", "ESLintUtils", "defineConfig", "configs", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "configs", "defineConfig", "defineConfig", "defineConfig", "configs", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "defineConfig", "configs", "defineConfig", "importPluginX", "defineConfig", "ESLintUtils", "TSESTree", "docs", "messages", "schema", "meta", "createRule", "report", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "report", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "ESLintUtils", "TSESTree", "report", "ESLintUtils", "TSESTree", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "defaultOptions", "createRule", "ESLintUtils", "TSESTree", "memberName", "text", "suggestionOf", "suggestionFor", "meta", "defaultOptions", "report", "ESLintUtils", "TSESTree", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "createRule", "defaultOptions", "report", "ESLintUtils", "TSESTree", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "ruleDefaults", "defaultOptions", "ASTUtils", "TSESTree", "ASTUtils", "TSESTree", "TSESTree", "ASTUtils", "createRule", "ESLintUtils", "TSESTree", "suggestionsOf", "report", "meta", "defaultOptions", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "reportRoot", "report", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "report", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "ESLintUtils", "TSESTree", "report", "ESLintUtils", "TSESTree", "sources", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "defaultOptions", "TSESTree", "TSESTree", "enclosingStatement", "createRule", "ESLintUtils", "TSESTree", "key", "enclosingStatement", "meta", "defaultOptions", "isExemptFile", "report", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "ESLintUtils", "TSESTree", "enclosingStatement", "report", "ESLintUtils", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "ruleDefaults", "defaultOptions", "dirname", "key", "key", "SyntaxKind", "forEachChild", "isCallExpression", "isImportDeclaration", "resolve", "SyntaxKind", "isFunctionDeclaration", "isIdentifier", "addImport", "resolve", "isCallExpression", "SyntaxKind", "forEachChild", "isImportDeclaration", "fileEdges", "key", "dirname", "key", "TSESTree", "report", "createRule", "ESLintUtils", "meta", "defaultOptions", "ESLintUtils", "TSESTree", "docs", "messages", "properties", "schema", "meta", "createRule", "defaultOptions", "report", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "propertyName", "report", "ESLintUtils", "TSESTree", "docs", "messages", "meta", "createRule", "report", "ESLintUtils", "docs", "messages", "meta", "defaultOptions", "TSESTree", "isUnderTestingLib", "TSESTree", "TSESTree", "isUnderTestingLib", "TSESTree", "createRule", "ESLintUtils", "report", "meta", "defaultOptions", "ESLintUtils", "TSESTree", "docs", "messages", "stringItems", "properties", "optionsSchema", "schema", "meta", "defaultOptions", "FIXTURES_SEGMENT", "createRule", "ESLintUtils", "TSESTree", "isConstVariableDeclaration", "base", "meta", "defaultOptions", "ESLintUtils", "TSESTree", "docs", "messages", "stringItems", "properties", "optionsSchema", "schema", "meta", "defaultOptions", "createRule", "ESLintUtils", "TSESTree", "memberName", "propertyName", "report", "base", "meta", "defaultOptions", "defineConfig", "defineConfig", "defineConfig", "defineConfig"]
7
7
  }