@interlace/eslint-devkit 2.1.1 → 2.2.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 (155) hide show
  1. package/package.json +1 -6
  2. package/src/aria-definitions.js +1 -1
  3. package/src/ast/ast-utils.d.ts +1 -1
  4. package/src/ast/module-binding.d.ts +1 -1
  5. package/src/ast/spellings.d.ts +1 -1
  6. package/src/ast/static-expression.d.ts +1 -1
  7. package/src/ast/type-syntax.d.ts +1 -1
  8. package/src/ast-node-types.d.ts +1 -1
  9. package/src/index.d.ts +6 -3
  10. package/src/resolver/dependency-analysis.d.ts +29 -0
  11. package/src/resolver/dependency-analysis.js +1 -1
  12. package/src/rule-creation/browser-escape-hatch-rule.d.ts +1 -1
  13. package/src/rule-creation/connection-config.d.ts +1 -1
  14. package/src/rule-creation/driver-origin.d.ts +1 -1
  15. package/src/rule-creation/generated-file.d.ts +1 -1
  16. package/src/rule-creation/hardcoded-credentials-rule.d.ts +9 -2
  17. package/src/rule-creation/mass-assignment-rule.d.ts +9 -2
  18. package/src/rule-creation/message-source.d.ts +1 -1
  19. package/src/rule-creation/minified-file.d.ts +1 -1
  20. package/src/rule-creation/mock-context.d.ts +1 -1
  21. package/src/rule-creation/module-evidence.d.ts +1 -1
  22. package/src/rule-creation/raw-identifier-rule.d.ts +9 -2
  23. package/src/rule-creation/request-source.d.ts +1 -1
  24. package/src/rule-creation/require-tls-rule.d.ts +8 -2
  25. package/src/rule-creation/rule-creator.d.ts +1 -1
  26. package/src/rule-creation/rule-creator.js +1 -1
  27. package/src/rule-creation/sdk-api-key-rule.d.ts +1 -1
  28. package/src/rule-creation/sdk-flow.d.ts +1 -1
  29. package/src/rule-creation/sql-injection-rule.d.ts +8 -2
  30. package/src/rule-creation/sql-position.d.ts +1 -1
  31. package/src/rule-creation/sql-safety.d.ts +1 -1
  32. package/src/rule-creation/system-prompt-injection-rule.d.ts +1 -1
  33. package/src/rule-creation/unscoped-mutation-rule.d.ts +9 -2
  34. package/src/rule-creation/value-follow.d.ts +1 -1
  35. package/src/security/security-utils.d.ts +1 -1
  36. package/src/types/estree/project-service/createProjectService.d.ts +67 -0
  37. package/src/types/estree/project-service/index.d.ts +3 -0
  38. package/src/types/estree/scope-manager/ScopeManager.d.ts +77 -0
  39. package/src/types/estree/scope-manager/analyze.d.ts +55 -0
  40. package/src/types/estree/scope-manager/definition/CatchClauseDefinition.d.ts +10 -0
  41. package/src/types/estree/scope-manager/definition/ClassNameDefinition.d.ts +10 -0
  42. package/src/types/estree/scope-manager/definition/Definition.d.ts +14 -0
  43. package/src/types/estree/scope-manager/definition/DefinitionBase.d.ts +35 -0
  44. package/src/types/estree/scope-manager/definition/DefinitionType.d.ts +15 -0
  45. package/src/types/estree/scope-manager/definition/FunctionNameDefinition.d.ts +10 -0
  46. package/src/types/estree/scope-manager/definition/ImplicitGlobalVariableDefinition.d.ts +10 -0
  47. package/src/types/estree/scope-manager/definition/ImportBindingDefinition.d.ts +11 -0
  48. package/src/types/estree/scope-manager/definition/ParameterDefinition.d.ts +14 -0
  49. package/src/types/estree/scope-manager/definition/TSEnumMemberDefinition.d.ts +10 -0
  50. package/src/types/estree/scope-manager/definition/TSEnumNameDefinition.d.ts +10 -0
  51. package/src/types/estree/scope-manager/definition/TSModuleNameDefinition.d.ts +10 -0
  52. package/src/types/estree/scope-manager/definition/TypeDefinition.d.ts +10 -0
  53. package/src/types/estree/scope-manager/definition/VariableDefinition.d.ts +10 -0
  54. package/src/types/estree/scope-manager/definition/index.d.ts +15 -0
  55. package/src/types/estree/scope-manager/index.d.ts +10 -0
  56. package/src/types/estree/scope-manager/referencer/PatternVisitor.d.ts +16 -0
  57. package/src/types/estree/scope-manager/referencer/Reference.d.ts +88 -0
  58. package/src/types/estree/scope-manager/referencer/Referencer.d.ts +28 -0
  59. package/src/types/estree/scope-manager/referencer/Visitor.d.ts +13 -0
  60. package/src/types/estree/scope-manager/referencer/VisitorBase.d.ts +22 -0
  61. package/src/types/estree/scope-manager/referencer/index.d.ts +3 -0
  62. package/src/types/estree/scope-manager/scope/BlockScope.d.ts +10 -0
  63. package/src/types/estree/scope-manager/scope/CatchScope.d.ts +10 -0
  64. package/src/types/estree/scope-manager/scope/ClassFieldInitializerScope.d.ts +10 -0
  65. package/src/types/estree/scope-manager/scope/ClassScope.d.ts +10 -0
  66. package/src/types/estree/scope-manager/scope/ClassStaticBlockScope.d.ts +10 -0
  67. package/src/types/estree/scope-manager/scope/ConditionalTypeScope.d.ts +10 -0
  68. package/src/types/estree/scope-manager/scope/ForScope.d.ts +10 -0
  69. package/src/types/estree/scope-manager/scope/FunctionExpressionNameScope.d.ts +11 -0
  70. package/src/types/estree/scope-manager/scope/FunctionScope.d.ts +12 -0
  71. package/src/types/estree/scope-manager/scope/FunctionTypeScope.d.ts +10 -0
  72. package/src/types/estree/scope-manager/scope/GlobalScope.d.ts +18 -0
  73. package/src/types/estree/scope-manager/scope/MappedTypeScope.d.ts +10 -0
  74. package/src/types/estree/scope-manager/scope/ModuleScope.d.ts +10 -0
  75. package/src/types/estree/scope-manager/scope/Scope.d.ts +21 -0
  76. package/src/types/estree/scope-manager/scope/ScopeBase.d.ts +91 -0
  77. package/src/types/estree/scope-manager/scope/ScopeType.d.ts +22 -0
  78. package/src/types/estree/scope-manager/scope/SwitchScope.d.ts +10 -0
  79. package/src/types/estree/scope-manager/scope/TSEnumScope.d.ts +10 -0
  80. package/src/types/estree/scope-manager/scope/TSModuleScope.d.ts +10 -0
  81. package/src/types/estree/scope-manager/scope/TypeScope.d.ts +10 -0
  82. package/src/types/estree/scope-manager/scope/WithScope.d.ts +11 -0
  83. package/src/types/estree/scope-manager/scope/index.d.ts +22 -0
  84. package/src/types/estree/scope-manager/variable/ESLintScopeVariable.d.ts +34 -0
  85. package/src/types/estree/scope-manager/variable/ImplicitLibVariable.d.ts +29 -0
  86. package/src/types/estree/scope-manager/variable/Variable.d.ts +18 -0
  87. package/src/types/estree/scope-manager/variable/VariableBase.d.ts +44 -0
  88. package/src/types/estree/scope-manager/variable/index.d.ts +8 -0
  89. package/src/types/estree/types/generated/ast-spec.d.ts +2215 -0
  90. package/src/types/estree/types/index.d.ts +6 -0
  91. package/src/types/estree/types/lib.d.ts +3 -0
  92. package/src/types/estree/types/parser-options.d.ts +83 -0
  93. package/src/types/estree/types/ts-estree.d.ts +190 -0
  94. package/src/types/estree/typescript-estree/clear-caches.d.ts +11 -0
  95. package/src/types/estree/typescript-estree/create-program/getScriptKind.d.ts +5 -0
  96. package/src/types/estree/typescript-estree/create-program/shared.d.ts +29 -0
  97. package/src/types/estree/typescript-estree/create-program/useProvidedPrograms.d.ts +13 -0
  98. package/src/types/estree/typescript-estree/getModifiers.d.ts +5 -0
  99. package/src/types/estree/typescript-estree/index.d.ts +16 -0
  100. package/src/types/estree/typescript-estree/node-utils.d.ts +191 -0
  101. package/src/types/estree/typescript-estree/parseSettings/ExpiringCache.d.ts +17 -0
  102. package/src/types/estree/typescript-estree/parseSettings/candidateTSConfigRootDirs.d.ts +5 -0
  103. package/src/types/estree/typescript-estree/parseSettings/index.d.ts +128 -0
  104. package/src/types/estree/typescript-estree/parser-options.d.ts +220 -0
  105. package/src/types/estree/typescript-estree/parser.d.ts +19 -0
  106. package/src/types/estree/typescript-estree/simple-traverse.d.ts +13 -0
  107. package/src/types/estree/typescript-estree/ts-estree/estree-to-ts-node-types.d.ts +180 -0
  108. package/src/types/estree/typescript-estree/ts-estree/index.d.ts +5 -0
  109. package/src/types/estree/typescript-estree/ts-estree/ts-nodes.d.ts +19 -0
  110. package/src/types/estree/typescript-estree/version-check.d.ts +6 -0
  111. package/src/types/estree/typescript-estree/version.d.ts +3 -0
  112. package/src/types/estree/typescript-estree/withoutProjectParserOptions.d.ts +11 -0
  113. package/src/types/estree/utils/ast-utils/eslint-utils/PatternMatcher.d.ts +49 -0
  114. package/src/types/estree/utils/ast-utils/eslint-utils/ReferenceTracker.d.ts +73 -0
  115. package/src/types/estree/utils/ast-utils/eslint-utils/astUtilities.d.ts +85 -0
  116. package/src/types/estree/utils/ast-utils/eslint-utils/index.d.ts +7 -0
  117. package/src/types/estree/utils/ast-utils/eslint-utils/predicates.d.ts +33 -0
  118. package/src/types/estree/utils/ast-utils/eslint-utils/scopeAnalysis.d.ts +18 -0
  119. package/src/types/estree/utils/ast-utils/helpers.d.ts +20 -0
  120. package/src/types/estree/utils/ast-utils/index.d.ts +6 -0
  121. package/src/types/estree/utils/ast-utils/misc.d.ts +12 -0
  122. package/src/types/estree/utils/ast-utils/predicates.d.ts +70 -0
  123. package/src/types/estree/utils/eslint-utils/InferTypesFromRule.d.ts +11 -0
  124. package/src/types/estree/utils/eslint-utils/RuleCreator.d.ts +34 -0
  125. package/src/types/estree/utils/eslint-utils/applyDefault.d.ts +10 -0
  126. package/src/types/estree/utils/eslint-utils/deepMerge.d.ts +16 -0
  127. package/src/types/estree/utils/eslint-utils/getParserServices.d.ts +24 -0
  128. package/src/types/estree/utils/eslint-utils/index.d.ts +8 -0
  129. package/src/types/estree/utils/eslint-utils/nullThrows.d.ts +14 -0
  130. package/src/types/estree/utils/index.d.ts +8 -0
  131. package/src/types/estree/utils/json-schema.d.ts +389 -0
  132. package/src/types/estree/utils/ts-eslint/AST.d.ts +10 -0
  133. package/src/types/estree/utils/ts-eslint/Config.d.ts +293 -0
  134. package/src/types/estree/utils/ts-eslint/ESLint.d.ts +9 -0
  135. package/src/types/estree/utils/ts-eslint/Linter.d.ts +257 -0
  136. package/src/types/estree/utils/ts-eslint/Parser.d.ts +96 -0
  137. package/src/types/estree/utils/ts-eslint/ParserOptions.d.ts +3 -0
  138. package/src/types/estree/utils/ts-eslint/Processor.d.ts +65 -0
  139. package/src/types/estree/utils/ts-eslint/Rule.d.ts +633 -0
  140. package/src/types/estree/utils/ts-eslint/RuleTester.d.ts +185 -0
  141. package/src/types/estree/utils/ts-eslint/Scope.d.ts +44 -0
  142. package/src/types/estree/utils/ts-eslint/SourceCode.d.ts +356 -0
  143. package/src/types/estree/utils/ts-eslint/eslint/ESLintShared.d.ts +383 -0
  144. package/src/types/estree/utils/ts-eslint/eslint/FlatESLint.d.ts +89 -0
  145. package/src/types/estree/utils/ts-eslint/eslint/LegacyESLint.d.ts +74 -0
  146. package/src/types/estree/utils/ts-eslint/index.d.ts +13 -0
  147. package/src/types/estree/utils/ts-estree.d.ts +5 -0
  148. package/src/types/estree/utils/ts-utils/NoInfer.d.ts +11 -0
  149. package/src/types/estree/utils/ts-utils/index.d.ts +4 -0
  150. package/src/types/estree/utils/ts-utils/isArray.d.ts +3 -0
  151. package/src/types/estree/visitor-keys/get-keys.d.ts +4 -0
  152. package/src/types/estree/visitor-keys/index.d.ts +4 -0
  153. package/src/types/estree/visitor-keys/visitor-keys.d.ts +4 -0
  154. package/src/types/meta-augmentation.d.ts +1 -1
  155. package/src/types/type-utils.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interlace/eslint-devkit",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "ESLint plugin toolkit for building ESLint plugins in TypeScript — AST helpers, type utilities, rule-creation scaffolding, security benchmarks, and SARIF output.",
5
5
  "type": "commonjs",
6
6
  "sideEffects": false,
@@ -46,7 +46,6 @@
46
46
  "custom-rules",
47
47
  "rule-authoring",
48
48
  "typescript",
49
- "typescript-eslint",
50
49
  "utilities",
51
50
  "ast",
52
51
  "ast-utils",
@@ -66,7 +65,6 @@
66
65
  "node": "^20.19.0 || ^22.13.0 || >=24"
67
66
  },
68
67
  "peerDependencies": {
69
- "@typescript-eslint/utils": "^7.0.0 || ^8.0.0",
70
68
  "eslint": "^8.40.0 || ^9.0.0 || ^10.0.0",
71
69
  "oxc-resolver": "^11.24.2",
72
70
  "typescript": ">=4.8.4"
@@ -75,9 +73,6 @@
75
73
  "eslint": {
76
74
  "optional": true
77
75
  },
78
- "@typescript-eslint/utils": {
79
- "optional": true
80
- },
81
76
  "oxc-resolver": {
82
77
  "optional": true
83
78
  },
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ROLE_SUPPORTED_ARIA_PROPS=exports.GLOBAL_ARIA_PROPS=exports.ARIA_UNSUPPORTED_ELEMENTS=exports.ARIA_REQUIRED_PROPS=exports.ARIA_ATTRIBUTES=exports.ARIA_ROLES=void 0;exports.ARIA_ROLES=new Set(["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","directory","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","marquee","math","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","meter","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem","doc-abstract","doc-acknowledgments","doc-afterword","doc-appendix","doc-backlink","doc-biblioentry","doc-bibliography","doc-biblioref","doc-chapter","doc-colophon","doc-conclusion","doc-cover","doc-credit","doc-credits","doc-dedication","doc-endnote","doc-endnotes","doc-epigraph","doc-epilogue","doc-errata","doc-example","doc-footnote","doc-foreword","doc-glossary","doc-glossref","doc-index","doc-introduction","doc-noteref","doc-notice","doc-pagebreak","doc-pagefooter","doc-pageheader","doc-pagelist","doc-part","doc-preface","doc-prologue","doc-pullquote","doc-qna","doc-subtitle","doc-tip","doc-toc","graphics-document","graphics-object","graphics-symbol"]);exports.ARIA_ATTRIBUTES=new Set(["aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]);exports.ARIA_REQUIRED_PROPS={checkbox:["aria-checked"],combobox:["aria-controls","aria-expanded"],menuitemcheckbox:["aria-checked"],menuitemradio:["aria-checked"],option:["aria-selected"],radio:["aria-checked"],scrollbar:["aria-controls","aria-valuenow"],slider:["aria-valuenow"],spinbutton:["aria-valuemax","aria-valuemin","aria-valuenow"],switch:["aria-checked"]};exports.ARIA_UNSUPPORTED_ELEMENTS=new Set(["base","col","colgroup","head","html","link","meta","param","script","source","style","noscript","picture","slot","template","title","track"]);exports.GLOBAL_ARIA_PROPS=new Set(["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"]);exports.ROLE_SUPPORTED_ARIA_PROPS={alert:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),alertdialog:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),application:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),article:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),banner:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),button:new Set(["aria-expanded","aria-pressed"]),checkbox:new Set(["aria-checked","aria-expanded","aria-readonly","aria-required"]),columnheader:new Set(["aria-expanded","aria-selected","aria-sort"]),combobox:new Set(["aria-expanded","aria-required","aria-activedescendant","aria-autocomplete","aria-readonly","aria-orientation"]),complementary:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),contentinfo:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),dialog:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),heading:new Set(["aria-level"]),grid:new Set(["aria-expanded","aria-level","aria-multiselectable","aria-readonly","aria-activedescendant","aria-orientation"]),gridcell:new Set(["aria-expanded","aria-selected","aria-readonly"]),link:new Set(["aria-expanded"]),listbox:new Set(["aria-expanded","aria-required","aria-orientation","aria-activedescendant","aria-multiselectable"]),log:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),main:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),marquee:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),menu:new Set(["aria-expanded","aria-orientation","aria-activedescendant"]),menubar:new Set(["aria-expanded","aria-orientation","aria-activedescendant"]),menuitem:new Set(["aria-expanded"]),menuitemcheckbox:new Set(["aria-checked"]),menuitemradio:new Set(["aria-checked"]),navigation:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),option:new Set(["aria-selected"]),progressbar:new Set(["aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),radio:new Set(["aria-checked"]),radiogroup:new Set(["aria-required","aria-activedescendant","aria-orientation"]),region:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),row:new Set(["aria-expanded","aria-selected","aria-level"]),rowheader:new Set(["aria-expanded","aria-sort"]),scrollbar:new Set(["aria-controls","aria-orientation","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),search:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),searchbox:new Set(["aria-expanded","aria-activedescendant","aria-autocomplete","aria-readonly"]),separator:new Set(["aria-expanded","aria-orientation","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),slider:new Set(["aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-orientation"]),spinbutton:new Set(["aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-required","aria-readonly"]),status:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),switch:new Set(["aria-checked"]),tab:new Set(["aria-selected"]),table:new Set(["aria-expanded","aria-colcount","aria-rowcount"]),tablist:new Set(["aria-expanded","aria-level","aria-multiselectable","aria-orientation","aria-activedescendant"]),tabpanel:new Set(["aria-expanded"]),term:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),textbox:new Set(["aria-activedescendant","aria-autocomplete","aria-multiline","aria-readonly","aria-required"]),timer:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),toolbar:new Set(["aria-expanded","aria-orientation","aria-activedescendant"]),tooltip:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),tree:new Set(["aria-expanded","aria-multiselectable","aria-required","aria-activedescendant","aria-orientation"]),treegrid:new Set(["aria-expanded","aria-level","aria-multiselectable","aria-readonly","aria-required","aria-activedescendant","aria-orientation"]),treeitem:new Set(["aria-expanded","aria-level","aria-selected"])};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ROLE_SUPPORTED_ARIA_PROPS=exports.GLOBAL_ARIA_PROPS=exports.ARIA_UNSUPPORTED_ELEMENTS=exports.ARIA_REQUIRED_PROPS=exports.ARIA_ATTRIBUTES=exports.ARIA_ROLES=void 0;exports.ARIA_ROLES=new Set(["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","directory","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","marquee","math","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","meter","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem","doc-abstract","doc-acknowledgments","doc-afterword","doc-appendix","doc-backlink","doc-biblioentry","doc-bibliography","doc-biblioref","doc-chapter","doc-colophon","doc-conclusion","doc-cover","doc-credit","doc-credits","doc-dedication","doc-endnote","doc-endnotes","doc-epigraph","doc-epilogue","doc-errata","doc-example","doc-footnote","doc-foreword","doc-glossary","doc-glossref","doc-index","doc-introduction","doc-noteref","doc-notice","doc-pagebreak","doc-pagefooter","doc-pageheader","doc-pagelist","doc-part","doc-preface","doc-prologue","doc-pullquote","doc-qna","doc-subtitle","doc-tip","doc-toc","graphics-document","graphics-object","graphics-symbol"]);exports.ARIA_ATTRIBUTES=new Set(["aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]);exports.ARIA_REQUIRED_PROPS={checkbox:["aria-checked"],combobox:["aria-controls","aria-expanded"],menuitemcheckbox:["aria-checked"],menuitemradio:["aria-checked"],option:["aria-selected"],radio:["aria-checked"],scrollbar:["aria-controls","aria-valuenow"],slider:["aria-valuenow"],spinbutton:["aria-valuemax","aria-valuemin","aria-valuenow"],switch:["aria-checked"]};exports.ARIA_UNSUPPORTED_ELEMENTS=new Set(["base","col","colgroup","head","html","link","meta","param","script","source","style","noscript","picture","slot","template","title","track"]);exports.GLOBAL_ARIA_PROPS=new Set(["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"]);exports.ROLE_SUPPORTED_ARIA_PROPS={alert:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),alertdialog:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),application:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),article:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),banner:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),button:new Set(["aria-expanded","aria-pressed"]),checkbox:new Set(["aria-checked","aria-expanded","aria-readonly","aria-required"]),columnheader:new Set(["aria-expanded","aria-selected","aria-sort"]),combobox:new Set(["aria-expanded","aria-required","aria-activedescendant","aria-autocomplete","aria-readonly","aria-orientation"]),complementary:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),contentinfo:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),dialog:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),heading:new Set(["aria-level"]),grid:new Set(["aria-expanded","aria-level","aria-multiselectable","aria-readonly","aria-activedescendant","aria-orientation"]),gridcell:new Set(["aria-expanded","aria-selected","aria-readonly"]),link:new Set(["aria-expanded"]),listbox:new Set(["aria-expanded","aria-required","aria-orientation","aria-activedescendant","aria-multiselectable"]),log:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),main:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),marquee:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),menu:new Set(["aria-expanded","aria-orientation","aria-activedescendant"]),menubar:new Set(["aria-expanded","aria-orientation","aria-activedescendant"]),menuitem:new Set(["aria-expanded"]),menuitemcheckbox:new Set(["aria-checked"]),menuitemradio:new Set(["aria-checked"]),navigation:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),option:new Set(["aria-selected"]),progressbar:new Set(["aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),radio:new Set(["aria-checked"]),radiogroup:new Set(["aria-required","aria-activedescendant","aria-orientation"]),region:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),row:new Set(["aria-expanded","aria-selected","aria-level"]),rowheader:new Set(["aria-expanded","aria-sort"]),scrollbar:new Set(["aria-controls","aria-orientation","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),search:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),searchbox:new Set(["aria-expanded","aria-activedescendant","aria-autocomplete","aria-readonly"]),separator:new Set(["aria-expanded","aria-orientation","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),slider:new Set(["aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-orientation"]),spinbutton:new Set(["aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-required","aria-readonly"]),status:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),switch:new Set(["aria-checked"]),tab:new Set(["aria-selected","aria-expanded","aria-posinset","aria-setsize"]),table:new Set(["aria-expanded","aria-colcount","aria-rowcount"]),tablist:new Set(["aria-expanded","aria-level","aria-multiselectable","aria-orientation","aria-activedescendant"]),tabpanel:new Set(["aria-expanded"]),term:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),textbox:new Set(["aria-activedescendant","aria-autocomplete","aria-multiline","aria-readonly","aria-required"]),timer:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),toolbar:new Set(["aria-expanded","aria-orientation","aria-activedescendant"]),tooltip:new Set(["aria-expanded","aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-modal","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-roledescription","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]),tree:new Set(["aria-expanded","aria-multiselectable","aria-required","aria-activedescendant","aria-orientation"]),treegrid:new Set(["aria-expanded","aria-level","aria-multiselectable","aria-readonly","aria-required","aria-activedescendant","aria-orientation"]),treeitem:new Set(["aria-expanded","aria-level","aria-selected"])};
@@ -9,7 +9,7 @@
9
9
  * Inspired by typescript-eslint's ast-utils
10
10
  * Provides common utilities for traversing and analyzing AST nodes
11
11
  */
12
- import type { TSESTree } from '@typescript-eslint/utils';
12
+ import type { TSESTree } from '../types/estree/utils/index';
13
13
  /**
14
14
  * Check if a node is a specific type of node
15
15
  */
@@ -27,7 +27,7 @@
27
27
  * // => { module: 'fs', path: ['promises', 'readFile'] }
28
28
  * ```
29
29
  */
30
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
30
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
31
31
  export interface ModuleBinding {
32
32
  /** Module specifier, `node:` stripped and equivalents applied (e.g. `fs`). */
33
33
  module: string;
@@ -34,7 +34,7 @@
34
34
  * node type and say why in a comment — that is a position, and positions are
35
35
  * fine. Silence by omission is not.
36
36
  */
37
- import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
37
+ import type { TSESTree, TSESLint } from '../types/estree/utils/index';
38
38
  /**
39
39
  * The string a node names, in either spelling, or `null` if it does not name
40
40
  * one statically.
@@ -22,7 +22,7 @@
22
22
  * Deliberately conservative: anything not proven static is reported as dynamic, so a
23
23
  * gap here costs a false positive, never a missed vulnerability.
24
24
  */
25
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
25
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
26
26
  export interface StaticExpressionOptions {
27
27
  /**
28
28
  * Treat a `const` binding with a static initializer as static.
@@ -34,7 +34,7 @@
34
34
  * unwrapping is always sound for provenance: `x as string` reads exactly what
35
35
  * `x` reads.
36
36
  */
37
- import type { TSESTree } from '@typescript-eslint/utils';
37
+ import type { TSESTree } from '../types/estree/utils/index';
38
38
  /**
39
39
  * Return the innermost expression, stripping every type-only wrapper.
40
40
  *
@@ -25,5 +25,5 @@
25
25
  * directions, so an upstream addition or rename fails the build rather than
26
26
  * silently shipping a node type our rules can never match.
27
27
  */
28
- import type { AST_NODE_TYPES as UpstreamASTNodeTypes } from '@typescript-eslint/utils';
28
+ import type { AST_NODE_TYPES as UpstreamASTNodeTypes } from './types/estree/utils/index';
29
29
  export declare const AST_NODE_TYPES: typeof UpstreamASTNodeTypes;
package/src/index.d.ts CHANGED
@@ -43,9 +43,12 @@ export { CVSS_RANGES, CWE_MAPPING, CWE_COMPLIANCE_MAPPING, OWASP_DETAILS, OWASP_
43
43
  * and so pulled a 24 MB compiler into every consumer install. `AST_NODE_TYPES`
44
44
  * is now an inlined table (`./ast-node-types`) and `ESLintUtils` is our own
45
45
  * ported shim (`./rule-creation/rule-creator`). Together they take this
46
- * package to zero runtime dependencies. The type-only re-exports below still
47
- * point at `utils` — erased at compile time, so they cost nothing.
46
+ * package to zero runtime dependencies. The type-only re-exports below point
47
+ * at devkit's own vendored declarations (`./types/estree`, generated from the
48
+ * pinned typescript-eslint packages by scripts/vendor-estree-types.ts), so a
49
+ * consumer type-checks without `@typescript-eslint/utils` installed.
48
50
  */
49
51
  export { AST_NODE_TYPES } from './ast-node-types';
50
52
  export { ESLintUtils } from './rule-creation/rule-creator';
51
- export type { TSESLint, TSESTree, ParserServices, } from '@typescript-eslint/utils';
53
+ export type { TSESLint, TSESTree, ParserServices, } from './types/estree/utils/index';
54
+ export type { JSONSchema4 } from './types/estree/utils/json-schema';
@@ -146,6 +146,19 @@ export interface FileSystemCache {
146
146
  minimalCycle: string[];
147
147
  cycleHash: string;
148
148
  }>>;
149
+ /**
150
+ * Targets the graph must not contain: an import that resolves to a path for
151
+ * which this returns true is dropped from the file's edges, so every walker
152
+ * (components, shortest path, breadth-first search) agrees without being
153
+ * told. eslint-plugin-import's `import/extensions` and `import/ignore`
154
+ * settings are this: a file it does not read has no imports, and a cycle
155
+ * through it is invisible.
156
+ *
157
+ * The edges a cache holds depend on this function, so one cache must be used
158
+ * with one function. The caller keys its caches by the settings it builds
159
+ * the function from.
160
+ */
161
+ ignoreTarget?: (resolvedPath: string) => boolean;
149
162
  }
150
163
  /**
151
164
  * Create a new empty cache
@@ -240,6 +253,22 @@ export interface GetImportsOptions {
240
253
  /** External resolver settings */
241
254
  resolverSettings?: ResolverSetting;
242
255
  }
256
+ /**
257
+ * Replace every comment in `source` with spaces (newlines kept, so offsets
258
+ * and line numbers do not move).
259
+ *
260
+ * The import regexes read text, and text has comments: a doc comment that
261
+ * shows `import "core/Engines/x"` made the regex find an edge that the module
262
+ * does not have. eslint-plugin-import parses the file and never sees one.
263
+ *
264
+ * The scan has to know where a comment can NOT start, or it blanks real
265
+ * imports: inside a string (`"http://x"`), a template literal (`` `a/*b` ``,
266
+ * including its `${ }` holes, which are code again), and a regular expression
267
+ * literal (`/'/`). A `/` is a regular expression when the token before it
268
+ * cannot end an expression. A string is closed by a newline, so an apostrophe
269
+ * in JSX text spoils one line, not the file.
270
+ */
271
+ export declare function blankComments(source: string): string;
243
272
  /**
244
273
  * Get all imports from a file
245
274
  *
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.PERFORMANCE_DOCS=void 0;exports.clearExportKindCache=clearExportKindCache;exports.exportKindsOf=exportKindsOf;exports.createLRUCache=createLRUCache;exports.isDefinitelyExternal=isDefinitelyExternal;exports.createFileSystemCache=createFileSystemCache;exports.clearCache=clearCache;exports.invalidateSCCCache=invalidateSCCCache;exports.getFileHash=getFileHash;exports.isCacheValid=isCacheValid;exports.fileExists=fileExists;exports.patternToRegexWithCache=patternToRegexWithCache;exports.shouldIgnoreFileWithCache=shouldIgnoreFileWithCache;exports.resolveImportPath=resolveImportPath;exports.getFileImports=getFileImports;exports.hasOnlyTypeImports=hasOnlyTypeImports;exports.computeSCCsFromFile=computeSCCsFromFile;exports.isFileInCycle=isFileInCycle;exports.findShortestCyclePath=findShortestCyclePath;exports.getCycleForFile=getCycleForFile;exports.detectCycleFromImport=detectCycleFromImport;exports.findAllCircularDependencies=findAllCircularDependencies;exports.getMinimalCycle=getMinimalCycle;exports.getCycleHash=getCycleHash;exports.saveCacheToDisk=saveCacheToDisk;exports.loadCacheFromDisk=loadCacheFromDisk;exports.getFilesNeedingReanalysis=getFilesNeedingReanalysis;exports.isIncrementalAvailable=isIncrementalAvailable;const resolver_1=require("./resolver");const node_fs_1=require("node:fs");const fs_1=require("../node/fs");const path_1=require("../node/path");const LRU_MAX_SIZE=5e4;const EXTERNAL_MODULE_PATTERNS=[/^node:/,/^[a-z@][^/]*$/,/node_modules/];const KNOWN_EXTERNAL_PACKAGES=new Set(["react","react-dom","vue","angular","svelte","lodash","underscore","ramda","rxjs","express","koa","fastify","hapi","axios","fetch","node-fetch","got","fs","path","url","http","https","crypto","util","os","child_process","typescript","eslint","prettier","jest","vitest","mocha","webpack","rollup","vite","esbuild","parcel"]);const IMPORT_REGEX=/import\s+(?:(?:(?!\bfrom\s+['"])[\w*{}\s,]|'[^'\n]*'|"[^"\n]*")+\s+from\s+)?['"]([^'"]+)['"]/g;const DYNAMIC_IMPORT_REGEX=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;const TYPE_IMPORT_REGEX=/import\s+type\s/;const EXPORT_FROM_REGEX=/export\s+\{[\s\S]*?\}\s+from\s+['"]([^'"]+)['"]/g;const BRACED_CLAUSE_ONLY=/^import\s+\{([^}]*)\}\s+from\s+['"]/;const INLINE_TYPE_BINDING=/^type\s+(?!as(?:\s|$))/;function importsOnlyInlineTypes(statement){const clause=BRACED_CLAUSE_ONLY.exec(statement);if(!clause)return false;const bindings=clause[1].split(",").map(binding=>binding.trim()).filter(Boolean);if(!bindings.length)return false;return bindings.every(binding=>INLINE_TYPE_BINDING.test(binding))}const EXPORT_ALL_REGEX=/export\s*\*\s*(?:as\s+[\w$]+\s+)?from\s+['"]([^'"]+)['"]/g;const TOP_LEVEL_REQUIRE_REGEX=/^(?:(?:const|let|var)\s+[\w${}\s,:]+=\s*|import\s+[\w$]+\s*=\s*)?require\s*\(\s*['"]([^'"]+)['"]\s*\)/gm;const exportKindCache=new Map;function clearExportKindCache(){exportKindCache.clear()}function exportKindsOf(target,resolve,visiting=new Set){const hit=exportKindCache.get(target);if(hit)return hit;const kinds=new Map;if(visiting.has(target))return kinds;visiting.add(target);const source=(0,fs_1.readFileSync)(target,"utf-8")??"";const set=(name,kind)=>{if(kinds.get(name)!=="value")kinds.set(name,kind)};for(const m of source.matchAll(/export\s+(?:declare\s+)?(?:abstract\s+)?(?:const|let|var|function|class|enum|namespace|module)\s+([A-Za-z_$][\w$]*)/g)){set(m[1],"value")}for(const m of source.matchAll(/export\s+(?:declare\s+)?(?:interface|type)\s+([A-Za-z_$][\w$]*)/g)){set(m[1],"type")}if(resolve){const local=new Map;for(const m of source.matchAll(/^(?:export\s+)?(?:declare\s+)?(?:abstract\s+)?(?:(const|let|var|function|class|enum|namespace|module)|(interface|type))\s+([A-Za-z_$][\w$]*)/gm)){if(local.get(m[3])!=="value")local.set(m[3],m[1]?"value":"type")}const kindIn=(from,name)=>{if(from===void 0)return local.get(name);const file=resolve(from,target);return file?exportKindsOf(file,resolve,visiting).get(name):void 0};for(const m of source.matchAll(/export\s+(type\s+)?\{([^}]*)\}(?:\s*from\s*['"]([^'"]+)['"])?/g)){for(const raw of m[2].split(",")){const spec=raw.trim();if(!spec)continue;const inlineType=/^type\s+(?!as(?:\s|$))/.test(spec);const[orig,alias]=spec.replace(/^type\s+(?!as(?:\s|$))/,"").split(/\s+as\s+/);const exported=(alias??orig).trim();const kind=m[1]||inlineType?"type":kindIn(m[3],orig.trim());if(kind)set(exported,kind)}}for(const m of source.matchAll(/export\s+(type\s+)?\*\s*from\s*['"]([^'"]+)['"]/g)){const file=resolve(m[2],target);if(!file)continue;for(const[name,kind]of exportKindsOf(file,resolve,visiting)){if(!kinds.has(name))kinds.set(name,m[1]?"type":kind)}}}visiting.delete(target);exportKindCache.set(target,kinds);return kinds}function importsOnlyTypesFrom(statement,target,resolve){const clause=BRACED_CLAUSE_ONLY.exec(statement);if(!clause)return false;const bindings=clause[1].split(",").map(binding=>binding.trim()).filter(Boolean);if(!bindings.length)return false;const kinds=exportKindsOf(target,resolve);return bindings.every(binding=>INLINE_TYPE_BINDING.test(binding)||kinds.get(binding.split(/\s+as\s+/)[0])==="type")}const DEFAULT_EXTENSIONS=[".ts",".tsx",".js",".jsx"];class LRUCache{cache=new Map;maxSize;constructor(maxSize=LRU_MAX_SIZE){this.maxSize=maxSize}get(key){const value=this.cache.get(key);if(value!==void 0){this.cache.delete(key);this.cache.set(key,value)}return value}set(key,value){if(this.cache.has(key)){this.cache.delete(key)}else if(this.cache.size>=this.maxSize){const firstKey=this.cache.keys().next().value;if(firstKey!==void 0){this.cache.delete(firstKey)}}this.cache.set(key,value)}has(key){return this.cache.has(key)}delete(key){return this.cache.delete(key)}clear(){this.cache.clear()}get size(){return this.cache.size}}function createLRUCache(maxSize=LRU_MAX_SIZE){return new LRUCache(maxSize)}function isDefinitelyExternal(importPath){const packageName=importPath.split("/")[0].replace(/^@[^/]+\//,"");if(KNOWN_EXTERNAL_PACKAGES.has(packageName)){return true}return EXTERNAL_MODULE_PATTERNS.some(pattern=>pattern.test(importPath))}function createFileSystemCache(){return{dependencies:new Map,fileExists:new Map,fileHashes:new Map,compiledPatterns:(0,path_1.createPatternCache)(),reportedCycles:new Set,sccIndex:new Map,sccs:[],sccComputed:false,graphHash:"",resolvedPaths:new Map,nonCyclicFiles:new Set,pendingCycleReports:new Map}}function clearCache(cache){cache.dependencies.clear();cache.fileExists.clear();cache.fileHashes.clear();cache.compiledPatterns.clear();cache.reportedCycles.clear();cache.sccIndex.clear();cache.sccs=[];cache.sccComputed=false;cache.graphHash="";cache.resolvedPaths=new Map;cache.nonCyclicFiles.clear();cache.pendingCycleReports.clear()}function invalidateSCCCache(cache){cache.sccIndex.clear();cache.sccs=[];cache.sccComputed=false;cache.nonCyclicFiles.clear()}function getFileHash(filePath){const stats=(0,fs_1.statSync)(filePath);if(!stats){return null}return`${stats.mtimeMs}-${stats.size}`}function isCacheValid(filePath,cache){const cachedHash=cache.fileHashes.get(filePath);if(!cachedHash)return false;const currentHash=getFileHash(filePath);return cachedHash===currentHash}function fileExists(filePath,cache){const cached=cache.fileExists.get(filePath);if(cached!==void 0){return cached}const exists=(0,fs_1.fileExistsSync)(filePath);cache.fileExists.set(filePath,exists);return exists}function patternToRegexWithCache(pattern,cache){return(0,path_1.patternToRegex)(pattern,cache.compiledPatterns)}function shouldIgnoreFileWithCache(file,patterns,cache){return(0,path_1.shouldIgnoreFile)(file,patterns,cache.compiledPatterns)}function resolveImportPath(importPath,options){const fromFile=options.fromFile;const extensions=options.extensions||DEFAULT_EXTENSIONS;const cache=options.cache;const resolverSettings=options.resolverSettings;if(isDefinitelyExternal(importPath)){if(!importPath.startsWith("@")){return null}}const isRelative=importPath.startsWith(".");if(!isRelative){const globalCached=cache.resolvedPaths.get(importPath);if(globalCached!==void 0){return globalCached}}const cacheKey=isRelative?`${fromFile}::${importPath}`:importPath;const cached=cache.resolvedPaths.get(cacheKey);if(cached!==void 0){return cached}let result=(0,resolver_1.resolveModule)(importPath,fromFile,{extensions,mainFields:["module","main"],resolverSettings});if(result&&!isRelative&&result.includes("node_modules")){try{const realPath=(0,node_fs_1.realpathSync)(result);if(realPath.includes("node_modules")){cache.resolvedPaths.set(cacheKey,null);return null}result=realPath}catch{cache.resolvedPaths.set(cacheKey,null);return null}}if(!result&&isRelative){result=(0,path_1.resolvePath)((0,path_1.getDirname)(fromFile),importPath)}cache.resolvedPaths.set(cacheKey,result);return result}function getFileImports(file,options){const{workspaceRoot,barrelExports,cache,resolverSettings}=options;const cached=cache.dependencies.get(file);if(cached){return cached}const imports=[];try{if(!fileExists(file,cache)){return imports}const content=(0,fs_1.readFileSync)(file,"utf-8");if(content===null){return imports}const resolveOpts={fromFile:file,workspaceRoot,barrelExports,cache,extensions:DEFAULT_EXTENSIONS,resolverSettings};IMPORT_REGEX.lastIndex=0;DYNAMIC_IMPORT_REGEX.lastIndex=0;EXPORT_FROM_REGEX.lastIndex=0;let match;const seen=new Map;const pushImport=(importPath,dynamic=false,typeOnly=false,inlineTypeOnly=false)=>{const resolved=resolveImportPath(importPath,resolveOpts);if(!resolved||!fileExists(resolved,cache))return;const existing=seen.get(resolved);if(existing){if(dynamic)return;if(!typeOnly&&!inlineTypeOnly){delete existing.typeOnly;delete existing.inlineTypeOnly}else if(inlineTypeOnly&&existing.typeOnly){delete existing.typeOnly;existing.inlineTypeOnly=true}return}const info={path:resolved,source:importPath};if(dynamic)info.dynamic=true;if(typeOnly)info.typeOnly=true;if(inlineTypeOnly)info.inlineTypeOnly=true;seen.set(resolved,info);imports.push(info)};while((match=IMPORT_REGEX.exec(content))!==null){const isTypeImport=/^import\s+type[\s{]/.test(match[0]);let inlineTypeOnly=false;if(!isTypeImport){const target=resolveImportPath(match[1],resolveOpts);inlineTypeOnly=importsOnlyInlineTypes(match[0])||target!==null&&importsOnlyTypesFrom(match[0],target,(spec,fromFile)=>resolveImportPath(spec,{...resolveOpts,fromFile}))}pushImport(match[1],false,isTypeImport,inlineTypeOnly)}while((match=EXPORT_FROM_REGEX.exec(content))!==null)pushImport(match[1]);EXPORT_ALL_REGEX.lastIndex=0;while((match=EXPORT_ALL_REGEX.exec(content))!==null)pushImport(match[1]);TOP_LEVEL_REQUIRE_REGEX.lastIndex=0;while((match=TOP_LEVEL_REQUIRE_REGEX.exec(content))!==null)pushImport(match[1]);while((match=DYNAMIC_IMPORT_REGEX.exec(content))!==null)pushImport(match[1],true);const hash=getFileHash(file);if(hash){const oldHash=cache.fileHashes.get(file);if(oldHash!==hash){invalidateSCCCache(cache)}cache.fileHashes.set(file,hash)}}catch{}cache.dependencies.set(file,imports);return imports}function hasOnlyTypeImports(cycle,cache){for(const file of cycle){if(!fileExists(file,cache))continue;const content=(0,fs_1.readFileSync)(file,"utf-8");if(content===null)return false;const hasRuntimeImport=!TYPE_IMPORT_REGEX.test(content)&&IMPORT_REGEX.test(content);IMPORT_REGEX.lastIndex=0;if(hasRuntimeImport){return false}}return true}function computeSCCsFromFile(startFile,options){try{startFile=(0,node_fs_1.realpathSync)(startFile)}catch{}const{workspaceRoot,barrelExports,cache,resolverSettings}=options;if(cache.sccComputed&&cache.sccs.length>0&&cache.sccIndex.has(startFile)){return cache.sccs}const state={index:0,stack:[],onStack:new Set,indices:new Map,lowlinks:new Map,sccs:[]};const visited=new Set;const filesToProcess=[startFile];while(filesToProcess.length>0){const file=filesToProcess.pop();if(visited.has(file))continue;visited.add(file);const imports=getFileImports(file,{workspaceRoot,barrelExports,cache,resolverSettings});for(const imp of imports){if(!imp.dynamic&&!isErasedEdge(imp,options)&&!visited.has(imp.path)){filesToProcess.push(imp.path)}}}for(const file of visited){if(!state.indices.has(file)){tarjanStrongConnect(file,state,options,0)}}const newResults=state.sccs.map(files=>({files,hasCycle:files.length>1}));const offset=cache.sccs.length;cache.sccs.push(...newResults);cache.sccComputed=true;for(let i=0;i<newResults.length;i++){for(const file of newResults[i].files){if(!cache.sccIndex.has(file)){cache.sccIndex.set(file,offset+i)}}}for(const result of newResults){if(result.hasCycle){for(const file of result.files){cache.nonCyclicFiles.delete(file)}}else{for(const file of result.files){cache.nonCyclicFiles.add(file)}}}return cache.sccs}function tarjanStrongConnect(file,state,options,depth){const{maxDepth,workspaceRoot,barrelExports,cache,resolverSettings}=options;if(depth>maxDepth){return}const enter=(node,nodeDepth)=>{state.indices.set(node,state.index);state.lowlinks.set(node,state.index);state.index++;state.stack.push(node);state.onStack.add(node);const imports=getFileImports(node,{workspaceRoot,barrelExports,cache,resolverSettings});const successors=[];for(const imp of imports){if(imp.dynamic||isErasedEdge(imp,options))continue;successors.push(imp.path)}return{file:node,depth:nodeDepth,successors,next:0}};const relax=(node,candidate)=>{state.lowlinks.set(node,Math.min(state.lowlinks.get(node),candidate))};const frames=[enter(file,depth)];while(frames.length>0){const frame=frames[frames.length-1];if(frame.next<frame.successors.length){const successor=frame.successors[frame.next++];if(!state.indices.has(successor)){if(frame.depth+1>maxDepth){relax(frame.file,0);continue}frames.push(enter(successor,frame.depth+1))}else if(state.onStack.has(successor)){relax(frame.file,state.indices.get(successor))}continue}frames.pop();const lowlink=state.lowlinks.get(frame.file);const index=state.indices.get(frame.file);if(lowlink===index){const scc=[];let w;do{w=state.stack.pop();state.onStack.delete(w);scc.push(w)}while(w!==frame.file);state.sccs.push(scc)}const parent=frames[frames.length-1];if(parent){relax(parent.file,state.lowlinks.get(frame.file))}}}function isFileInCycle(file,cache){const sccIndex=cache.sccIndex.get(file);if(sccIndex===void 0)return false;const scc=cache.sccs[sccIndex];return scc&&scc.hasCycle}function findShortestCyclePath(sourceFile,targetFile,options){const{workspaceRoot,barrelExports,cache,resolverSettings}=options;const maxDepth=options.maxDepth??Infinity;const srcSCC=cache.sccIndex.get(sourceFile);if(srcSCC===void 0)return null;const queue=[[targetFile]];const visited=new Set([targetFile]);while(queue.length>0){const path=queue.shift();if(path.length>maxDepth)break;const current=path[path.length-1];const imports=getFileImports(current,{workspaceRoot,barrelExports,cache,resolverSettings});for(const imp of imports){if(imp.dynamic||isErasedEdge(imp,options))continue;if(imp.path===sourceFile){return[...path,sourceFile]}if(visited.has(imp.path))continue;if(cache.sccIndex.get(imp.path)!==srcSCC)continue;visited.add(imp.path);queue.push([...path,imp.path])}}return null}function getCycleForFile(file,cache){const sccIndex=cache.sccIndex.get(file);if(sccIndex===void 0)return null;const scc=cache.sccs[sccIndex];if(!scc||!scc.hasCycle)return null;return scc.files}function isErasedEdge(imp,options){if(imp.typeOnly)return true;return Boolean(imp.inlineTypeOnly)&&!options.verbatimModuleSyntax}function detectCycleFromImport(sourceFile,targetFile,options){try{sourceFile=(0,node_fs_1.realpathSync)(sourceFile)}catch{}try{targetFile=(0,node_fs_1.realpathSync)(targetFile)}catch{}const{maxDepth,reportAllCycles,workspaceRoot,barrelExports,cache,resolverSettings}=options;if(cache.nonCyclicFiles.has(targetFile)){return[]}const allCycles=[];const pathStack=[sourceFile];let depthLimitHit=false;function dfs(file,depth,visited2){if(file===sourceFile){allCycles.push([...pathStack,file]);return}if(depth>=maxDepth){depthLimitHit=true;return}if(visited2.has(file))return;if(cache.nonCyclicFiles.has(file))return;visited2.add(file);pathStack.push(file);const imports=getFileImports(file,{workspaceRoot,barrelExports,cache,resolverSettings});for(const imp of imports){if(imp.dynamic)continue;if(!reportAllCycles&&allCycles.length>0)break;dfs(imp.path,depth+1,visited2)}pathStack.pop()}const visited=new Set;dfs(targetFile,1,visited);if(allCycles.length===0&&!depthLimitHit){cache.nonCyclicFiles.add(targetFile)}return allCycles}function findAllCircularDependencies(file,options,currentPath=[],depth=0,visited=new Set){const{maxDepth,reportAllCycles,workspaceRoot,barrelExports,cache,resolverSettings}=options;if(depth===0){try{file=(0,node_fs_1.realpathSync)(file)}catch{}}if(cache.nonCyclicFiles.has(file)){return[]}if(depth===0){computeSCCsFromFile(file,{maxDepth,workspaceRoot,barrelExports,cache,resolverSettings});if(!isFileInCycle(file,cache)){cache.nonCyclicFiles.add(file);return[]}}if(depth>maxDepth){return[]}if(currentPath.includes(file)){return[[...currentPath,file]]}if(visited.has(file)){return[]}visited.add(file);const imports=getFileImports(file,{workspaceRoot,barrelExports,cache,resolverSettings});const newPath=[...currentPath,file];const allCycles=[];for(const imp of imports){if(imp.dynamic){continue}if(!reportAllCycles&&allCycles.length>0){break}const cycles=findAllCircularDependencies(imp.path,options,newPath,depth+1,visited);allCycles.push(...cycles)}if(depth===0&&allCycles.length===0){cache.nonCyclicFiles.add(file)}return allCycles}function getMinimalCycle(cycle){if(cycle.length<2)return cycle;const seen=new Map;for(let i=0;i<cycle.length;i++){const file=cycle[i];if(seen.has(file)){const cycleStart=seen?.get?.(file);return cycle.slice(cycleStart,i+1)}seen.set(file,i)}return cycle}function getCycleHash(cycle){const minimalCycle=getMinimalCycle(cycle);const minIndex=minimalCycle.indexOf(minimalCycle.reduce((min,curr)=>curr<min?curr:min,minimalCycle[0]));const normalized=[...minimalCycle.slice(minIndex),...minimalCycle.slice(0,minIndex)];return normalized.join("->")}const CACHE_VERSION=1;const DEFAULT_CACHE_FILE="node_modules/.cache/forge-eslint/cycles.json";const DEFAULT_MAX_CACHE_AGE=24*60*60*1e3;function saveCacheToDisk(cache,options,workspaceRoot){if(!options.enabled)return;const cacheFile=(0,path_1.resolvePath)(workspaceRoot,options.cacheFile||DEFAULT_CACHE_FILE);const data={version:CACHE_VERSION,createdAt:Date.now(),fileHashes:Object.fromEntries(cache.fileHashes),sccs:cache.sccs,sccIndex:Object.fromEntries(cache.sccIndex),nonCyclicFiles:Array.from(cache.nonCyclicFiles),graphHash:cache.graphHash};const cacheDir=(0,path_1.getDirname)(cacheFile);if(!(0,fs_1.fileExistsSync)(cacheDir)){(0,fs_1.mkdirSync)(cacheDir,{recursive:true})}(0,fs_1.writeFileSync)(cacheFile,JSON.stringify(data),"utf-8")}function loadCacheFromDisk(cache,options,workspaceRoot){if(!options.enabled)return false;const cacheFile=(0,path_1.resolvePath)(workspaceRoot,options.cacheFile||DEFAULT_CACHE_FILE);if(!(0,fs_1.fileExistsSync)(cacheFile)){return false}const content=(0,fs_1.readFileSync)(cacheFile,"utf-8");if(content===null){return false}try{const data=JSON.parse(content);if(data.version!==CACHE_VERSION){return false}const maxAge=options.maxCacheAge??DEFAULT_MAX_CACHE_AGE;if(Date.now()-data.createdAt>maxAge){return false}cache.fileHashes=new Map(Object.entries(data.fileHashes));cache.sccs=data.sccs;cache.sccIndex=new Map(Object.entries(data.sccIndex).map(([k,v])=>[k,v]));cache.nonCyclicFiles=new Set(data.nonCyclicFiles);cache.graphHash=data.graphHash;cache.sccComputed=true;return true}catch{return false}}function getFilesNeedingReanalysis(files,cache,options){if(!options.enabled||!cache.sccComputed){return files}const changedFiles=[];for(const file of files){const cachedHash=cache.fileHashes.get(file);const currentHash=getFileHash(file);if(!cachedHash||cachedHash!==currentHash){changedFiles.push(file)}}if(changedFiles.length>0){const affectedSCCIndices=new Set;for(const file of changedFiles){const sccIndex=cache.sccIndex.get(file);if(sccIndex!==void 0){affectedSCCIndices.add(sccIndex)}}const affectedFiles=new Set(changedFiles);for(const scc of cache.sccs){const sccIndex=cache.sccIndex.get(scc.files[0]);if(sccIndex!==void 0&&affectedSCCIndices.has(sccIndex)){for(const file of scc.files){affectedFiles.add(file);cache.nonCyclicFiles.delete(file)}}}for(const[file,imports]of cache.dependencies){for(const imp of imports){if(changedFiles.includes(imp.path)){affectedFiles.add(file);cache.nonCyclicFiles.delete(file);break}}}return Array.from(affectedFiles)}return[]}function isIncrementalAvailable(cache,options){return Boolean(options?.enabled&&cache.sccComputed&&cache.sccs.length>0)}exports.PERFORMANCE_DOCS={algorithm:"Tarjan SCC + DFS hybrid",timeComplexity:"O(V + E)",spaceComplexity:"O(V)",guaranteedComplete:true};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.PERFORMANCE_DOCS=void 0;exports.clearExportKindCache=clearExportKindCache;exports.exportKindsOf=exportKindsOf;exports.createLRUCache=createLRUCache;exports.isDefinitelyExternal=isDefinitelyExternal;exports.createFileSystemCache=createFileSystemCache;exports.clearCache=clearCache;exports.invalidateSCCCache=invalidateSCCCache;exports.getFileHash=getFileHash;exports.isCacheValid=isCacheValid;exports.fileExists=fileExists;exports.patternToRegexWithCache=patternToRegexWithCache;exports.shouldIgnoreFileWithCache=shouldIgnoreFileWithCache;exports.resolveImportPath=resolveImportPath;exports.blankComments=blankComments;exports.getFileImports=getFileImports;exports.hasOnlyTypeImports=hasOnlyTypeImports;exports.computeSCCsFromFile=computeSCCsFromFile;exports.isFileInCycle=isFileInCycle;exports.findShortestCyclePath=findShortestCyclePath;exports.getCycleForFile=getCycleForFile;exports.detectCycleFromImport=detectCycleFromImport;exports.findAllCircularDependencies=findAllCircularDependencies;exports.getMinimalCycle=getMinimalCycle;exports.getCycleHash=getCycleHash;exports.saveCacheToDisk=saveCacheToDisk;exports.loadCacheFromDisk=loadCacheFromDisk;exports.getFilesNeedingReanalysis=getFilesNeedingReanalysis;exports.isIncrementalAvailable=isIncrementalAvailable;const resolver_1=require("./resolver");const node_fs_1=require("node:fs");const fs_1=require("../node/fs");const path_1=require("../node/path");const LRU_MAX_SIZE=5e4;const EXTERNAL_MODULE_PATTERNS=[/^node:/,/^[a-z@][^/]*$/,/node_modules/];const KNOWN_EXTERNAL_PACKAGES=new Set(["react","react-dom","vue","angular","svelte","lodash","underscore","ramda","rxjs","express","koa","fastify","hapi","axios","fetch","node-fetch","got","fs","path","url","http","https","crypto","util","os","child_process","typescript","eslint","prettier","jest","vitest","mocha","webpack","rollup","vite","esbuild","parcel"]);const IMPORT_REGEX=/import\s+(?:(?:(?!\bfrom\s+['"])[\w*{}\s,]|'[^'\n]*'|"[^"\n]*")+\s+from\s+)?['"]([^'"]+)['"]/g;const DYNAMIC_IMPORT_REGEX=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;const TYPE_IMPORT_REGEX=/import\s+type\s/;const EXPORT_FROM_REGEX=/export\s+\{[\s\S]*?\}\s+from\s+['"]([^'"]+)['"]/g;const BRACED_CLAUSE_ONLY=/^import\s+\{([^}]*)\}\s+from\s+['"]/;const INLINE_TYPE_BINDING=/^type\s+(?!as(?:\s|$))/;function importsOnlyInlineTypes(statement){const clause=BRACED_CLAUSE_ONLY.exec(statement);if(!clause)return false;const bindings=clause[1].split(",").map(binding=>binding.trim()).filter(Boolean);if(!bindings.length)return false;return bindings.every(binding=>INLINE_TYPE_BINDING.test(binding))}const EXPORT_ALL_REGEX=/export\s*\*\s*(?:as\s+[\w$]+\s+)?from\s+['"]([^'"]+)['"]/g;const TOP_LEVEL_REQUIRE_REGEX=/^(?:(?:const|let|var)\s+[\w${}\s,:]+=\s*|import\s+[\w$]+\s*=\s*)?require\s*\(\s*['"]([^'"]+)['"]\s*\)/gm;const exportKindCache=new Map;function clearExportKindCache(){exportKindCache.clear()}function exportKindsOf(target,resolve,visiting=new Set){const hit=exportKindCache.get(target);if(hit)return hit;const kinds=new Map;if(visiting.has(target))return kinds;visiting.add(target);const source=(0,fs_1.readFileSync)(target,"utf-8")??"";const set=(name,kind)=>{if(kinds.get(name)!=="value")kinds.set(name,kind)};for(const m of source.matchAll(/export\s+(?:declare\s+)?(?:abstract\s+)?(?:const|let|var|function|class|enum|namespace|module)\s+([A-Za-z_$][\w$]*)/g)){set(m[1],"value")}for(const m of source.matchAll(/export\s+(?:declare\s+)?(?:interface|type)\s+([A-Za-z_$][\w$]*)/g)){set(m[1],"type")}if(resolve){const local=new Map;for(const m of source.matchAll(/^(?:export\s+)?(?:declare\s+)?(?:abstract\s+)?(?:(const|let|var|function|class|enum|namespace|module)|(interface|type))\s+([A-Za-z_$][\w$]*)/gm)){if(local.get(m[3])!=="value")local.set(m[3],m[1]?"value":"type")}const kindIn=(from,name)=>{if(from===void 0)return local.get(name);const file=resolve(from,target);return file?exportKindsOf(file,resolve,visiting).get(name):void 0};for(const m of source.matchAll(/export\s+(type\s+)?\{([^}]*)\}(?:\s*from\s*['"]([^'"]+)['"])?/g)){for(const raw of m[2].split(",")){const spec=raw.trim();if(!spec)continue;const inlineType=/^type\s+(?!as(?:\s|$))/.test(spec);const[orig,alias]=spec.replace(/^type\s+(?!as(?:\s|$))/,"").split(/\s+as\s+/);const exported=(alias??orig).trim();const kind=m[1]||inlineType?"type":kindIn(m[3],orig.trim());if(kind)set(exported,kind)}}for(const m of source.matchAll(/export\s+(type\s+)?\*\s*from\s*['"]([^'"]+)['"]/g)){const file=resolve(m[2],target);if(!file)continue;for(const[name,kind]of exportKindsOf(file,resolve,visiting)){if(!kinds.has(name))kinds.set(name,m[1]?"type":kind)}}}visiting.delete(target);exportKindCache.set(target,kinds);return kinds}function importsOnlyTypesFrom(statement,target,resolve){const clause=BRACED_CLAUSE_ONLY.exec(statement);if(!clause)return false;const bindings=clause[1].split(",").map(binding=>binding.trim()).filter(Boolean);if(!bindings.length)return false;const kinds=exportKindsOf(target,resolve);return bindings.every(binding=>INLINE_TYPE_BINDING.test(binding)||kinds.get(binding.split(/\s+as\s+/)[0])==="type")}const DEFAULT_EXTENSIONS=[".ts",".tsx",".js",".jsx"];class LRUCache{cache=new Map;maxSize;constructor(maxSize=LRU_MAX_SIZE){this.maxSize=maxSize}get(key){const value=this.cache.get(key);if(value!==void 0){this.cache.delete(key);this.cache.set(key,value)}return value}set(key,value){if(this.cache.has(key)){this.cache.delete(key)}else if(this.cache.size>=this.maxSize){const firstKey=this.cache.keys().next().value;if(firstKey!==void 0){this.cache.delete(firstKey)}}this.cache.set(key,value)}has(key){return this.cache.has(key)}delete(key){return this.cache.delete(key)}clear(){this.cache.clear()}get size(){return this.cache.size}}function createLRUCache(maxSize=LRU_MAX_SIZE){return new LRUCache(maxSize)}function isDefinitelyExternal(importPath){const packageName=importPath.split("/")[0].replace(/^@[^/]+\//,"");if(KNOWN_EXTERNAL_PACKAGES.has(packageName)){return true}return EXTERNAL_MODULE_PATTERNS.some(pattern=>pattern.test(importPath))}function createFileSystemCache(){return{dependencies:new Map,fileExists:new Map,fileHashes:new Map,compiledPatterns:(0,path_1.createPatternCache)(),reportedCycles:new Set,sccIndex:new Map,sccs:[],sccComputed:false,graphHash:"",resolvedPaths:new Map,nonCyclicFiles:new Set,pendingCycleReports:new Map}}function clearCache(cache){cache.dependencies.clear();cache.fileExists.clear();cache.fileHashes.clear();cache.compiledPatterns.clear();cache.reportedCycles.clear();cache.sccIndex.clear();cache.sccs=[];cache.sccComputed=false;cache.graphHash="";cache.resolvedPaths=new Map;cache.nonCyclicFiles.clear();cache.pendingCycleReports.clear()}function invalidateSCCCache(cache){cache.sccIndex.clear();cache.sccs=[];cache.sccComputed=false;cache.nonCyclicFiles.clear()}function getFileHash(filePath){const stats=(0,fs_1.statSync)(filePath);if(!stats){return null}return`${stats.mtimeMs}-${stats.size}`}function isCacheValid(filePath,cache){const cachedHash=cache.fileHashes.get(filePath);if(!cachedHash)return false;const currentHash=getFileHash(filePath);return cachedHash===currentHash}function fileExists(filePath,cache){const cached=cache.fileExists.get(filePath);if(cached!==void 0){return cached}const exists=(0,fs_1.fileExistsSync)(filePath);cache.fileExists.set(filePath,exists);return exists}function patternToRegexWithCache(pattern,cache){return(0,path_1.patternToRegex)(pattern,cache.compiledPatterns)}function shouldIgnoreFileWithCache(file,patterns,cache){return(0,path_1.shouldIgnoreFile)(file,patterns,cache.compiledPatterns)}function resolveImportPath(importPath,options){const fromFile=options.fromFile;const extensions=options.extensions||DEFAULT_EXTENSIONS;const cache=options.cache;const resolverSettings=options.resolverSettings;if(isDefinitelyExternal(importPath)){if(!importPath.startsWith("@")){return null}}const isRelative=importPath.startsWith(".");if(!isRelative){const globalCached=cache.resolvedPaths.get(importPath);if(globalCached!==void 0){return globalCached}}const cacheKey=isRelative?`${fromFile}::${importPath}`:importPath;const cached=cache.resolvedPaths.get(cacheKey);if(cached!==void 0){return cached}let result=(0,resolver_1.resolveModule)(importPath,fromFile,{extensions,mainFields:["module","main"],resolverSettings});if(result&&!isRelative&&result.includes("node_modules")){try{const realPath=(0,node_fs_1.realpathSync)(result);if(realPath.includes("node_modules")){cache.resolvedPaths.set(cacheKey,null);return null}result=realPath}catch{cache.resolvedPaths.set(cacheKey,null);return null}}if(!result&&isRelative){result=(0,path_1.resolvePath)((0,path_1.getDirname)(fromFile),importPath)}cache.resolvedPaths.set(cacheKey,result);return result}const REGEX_AFTER_WORD=new Set(["return","typeof","case","do","else","in","of","void","delete","throw","new","yield","await","instanceof"]);function blankComments(source){if(!source.includes("/*")&&!source.includes("//"))return source;const n=source.length;const ranges=[];let prev="";let word="";function skipQuoted(from){const quote=source[from];let i=from+1;while(i<n&&source[i]!==quote&&source[i]!=="\n"){i+=source[i]==="\\"?2:1}return i+1}function skipRegex(from){let i=from+1;let inClass=false;while(i<n&&source[i]!=="\n"){const c=source[i];if(c==="\\")i++;else if(c==="[")inClass=true;else if(c==="]")inClass=false;else if(c==="/"&&!inClass)return i+1;i++}return i}function scanCode(from,inHole){let i=from;let depth=0;while(i<n){const c=source[i];const next=source[i+1];if(c==="/"&&next==="/"){const end=source.indexOf("\n",i);const stop=end===-1?n:end;ranges.push([i,stop]);i=stop}else if(c==="/"&&next==="*"){const end=source.indexOf("*/",i+2);const stop=end===-1?n:end+2;ranges.push([i,stop]);i=stop}else if(c==='"'||c==="'"){i=skipQuoted(i);prev=c;word=""}else if(c==="`"){i=scanTemplate(i+1);prev=c;word=""}else if(c==="/"&&("(,=:[!&|?{};+-*%<>~^".includes(prev)||REGEX_AFTER_WORD.has(word))){i=skipRegex(i);prev=")";word=""}else if(c==="}"&&inHole&&depth===0){return i}else{if(c==="{")depth++;else if(c==="}")depth--;if(!/\s/.test(c)){if(/[\w$]/.test(c))word=/[\w$]/.test(prev)?word+c:c;else word="";prev=c}i++}}return i}function scanTemplate(from){let i=from;while(i<n&&source[i]!=="`"){if(source[i]==="\\")i+=2;else if(source[i]==="$"&&source[i+1]==="{")i=scanCode(i+2,true)+1;else i++}return i+1}scanCode(0,false);let out="";let at=0;for(const[from,to]of ranges){out+=source.slice(at,from)+source.slice(from,to).replace(/[^\n]/g," ");at=to}return out+source.slice(at)}function getFileImports(file,options){const{workspaceRoot,barrelExports,cache,resolverSettings}=options;const cached=cache.dependencies.get(file);if(cached){return cached}const imports=[];try{if(!fileExists(file,cache)){return imports}const text=(0,fs_1.readFileSync)(file,"utf-8");if(text===null){return imports}const content=blankComments(text);const resolveOpts={fromFile:file,workspaceRoot,barrelExports,cache,extensions:DEFAULT_EXTENSIONS,resolverSettings};IMPORT_REGEX.lastIndex=0;DYNAMIC_IMPORT_REGEX.lastIndex=0;EXPORT_FROM_REGEX.lastIndex=0;let match;const seen=new Map;const pushImport=(importPath,dynamic=false,typeOnly=false,inlineTypeOnly=false)=>{const resolved=resolveImportPath(importPath,resolveOpts);if(!resolved||!fileExists(resolved,cache))return;if(cache.ignoreTarget?.(resolved))return;const existing=seen.get(resolved);if(existing){if(dynamic)return;if(!typeOnly&&!inlineTypeOnly){delete existing.typeOnly;delete existing.inlineTypeOnly}else if(inlineTypeOnly&&existing.typeOnly){delete existing.typeOnly;existing.inlineTypeOnly=true}return}const info={path:resolved,source:importPath};if(dynamic)info.dynamic=true;if(typeOnly)info.typeOnly=true;if(inlineTypeOnly)info.inlineTypeOnly=true;seen.set(resolved,info);imports.push(info)};while((match=IMPORT_REGEX.exec(content))!==null){const isTypeImport=/^import\s+type[\s{]/.test(match[0]);let inlineTypeOnly=false;if(!isTypeImport){const target=resolveImportPath(match[1],resolveOpts);inlineTypeOnly=importsOnlyInlineTypes(match[0])||target!==null&&importsOnlyTypesFrom(match[0],target,(spec,fromFile)=>resolveImportPath(spec,{...resolveOpts,fromFile}))}pushImport(match[1],false,isTypeImport,inlineTypeOnly)}while((match=EXPORT_FROM_REGEX.exec(content))!==null)pushImport(match[1]);EXPORT_ALL_REGEX.lastIndex=0;while((match=EXPORT_ALL_REGEX.exec(content))!==null)pushImport(match[1]);TOP_LEVEL_REQUIRE_REGEX.lastIndex=0;while((match=TOP_LEVEL_REQUIRE_REGEX.exec(content))!==null)pushImport(match[1]);while((match=DYNAMIC_IMPORT_REGEX.exec(content))!==null)pushImport(match[1],true);const hash=getFileHash(file);if(hash){const oldHash=cache.fileHashes.get(file);if(oldHash!==hash){invalidateSCCCache(cache)}cache.fileHashes.set(file,hash)}}catch{}cache.dependencies.set(file,imports);return imports}function hasOnlyTypeImports(cycle,cache){for(const file of cycle){if(!fileExists(file,cache))continue;const content=(0,fs_1.readFileSync)(file,"utf-8");if(content===null)return false;const hasRuntimeImport=!TYPE_IMPORT_REGEX.test(content)&&IMPORT_REGEX.test(content);IMPORT_REGEX.lastIndex=0;if(hasRuntimeImport){return false}}return true}function computeSCCsFromFile(startFile,options){try{startFile=(0,node_fs_1.realpathSync)(startFile)}catch{}const{workspaceRoot,barrelExports,cache,resolverSettings}=options;if(cache.sccComputed&&cache.sccs.length>0&&cache.sccIndex.has(startFile)){return cache.sccs}const state={index:0,stack:[],onStack:new Set,indices:new Map,lowlinks:new Map,sccs:[]};const visited=new Set;const filesToProcess=[startFile];while(filesToProcess.length>0){const file=filesToProcess.pop();if(visited.has(file))continue;visited.add(file);const imports=getFileImports(file,{workspaceRoot,barrelExports,cache,resolverSettings});for(const imp of imports){if(!imp.dynamic&&!isErasedEdge(imp,options)&&!visited.has(imp.path)){filesToProcess.push(imp.path)}}}for(const file of visited){if(!state.indices.has(file)){tarjanStrongConnect(file,state,options,0)}}const newResults=state.sccs.map(files=>({files,hasCycle:files.length>1}));const offset=cache.sccs.length;cache.sccs.push(...newResults);cache.sccComputed=true;for(let i=0;i<newResults.length;i++){for(const file of newResults[i].files){if(!cache.sccIndex.has(file)){cache.sccIndex.set(file,offset+i)}}}for(const result of newResults){if(result.hasCycle){for(const file of result.files){cache.nonCyclicFiles.delete(file)}}else{for(const file of result.files){cache.nonCyclicFiles.add(file)}}}return cache.sccs}function tarjanStrongConnect(file,state,options,depth){const{maxDepth,workspaceRoot,barrelExports,cache,resolverSettings}=options;if(depth>maxDepth){return}const enter=(node,nodeDepth)=>{state.indices.set(node,state.index);state.lowlinks.set(node,state.index);state.index++;state.stack.push(node);state.onStack.add(node);const imports=getFileImports(node,{workspaceRoot,barrelExports,cache,resolverSettings});const successors=[];for(const imp of imports){if(imp.dynamic||isErasedEdge(imp,options))continue;successors.push(imp.path)}return{file:node,depth:nodeDepth,successors,next:0}};const relax=(node,candidate)=>{state.lowlinks.set(node,Math.min(state.lowlinks.get(node),candidate))};const frames=[enter(file,depth)];while(frames.length>0){const frame=frames[frames.length-1];if(frame.next<frame.successors.length){const successor=frame.successors[frame.next++];if(!state.indices.has(successor)){if(frame.depth+1>maxDepth){relax(frame.file,0);continue}frames.push(enter(successor,frame.depth+1))}else if(state.onStack.has(successor)){relax(frame.file,state.indices.get(successor))}continue}frames.pop();const lowlink=state.lowlinks.get(frame.file);const index=state.indices.get(frame.file);if(lowlink===index){const scc=[];let w;do{w=state.stack.pop();state.onStack.delete(w);scc.push(w)}while(w!==frame.file);state.sccs.push(scc)}const parent=frames[frames.length-1];if(parent){relax(parent.file,state.lowlinks.get(frame.file))}}}function isFileInCycle(file,cache){const sccIndex=cache.sccIndex.get(file);if(sccIndex===void 0)return false;const scc=cache.sccs[sccIndex];return scc&&scc.hasCycle}function findShortestCyclePath(sourceFile,targetFile,options){const{workspaceRoot,barrelExports,cache,resolverSettings}=options;const maxDepth=options.maxDepth??Infinity;const srcSCC=cache.sccIndex.get(sourceFile);if(srcSCC===void 0)return null;const queue=[[targetFile]];const visited=new Set([targetFile]);while(queue.length>0){const path=queue.shift();if(path.length>maxDepth)break;const current=path[path.length-1];const imports=getFileImports(current,{workspaceRoot,barrelExports,cache,resolverSettings});for(const imp of imports){if(imp.dynamic||isErasedEdge(imp,options))continue;if(imp.path===sourceFile){return[...path,sourceFile]}if(visited.has(imp.path))continue;if(cache.sccIndex.get(imp.path)!==srcSCC)continue;visited.add(imp.path);queue.push([...path,imp.path])}}return null}function getCycleForFile(file,cache){const sccIndex=cache.sccIndex.get(file);if(sccIndex===void 0)return null;const scc=cache.sccs[sccIndex];if(!scc||!scc.hasCycle)return null;return scc.files}function isErasedEdge(imp,options){if(imp.typeOnly)return true;return Boolean(imp.inlineTypeOnly)&&!options.verbatimModuleSyntax}function detectCycleFromImport(sourceFile,targetFile,options){try{sourceFile=(0,node_fs_1.realpathSync)(sourceFile)}catch{}try{targetFile=(0,node_fs_1.realpathSync)(targetFile)}catch{}const{maxDepth,reportAllCycles,workspaceRoot,barrelExports,cache,resolverSettings}=options;if(cache.nonCyclicFiles.has(targetFile)){return[]}const allCycles=[];const pathStack=[sourceFile];let depthLimitHit=false;function dfs(file,depth,visited2){if(file===sourceFile){allCycles.push([...pathStack,file]);return}if(depth>=maxDepth){depthLimitHit=true;return}if(visited2.has(file))return;if(cache.nonCyclicFiles.has(file))return;visited2.add(file);pathStack.push(file);const imports=getFileImports(file,{workspaceRoot,barrelExports,cache,resolverSettings});for(const imp of imports){if(imp.dynamic)continue;if(!reportAllCycles&&allCycles.length>0)break;dfs(imp.path,depth+1,visited2)}pathStack.pop()}const visited=new Set;dfs(targetFile,1,visited);if(allCycles.length===0&&!depthLimitHit){cache.nonCyclicFiles.add(targetFile)}return allCycles}function findAllCircularDependencies(file,options,currentPath=[],depth=0,visited=new Set){const{maxDepth,reportAllCycles,workspaceRoot,barrelExports,cache,resolverSettings}=options;if(depth===0){try{file=(0,node_fs_1.realpathSync)(file)}catch{}}if(cache.nonCyclicFiles.has(file)){return[]}if(depth===0){computeSCCsFromFile(file,{maxDepth,workspaceRoot,barrelExports,cache,resolverSettings});if(!isFileInCycle(file,cache)){cache.nonCyclicFiles.add(file);return[]}}if(depth>maxDepth){return[]}if(currentPath.includes(file)){return[[...currentPath,file]]}if(visited.has(file)){return[]}visited.add(file);const imports=getFileImports(file,{workspaceRoot,barrelExports,cache,resolverSettings});const newPath=[...currentPath,file];const allCycles=[];for(const imp of imports){if(imp.dynamic){continue}if(!reportAllCycles&&allCycles.length>0){break}const cycles=findAllCircularDependencies(imp.path,options,newPath,depth+1,visited);allCycles.push(...cycles)}if(depth===0&&allCycles.length===0){cache.nonCyclicFiles.add(file)}return allCycles}function getMinimalCycle(cycle){if(cycle.length<2)return cycle;const seen=new Map;for(let i=0;i<cycle.length;i++){const file=cycle[i];if(seen.has(file)){const cycleStart=seen?.get?.(file);return cycle.slice(cycleStart,i+1)}seen.set(file,i)}return cycle}function getCycleHash(cycle){const minimalCycle=getMinimalCycle(cycle);const minIndex=minimalCycle.indexOf(minimalCycle.reduce((min,curr)=>curr<min?curr:min,minimalCycle[0]));const normalized=[...minimalCycle.slice(minIndex),...minimalCycle.slice(0,minIndex)];return normalized.join("->")}const CACHE_VERSION=1;const DEFAULT_CACHE_FILE="node_modules/.cache/forge-eslint/cycles.json";const DEFAULT_MAX_CACHE_AGE=24*60*60*1e3;function saveCacheToDisk(cache,options,workspaceRoot){if(!options.enabled)return;const cacheFile=(0,path_1.resolvePath)(workspaceRoot,options.cacheFile||DEFAULT_CACHE_FILE);const data={version:CACHE_VERSION,createdAt:Date.now(),fileHashes:Object.fromEntries(cache.fileHashes),sccs:cache.sccs,sccIndex:Object.fromEntries(cache.sccIndex),nonCyclicFiles:Array.from(cache.nonCyclicFiles),graphHash:cache.graphHash};const cacheDir=(0,path_1.getDirname)(cacheFile);if(!(0,fs_1.fileExistsSync)(cacheDir)){(0,fs_1.mkdirSync)(cacheDir,{recursive:true})}(0,fs_1.writeFileSync)(cacheFile,JSON.stringify(data),"utf-8")}function loadCacheFromDisk(cache,options,workspaceRoot){if(!options.enabled)return false;const cacheFile=(0,path_1.resolvePath)(workspaceRoot,options.cacheFile||DEFAULT_CACHE_FILE);if(!(0,fs_1.fileExistsSync)(cacheFile)){return false}const content=(0,fs_1.readFileSync)(cacheFile,"utf-8");if(content===null){return false}try{const data=JSON.parse(content);if(data.version!==CACHE_VERSION){return false}const maxAge=options.maxCacheAge??DEFAULT_MAX_CACHE_AGE;if(Date.now()-data.createdAt>maxAge){return false}cache.fileHashes=new Map(Object.entries(data.fileHashes));cache.sccs=data.sccs;cache.sccIndex=new Map(Object.entries(data.sccIndex).map(([k,v])=>[k,v]));cache.nonCyclicFiles=new Set(data.nonCyclicFiles);cache.graphHash=data.graphHash;cache.sccComputed=true;return true}catch{return false}}function getFilesNeedingReanalysis(files,cache,options){if(!options.enabled||!cache.sccComputed){return files}const changedFiles=[];for(const file of files){const cachedHash=cache.fileHashes.get(file);const currentHash=getFileHash(file);if(!cachedHash||cachedHash!==currentHash){changedFiles.push(file)}}if(changedFiles.length>0){const affectedSCCIndices=new Set;for(const file of changedFiles){const sccIndex=cache.sccIndex.get(file);if(sccIndex!==void 0){affectedSCCIndices.add(sccIndex)}}const affectedFiles=new Set(changedFiles);for(const scc of cache.sccs){const sccIndex=cache.sccIndex.get(scc.files[0]);if(sccIndex!==void 0&&affectedSCCIndices.has(sccIndex)){for(const file of scc.files){affectedFiles.add(file);cache.nonCyclicFiles.delete(file)}}}for(const[file,imports]of cache.dependencies){for(const imp of imports){if(changedFiles.includes(imp.path)){affectedFiles.add(file);cache.nonCyclicFiles.delete(file);break}}}return Array.from(affectedFiles)}return[]}function isIncrementalAvailable(cache,options){return Boolean(options?.enabled&&cache.sccComputed&&cache.sccs.length>0)}exports.PERFORMANCE_DOCS={algorithm:"Tarjan SCC + DFS hybrid",timeComplexity:"O(V + E)",spaceComplexity:"O(V)",guaranteedComplete:true};
@@ -33,7 +33,7 @@
33
33
  * taxonomy contract keeps it in the SDK's plugin rather than in
34
34
  * `browser-security`.
35
35
  */
36
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
36
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
37
37
  /** The opt-in both SDKs spell identically. */
38
38
  export declare const BROWSER_ESCAPE_FLAG = "dangerouslyAllowBrowser";
39
39
  export interface BrowserEscapeHatchRuleConfig {
@@ -20,7 +20,7 @@
20
20
  * - a value is followed to where it is written, so `ssl: sslOptions` and
21
21
  * `password: process.env.DB_PASSWORD || 'root'` are read, not skipped.
22
22
  */
23
- import type { TSESTree } from '@typescript-eslint/utils';
23
+ import type { TSESTree } from '../types/estree/utils/index';
24
24
  import { type Origin } from './driver-origin';
25
25
  import { type ExtraEvidence } from './module-evidence';
26
26
  import { type Env, type Value } from './value-follow';
@@ -25,7 +25,7 @@
25
25
  * the linter cannot read — is `'unknown'`, and the caller decides how much
26
26
  * the call's own shape has to prove before it reports.
27
27
  */
28
- import type { TSESTree } from '@typescript-eslint/utils';
28
+ import type { TSESTree } from '../types/estree/utils/index';
29
29
  import { type Value } from './value-follow';
30
30
  /** Where a value comes from, relative to one plugin's driver modules. */
31
31
  export type Origin = 'ours' | 'foreign' | 'unknown';
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License. Use of this source code is governed by the
4
4
  * MIT license that can be found in the LICENSE file.
5
5
  */
6
- import type { TSESLint } from '@typescript-eslint/utils';
6
+ import type { TSESLint } from '../types/estree/utils/index';
7
7
  /**
8
8
  * Does this file declare itself machine-generated?
9
9
  *
@@ -1,4 +1,4 @@
1
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
1
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
2
2
  import { type ConfigShape } from './connection-config';
3
3
  /**
4
4
  * Two ids because the fixes differ in shape.
@@ -84,8 +84,15 @@ export declare function staticStringValue(node: TSESTree.Node): string | undefin
84
84
  * teaches people the rule cries wolf.
85
85
  */
86
86
  export declare function isLiteralSecret(node: TSESTree.Node): boolean;
87
+ /**
88
+ * The rule createHardcodedCredentialsRule returns, by a name plugins can reach through
89
+ * `@interlace/eslint-devkit`: a plugin's declarations then refer to this
90
+ * alias instead of to devkit's vendored typescript-eslint types.
91
+ */
92
+ export type HardcodedCredentialsRule = TSESLint.RuleModule<HardcodedCredentialsMessageIds, [
93
+ ]>;
87
94
  /** Build a CWE-798 rule for one driver's connection surface. */
88
- export declare function createHardcodedCredentialsRule(config: HardcodedCredentialsRuleConfig): TSESLint.RuleModule<HardcodedCredentialsMessageIds, []>;
95
+ export declare function createHardcodedCredentialsRule(config: HardcodedCredentialsRuleConfig): HardcodedCredentialsRule;
89
96
  /**
90
97
  * The text a connection URL starts with: a string literal's value, or the
91
98
  * head of a template up to its first hole. `mysql://root:s3cret@${host}/db`
@@ -1,4 +1,4 @@
1
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
1
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
2
2
  import { type Env } from './value-follow';
3
3
  /**
4
4
  * Two ids because the shapes read differently at the call site, and a reader
@@ -75,5 +75,12 @@ export interface MassAssignmentRuleConfig {
75
75
  * comes from (`request-source.ts`), never by what it is called.
76
76
  */
77
77
  export declare function classifyPayload(node: TSESTree.Node, env: Env, isOurs?: (node: TSESTree.Node) => boolean): MassAssignmentMessageIds | false;
78
+ /**
79
+ * The rule createMassAssignmentRule returns, by a name plugins can reach through
80
+ * `@interlace/eslint-devkit`: a plugin's declarations then refer to this
81
+ * alias instead of to devkit's vendored typescript-eslint types.
82
+ */
83
+ export type MassAssignmentRule = TSESLint.RuleModule<MassAssignmentMessageIds, [
84
+ ]>;
78
85
  /** Build a CWE-915 rule for one driver's write surface. */
79
- export declare function createMassAssignmentRule(config: MassAssignmentRuleConfig): TSESLint.RuleModule<MassAssignmentMessageIds, []>;
86
+ export declare function createMassAssignmentRule(config: MassAssignmentRuleConfig): MassAssignmentRule;
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License. Use of this source code is governed by the
4
4
  * MIT license that can be found in the LICENSE file.
5
5
  */
6
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
6
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
7
7
  /** A source whose messages are attacker-influenced, and which owns its own rule. */
8
8
  export type MessageSource = 'websocket' | 'worker' | 'filereader' | 'postmessage';
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License. Use of this source code is governed by the
4
4
  * MIT license that can be found in the LICENSE file.
5
5
  */
6
- import type { TSESLint } from '@typescript-eslint/utils';
6
+ import type { TSESLint } from '../types/estree/utils/index';
7
7
  /**
8
8
  * Is this file machine-packed output rather than something a person edits?
9
9
  *
@@ -11,7 +11,7 @@
11
11
  * Call the returned `listeners` directly with synthetic nodes and assert on
12
12
  * the recorded `reports`.
13
13
  */
14
- import type { TSESLint } from '@typescript-eslint/utils';
14
+ import type { TSESLint } from '../types/estree/utils/index';
15
15
  /** Anything shaped like an ESLint rule module (`{ create(context) }`). */
16
16
  export interface RuleLike {
17
17
  create(context: never): Record<string, unknown>;
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License. Use of this source code is governed by the
4
4
  * MIT license that can be found in the LICENSE file.
5
5
  */
6
- import type { TSESTree } from '@typescript-eslint/utils';
6
+ import type { TSESTree } from '../types/estree/utils/index';
7
7
  /**
8
8
  * Extra evidence a plugin accepts beyond an import.
9
9
  *
@@ -1,4 +1,4 @@
1
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
1
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
2
2
  /**
3
3
  * Two ids because the remediations are genuinely different.
4
4
  *
@@ -126,5 +126,12 @@ export declare function calleeText(node: TSESTree.Node): string;
126
126
  export declare function isExemptExpression(expr: TSESTree.Expression, identifierHelpers: readonly string[], tags: readonly string[]): boolean;
127
127
  /** The matched name of a template tag: `sql` or `$queryRaw`. */
128
128
  export declare function tagName(tag: TSESTree.Node): string | undefined;
129
+ /**
130
+ * The rule createRawIdentifierRule returns, by a name plugins can reach through
131
+ * `@interlace/eslint-devkit`: a plugin's declarations then refer to this
132
+ * alias instead of to devkit's vendored typescript-eslint types.
133
+ */
134
+ export type RawIdentifierRule = TSESLint.RuleModule<RawIdentifierMessageIds, [
135
+ ]>;
129
136
  /** Build a CWE-89 identifier-interpolation rule for one driver's template API. */
130
- export declare function createRawIdentifierRule(config: RawIdentifierRuleConfig): TSESLint.RuleModule<RawIdentifierMessageIds, []>;
137
+ export declare function createRawIdentifierRule(config: RawIdentifierRuleConfig): RawIdentifierRule;
@@ -26,7 +26,7 @@
26
26
  * The property names are the frameworks' API (Express, Koa, Fastify, Lambda
27
27
  * proxy events), not a guess about what a variable is called.
28
28
  */
29
- import type { TSESTree } from '@typescript-eslint/utils';
29
+ import type { TSESTree } from '../types/estree/utils/index';
30
30
  import { type Env } from './value-follow';
31
31
  /** Is this name the runtime global — no binding in the file, or a TS lib one? */
32
32
  export declare function isGlobal(node: TSESTree.Identifier, env: Env): boolean;
@@ -1,4 +1,4 @@
1
- import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
1
+ import type { TSESLint, TSESTree } from '../types/estree/utils/index';
2
2
  import { type ConfigShape } from './connection-config';
3
3
  /** Message ids every rule built by this factory reports. */
4
4
  export type RequireTlsMessageIds = 'tlsDisabled' | 'certificateValidationDisabled';
@@ -112,6 +112,12 @@ export declare function within(inner: TSESTree.Node, outer: TSESTree.Node): bool
112
112
  * built in one statement and passed in another.
113
113
  */
114
114
  export declare function inConnectionPosition(node: TSESTree.Literal | TSESTree.TemplateLiteral, connectionKeys: readonly string[], isDriverCallee: (callee: TSESTree.Node) => boolean): boolean;
115
+ /**
116
+ * The rule createRequireTlsRule returns, by a name plugins can reach through
117
+ * `@interlace/eslint-devkit`: a plugin's declarations then refer to this
118
+ * alias instead of to devkit's vendored typescript-eslint types.
119
+ */
120
+ export type RequireTlsRule = TSESLint.RuleModule<RequireTlsMessageIds, []>;
115
121
  /**
116
122
  * Build a CWE-319 rule for the given driver.
117
123
  *
@@ -119,4 +125,4 @@ export declare function inConnectionPosition(node: TSESTree.Literal | TSESTree.T
119
125
  * readable literal AND the object reads as a connection config. An unreadable
120
126
  * value is a deliberate false negative.
121
127
  */
122
- export declare function createRequireTlsRule(config: RequireTlsRuleConfig): TSESLint.RuleModule<RequireTlsMessageIds, []>;
128
+ export declare function createRequireTlsRule(config: RequireTlsRuleConfig): RequireTlsRule;
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License. Use of this source code is governed by the
4
4
  * MIT license that can be found in the LICENSE file.
5
5
  */
6
- import type { TSESLint } from '@typescript-eslint/utils';
6
+ import type { TSESLint } from '../types/estree/utils/index';
7
7
  /**
8
8
  * Documentation URL resolver function type
9
9
  */