@futdevpro/dynamo-eslint 1.20.29 → 1.20.55

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 (93) hide show
  1. package/README.md +80 -0
  2. package/build/configs/ngx.d.ts +29 -0
  3. package/build/configs/ngx.d.ts.map +1 -1
  4. package/build/configs/ngx.js +57 -0
  5. package/build/configs/ngx.js.map +1 -1
  6. package/build/plugin/index.d.ts +5 -0
  7. package/build/plugin/index.d.ts.map +1 -1
  8. package/build/plugin/index.js +13 -0
  9. package/build/plugin/index.js.map +1 -1
  10. package/build/plugin/rules/angular/empty-state-guard.util.d.ts +58 -0
  11. package/build/plugin/rules/angular/empty-state-guard.util.d.ts.map +1 -0
  12. package/build/plugin/rules/angular/empty-state-guard.util.js +158 -0
  13. package/build/plugin/rules/angular/empty-state-guard.util.js.map +1 -0
  14. package/build/plugin/rules/angular/empty-state-requires-guard.d.ts +10 -0
  15. package/build/plugin/rules/angular/empty-state-requires-guard.d.ts.map +1 -0
  16. package/build/plugin/rules/angular/empty-state-requires-guard.js +61 -0
  17. package/build/plugin/rules/angular/empty-state-requires-guard.js.map +1 -0
  18. package/build/plugin/rules/angular/module-load-failed-branch.d.ts +11 -0
  19. package/build/plugin/rules/angular/module-load-failed-branch.d.ts.map +1 -0
  20. package/build/plugin/rules/angular/module-load-failed-branch.js +58 -0
  21. package/build/plugin/rules/angular/module-load-failed-branch.js.map +1 -0
  22. package/build/plugin/rules/angular/no-unlisted-inner-html.d.ts +15 -0
  23. package/build/plugin/rules/angular/no-unlisted-inner-html.d.ts.map +1 -0
  24. package/build/plugin/rules/angular/no-unlisted-inner-html.js +106 -0
  25. package/build/plugin/rules/angular/no-unlisted-inner-html.js.map +1 -0
  26. package/build/plugin/rules/angular/no-unused-component.d.ts +11 -0
  27. package/build/plugin/rules/angular/no-unused-component.d.ts.map +1 -0
  28. package/build/plugin/rules/angular/no-unused-component.js +78 -0
  29. package/build/plugin/rules/angular/no-unused-component.js.map +1 -0
  30. package/build/plugin/rules/angular/scroll-container-min-h-0.d.ts +11 -0
  31. package/build/plugin/rules/angular/scroll-container-min-h-0.d.ts.map +1 -0
  32. package/build/plugin/rules/angular/scroll-container-min-h-0.js +59 -0
  33. package/build/plugin/rules/angular/scroll-container-min-h-0.js.map +1 -0
  34. package/build/plugin/rules/angular/ui-building-blocks-baseline.interface.d.ts +15 -0
  35. package/build/plugin/rules/angular/ui-building-blocks-baseline.interface.d.ts.map +1 -0
  36. package/build/plugin/rules/angular/ui-building-blocks-baseline.interface.js +3 -0
  37. package/build/plugin/rules/angular/ui-building-blocks-baseline.interface.js.map +1 -0
  38. package/build/plugin/rules/angular/ui-building-blocks-element.interface.d.ts +19 -0
  39. package/build/plugin/rules/angular/ui-building-blocks-element.interface.d.ts.map +1 -0
  40. package/build/plugin/rules/angular/ui-building-blocks-element.interface.js +3 -0
  41. package/build/plugin/rules/angular/ui-building-blocks-element.interface.js.map +1 -0
  42. package/build/plugin/rules/angular/ui-building-blocks-rule-context.util.d.ts +28 -0
  43. package/build/plugin/rules/angular/ui-building-blocks-rule-context.util.d.ts.map +1 -0
  44. package/build/plugin/rules/angular/ui-building-blocks-rule-context.util.js +50 -0
  45. package/build/plugin/rules/angular/ui-building-blocks-rule-context.util.js.map +1 -0
  46. package/build/plugin/rules/angular/ui-building-blocks-scroll-finding.interface.d.ts +12 -0
  47. package/build/plugin/rules/angular/ui-building-blocks-scroll-finding.interface.d.ts.map +1 -0
  48. package/build/plugin/rules/angular/ui-building-blocks-scroll-finding.interface.js +3 -0
  49. package/build/plugin/rules/angular/ui-building-blocks-scroll-finding.interface.js.map +1 -0
  50. package/build/plugin/rules/angular/ui-building-blocks.util.d.ts +111 -0
  51. package/build/plugin/rules/angular/ui-building-blocks.util.d.ts.map +1 -0
  52. package/build/plugin/rules/angular/ui-building-blocks.util.js +377 -0
  53. package/build/plugin/rules/angular/ui-building-blocks.util.js.map +1 -0
  54. package/build/plugin/rules/angular/unused-component-finding.interface.d.ts +14 -0
  55. package/build/plugin/rules/angular/unused-component-finding.interface.d.ts.map +1 -0
  56. package/build/plugin/rules/angular/unused-component-finding.interface.js +3 -0
  57. package/build/plugin/rules/angular/unused-component-finding.interface.js.map +1 -0
  58. package/build/plugin/rules/angular/unused-component.util.d.ts +86 -0
  59. package/build/plugin/rules/angular/unused-component.util.d.ts.map +1 -0
  60. package/build/plugin/rules/angular/unused-component.util.js +243 -0
  61. package/build/plugin/rules/angular/unused-component.util.js.map +1 -0
  62. package/build/plugin/rules/angular/xss-surface-baseline-files.interface.d.ts +8 -0
  63. package/build/plugin/rules/angular/xss-surface-baseline-files.interface.d.ts.map +1 -0
  64. package/build/plugin/rules/angular/xss-surface-baseline-files.interface.js +3 -0
  65. package/build/plugin/rules/angular/xss-surface-baseline-files.interface.js.map +1 -0
  66. package/build/plugin/rules/angular/xss-surface-occurrences.interface.d.ts +6 -0
  67. package/build/plugin/rules/angular/xss-surface-occurrences.interface.d.ts.map +1 -0
  68. package/build/plugin/rules/angular/xss-surface-occurrences.interface.js +3 -0
  69. package/build/plugin/rules/angular/xss-surface-occurrences.interface.js.map +1 -0
  70. package/build/plugin/rules/angular/xss-surface.util.d.ts +44 -0
  71. package/build/plugin/rules/angular/xss-surface.util.d.ts.map +1 -0
  72. package/build/plugin/rules/angular/xss-surface.util.js +121 -0
  73. package/build/plugin/rules/angular/xss-surface.util.js.map +1 -0
  74. package/build/plugin/rules/prefer-interface-over-duplicate-types.d.ts.map +1 -1
  75. package/build/plugin/rules/prefer-interface-over-duplicate-types.js +31 -19
  76. package/build/plugin/rules/prefer-interface-over-duplicate-types.js.map +1 -1
  77. package/build/scripts/lint-strict.d.ts +62 -0
  78. package/build/scripts/lint-strict.d.ts.map +1 -0
  79. package/build/scripts/lint-strict.js +151 -0
  80. package/build/scripts/lint-strict.js.map +1 -0
  81. package/build/scripts/ui-building-blocks-baseline.d.ts +21 -0
  82. package/build/scripts/ui-building-blocks-baseline.d.ts.map +1 -0
  83. package/build/scripts/ui-building-blocks-baseline.js +123 -0
  84. package/build/scripts/ui-building-blocks-baseline.js.map +1 -0
  85. package/build/scripts/unused-components-baseline.d.ts +17 -0
  86. package/build/scripts/unused-components-baseline.d.ts.map +1 -0
  87. package/build/scripts/unused-components-baseline.js +62 -0
  88. package/build/scripts/unused-components-baseline.js.map +1 -0
  89. package/build/scripts/xss-surface-baseline.d.ts +17 -0
  90. package/build/scripts/xss-surface-baseline.d.ts.map +1 -0
  91. package/build/scripts/xss-surface-baseline.js +73 -0
  92. package/build/scripts/xss-surface-baseline.js.map +1 -0
  93. package/package.json +7 -3
@@ -0,0 +1,111 @@
1
+ import { UiBuildingBlocks_Baseline_Interface } from './ui-building-blocks-baseline.interface';
2
+ import { UiBuildingBlocks_Element_Interface } from './ui-building-blocks-element.interface';
3
+ import { UiBuildingBlocks_ScrollFinding_Interface } from './ui-building-blocks-scroll-finding.interface';
4
+ /** A template inside a source file: its text and where it starts in the file. */
5
+ interface UiBuildingBlocks_Template_Interface {
6
+ text: string;
7
+ offset: number;
8
+ }
9
+ /**
10
+ * BFR-QA-004 — the ONE scanner behind the `scroll-container-min-h-0` and `module-load-failed-branch` rules AND the
11
+ * `dynamo-ui-building-blocks-baseline` generator, so the baseline counts exactly what the rules count.
12
+ *
13
+ * ① Scroll container that will not scroll: a flex item's default `min-height: auto` keeps it at least as tall as its
14
+ * content. A scroll container (`overflow-(y-)auto|scroll`) under a COLUMN-flex item without `min-h-0` therefore sits
15
+ * in a chain that grows to the content height — `scrollHeight ≈ clientHeight`, it never scrolls (organizer
16
+ * BUG-QA-ORG-029). The check walks the scroll container's ancestors inside the template up to the element that
17
+ * gives the chain its height (`h-full`, a fixed height); a column-flex item on the way without `min-h-0` /
18
+ * `overflow-*` is the culprit. NOT a finding: a scroll container with its own fixed height (`h-64`, `max-h-96`,
19
+ * `h-screen`, inline height); an outer scroll container on the way (that one scrolls); an `absolute` / `fixed`
20
+ * ancestor (out of the flex flow); a component host without classes in the template (its `host` / `:host` styles
21
+ * are not visible here — mirrored: `<app-list class="flex-1">` IS checked, its flex role is written here); no
22
+ * height source in the template at all (then the host's parents decide).
23
+ * Static limit: the chain is followed inside ONE template (a component host's parents live in another one).
24
+ * ② Module without a load-failed branch: a module (`…/_modules/<name>/`) whose templates show a LOADING state but none
25
+ * of which shows a FAILED / error state — "empty", "loading" and "failed" are three different states
26
+ * (BUG-QA-ORG-032/-034); without the third the screen looks empty when loading failed.
27
+ *
28
+ * Templates = `.html` files and inline `template:` literals of `.ts` files; comments and interpolations are ignored.
29
+ */
30
+ export declare class UiBuildingBlocks_Util {
31
+ /** The default location of the committed per-project baseline (relative to the ESLint working directory). */
32
+ static readonly defaultBaselineFile: string;
33
+ /** The rule ids the baseline belongs to. */
34
+ static readonly ruleIds: string[];
35
+ /**
36
+ * A loading state in a template. Deliberately NOT a bare spinner / progress bar (status indicators, determinate
37
+ * progress) nor `pending` (counters) — both measured as false positives on the fleet.
38
+ */
39
+ static readonly loadingPattern: RegExp;
40
+ /** A failed / error state in a template (`errors` — a list OF errors — is not one). */
41
+ static readonly failedPattern: RegExp;
42
+ /** BFR-MASTERPROMPTER-075 ⓐ: the `[dynamo-overlay]` directive attribute (runtime `position: absolute`). */
43
+ private static readonly outOfFlowAttribute;
44
+ /** BFR-MASTERPROMPTER-075 ⓒ: a loading match whose condition is the bare `loading` flag (`@if (loading)`). */
45
+ private static readonly subFrameLoadingCondition;
46
+ private static readonly voidTags;
47
+ private static readonly scrollClasses;
48
+ /** Classes that stop a flex item from growing with its content (min-height 0 or a non-visible overflow). */
49
+ private static readonly shrinkClasses;
50
+ /** Classes that give an element its own height (not relative to a growing parent). */
51
+ private static readonly fixedHeightClasses;
52
+ /** Baseline cache: path → { stamp (mtime + size: two writes in one mtime tick still differ), baseline }. */
53
+ private static readonly baselineCache;
54
+ /** Module cache: folder → { fingerprint, has a failed branch }. */
55
+ private static readonly moduleCache;
56
+ /** Whether a file is in scope (templates and component sources; tests and declarations excluded). */
57
+ static isInScope(filename: string): boolean;
58
+ /**
59
+ * The templates of a source file (`.html` = the whole file; `.ts` = its inline `template:` literals — backtick AND
60
+ * single / double quoted: a one-line `template: '<app-x />'` is a real template, measured on the fleet).
61
+ */
62
+ static templates(text: string, filename: string): UiBuildingBlocks_Template_Interface[];
63
+ /** The elements of every template of a file, each with its in-template parent. */
64
+ static elements(text: string, filename: string): UiBuildingBlocks_Element_Interface[];
65
+ /** ① The scroll containers of a file that sit in a chain growing to the content height. */
66
+ static scrollFindings(text: string, filename: string, scrollerTags: string[]): UiBuildingBlocks_ScrollFinding_Interface[];
67
+ /** ② Offsets of the loading states in a file's templates (comments / interpolations ignored). */
68
+ static loadingOffsets(text: string, filename: string): number[];
69
+ /**
70
+ * BFR-MASTERPROMPTER-075 ⓒ: the component (inline template: this file; external template: its sibling `.ts`)
71
+ * extends `DyNX_SubFrame_Component`. An unreadable sibling ⇒ `false` (measure, never silence).
72
+ */
73
+ static isSubFrameComponent(text: string, filename: string): boolean;
74
+ /** ② Whether a file's templates show a failed / error state. */
75
+ static hasFailedBranch(text: string, filename: string): boolean;
76
+ /** ② The module folder of a file: the path up to the FIRST `_modules/<name>` segment (`undefined` = not in one). */
77
+ static moduleDir(filename: string): string | undefined;
78
+ /**
79
+ * ② Whether any template of a module shows a failed state. `current` = the file being linted with its IN-EDITOR
80
+ * text (it may differ from the disk). Cached per module until a file of it changes.
81
+ */
82
+ static moduleHasFailedBranch(moduleDir: string, current: {
83
+ filename: string;
84
+ text: string;
85
+ }): boolean;
86
+ /** ② The template-bearing files of a module folder (recursive, tests excluded). */
87
+ static moduleFiles(moduleDir: string): string[];
88
+ /** A path in baseline form: forward slashes, relative to `cwd` when inside it. */
89
+ static relativeKey(filename: string, cwd: string): string;
90
+ /** Reads the committed baseline (missing file = empty baseline; a broken file THROWS — never a silent pass). */
91
+ static readBaseline(baselinePath: string): UiBuildingBlocks_Baseline_Interface;
92
+ /** Forward slashes. */
93
+ static normalize(value: string): string;
94
+ /** A change stamp of a file: mtime AND size (a rewrite inside one mtime tick still changes the size). */
95
+ private static stamp;
96
+ /** Class names without variant prefixes (`md:overflow-auto` → `overflow-auto`). */
97
+ private static bases;
98
+ private static isScroller;
99
+ /** The element that bounds the chain: its own height, or `h-full` / `max-h-full` (the height of its parent). */
100
+ private static givesHeight;
101
+ private static hasFixedHeight;
102
+ private static isColumnFlex;
103
+ /** Static `class`, `[class.x]` bindings and the quoted keys of `[ngClass]`. */
104
+ private static classesOf;
105
+ /** Comments → spaces (offsets and line breaks preserved). */
106
+ static blankComments(text: string): string;
107
+ /** Comments AND `{{ … }}` interpolations → spaces, so a `<` in an expression is never read as a tag. */
108
+ private static blankNonMarkup;
109
+ }
110
+ export {};
111
+ //# sourceMappingURL=ui-building-blocks.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-building-blocks.util.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/angular/ui-building-blocks.util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mCAAmC,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,wCAAwC,EAAE,MAAM,+CAA+C,CAAC;AAEzG,iFAAiF;AACjF,UAAU,mCAAmC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,qBAAqB;IAEhC,6GAA6G;IAC7G,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAA8C;IAEzF,4CAA4C;IAC5C,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAI/B;IAEF;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAIpC;IAEF,uFAAuF;IACvF,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAQnC;IAEF,2GAA2G;IAC3G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_1 = require("fs");
6
+ const path = tslib_1.__importStar(require("path"));
7
+ /**
8
+ * BFR-QA-004 — the ONE scanner behind the `scroll-container-min-h-0` and `module-load-failed-branch` rules AND the
9
+ * `dynamo-ui-building-blocks-baseline` generator, so the baseline counts exactly what the rules count.
10
+ *
11
+ * ① Scroll container that will not scroll: a flex item's default `min-height: auto` keeps it at least as tall as its
12
+ * content. A scroll container (`overflow-(y-)auto|scroll`) under a COLUMN-flex item without `min-h-0` therefore sits
13
+ * in a chain that grows to the content height — `scrollHeight ≈ clientHeight`, it never scrolls (organizer
14
+ * BUG-QA-ORG-029). The check walks the scroll container's ancestors inside the template up to the element that
15
+ * gives the chain its height (`h-full`, a fixed height); a column-flex item on the way without `min-h-0` /
16
+ * `overflow-*` is the culprit. NOT a finding: a scroll container with its own fixed height (`h-64`, `max-h-96`,
17
+ * `h-screen`, inline height); an outer scroll container on the way (that one scrolls); an `absolute` / `fixed`
18
+ * ancestor (out of the flex flow); a component host without classes in the template (its `host` / `:host` styles
19
+ * are not visible here — mirrored: `<app-list class="flex-1">` IS checked, its flex role is written here); no
20
+ * height source in the template at all (then the host's parents decide).
21
+ * Static limit: the chain is followed inside ONE template (a component host's parents live in another one).
22
+ * ② Module without a load-failed branch: a module (`…/_modules/<name>/`) whose templates show a LOADING state but none
23
+ * of which shows a FAILED / error state — "empty", "loading" and "failed" are three different states
24
+ * (BUG-QA-ORG-032/-034); without the third the screen looks empty when loading failed.
25
+ *
26
+ * Templates = `.html` files and inline `template:` literals of `.ts` files; comments and interpolations are ignored.
27
+ */
28
+ class UiBuildingBlocks_Util {
29
+ /** The default location of the committed per-project baseline (relative to the ESLint working directory). */
30
+ static defaultBaselineFile = '.dynamo/ui-building-blocks-baseline.json';
31
+ /** The rule ids the baseline belongs to. */
32
+ static ruleIds = [
33
+ '@futdevpro/dynamo/scroll-container-min-h-0',
34
+ '@futdevpro/dynamo/module-load-failed-branch',
35
+ '@futdevpro/dynamo/empty-state-requires-guard',
36
+ ];
37
+ /**
38
+ * A loading state in a template. Deliberately NOT a bare spinner / progress bar (status indicators, determinate
39
+ * progress) nor `pending` (counters) — both measured as false positives on the fleet.
40
+ */
41
+ static loadingPattern = new RegExp('inProgress_\\$|loading-skeleton|'
42
+ + '@(?:if|else if)\\s*\\([^)]*(?:[lL]oading|inProgress)|'
43
+ + '\\*ngIf\\s*=\\s*"[^"]*(?:[lL]oading|inProgress)');
44
+ /** A failed / error state in a template (`errors` — a list OF errors — is not one). */
45
+ static failedPattern = new RegExp('@(?:if|else if)\\s*\\([^)]*(?:[eE]rror|[fF]ail)(?!s\\b)|'
46
+ + '\\*ngIf\\s*=\\s*"[^"]*(?:[eE]rror|[fF]ail)(?!s\\b)|'
47
+ + '<[a-z][\\w-]*(?:load-?failed|load-error|error-state)\\b|'
48
+ + 'data-testid="[^"]*load[a-z-]*(?:error|failed)|'
49
+ // BFR-MASTERPROMPTER-075 ⓑ: the three-state idiom `@if (loading) {…} @else if (data) {…} @else { …-error }` —
50
+ // the closing `@else` branch (⛔ `@else if`) carrying an error / failed test-id, before the next control-flow block
51
+ + '@else\\s*\\{[^@]*?data-testid="[^"]*-(?:error|failed)"');
52
+ /** BFR-MASTERPROMPTER-075 ⓐ: the `[dynamo-overlay]` directive attribute (runtime `position: absolute`). */
53
+ static outOfFlowAttribute = /(?:^|\s)dynamo-overlay(?=[\s=/]|$)/;
54
+ /** BFR-MASTERPROMPTER-075 ⓒ: a loading match whose condition is the bare `loading` flag (`@if (loading)`). */
55
+ static subFrameLoadingCondition = /\(\s*!?\s*loading\s*$/;
56
+ static voidTags = new Set([
57
+ 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'source', 'track', 'wbr',
58
+ ]);
59
+ static scrollClasses = new Set([
60
+ 'overflow-auto', 'overflow-y-auto', 'overflow-scroll', 'overflow-y-scroll',
61
+ ]);
62
+ /** Classes that stop a flex item from growing with its content (min-height 0 or a non-visible overflow). */
63
+ static shrinkClasses = /^(?:min-h-0|min-h-\[0(?:px)?\]|overflow-(?:y-)?(?:auto|scroll|hidden|clip))$/;
64
+ /** Classes that give an element its own height (not relative to a growing parent). */
65
+ static fixedHeightClasses = /^(?:h|max-h)-(?!full$|auto$|fit$|min$|max$|0$)[\w.[\]()%/-]+$/;
66
+ /** Baseline cache: path → { stamp (mtime + size: two writes in one mtime tick still differ), baseline }. */
67
+ static baselineCache = new Map();
68
+ /** Module cache: folder → { fingerprint, has a failed branch }. */
69
+ static moduleCache = new Map();
70
+ /** Whether a file is in scope (templates and component sources; tests and declarations excluded). */
71
+ static isInScope(filename) {
72
+ const normalized = UiBuildingBlocks_Util.normalize(filename);
73
+ return (normalized.endsWith('.html') || normalized.endsWith('.ts'))
74
+ && !normalized.endsWith('.spec.ts')
75
+ && !normalized.endsWith('.d.ts');
76
+ }
77
+ /**
78
+ * The templates of a source file (`.html` = the whole file; `.ts` = its inline `template:` literals — backtick AND
79
+ * single / double quoted: a one-line `template: '<app-x />'` is a real template, measured on the fleet).
80
+ */
81
+ static templates(text, filename) {
82
+ if (filename.endsWith('.html')) {
83
+ return [{ text: text, offset: 0 }];
84
+ }
85
+ const result = [];
86
+ const regex = /\btemplate\s*:\s*(?:`((?:\\[\s\S]|[^`\\])*)`|'((?:\\.|[^'\\\n])*)'|"((?:\\.|[^"\\\n])*)")/g;
87
+ let match = regex.exec(text);
88
+ while (match !== null) {
89
+ const body = match[1] ?? match[2] ?? match[3] ?? '';
90
+ result.push({ text: body, offset: match.index + match[0].length - body.length - 1 });
91
+ match = regex.exec(text);
92
+ }
93
+ return result;
94
+ }
95
+ /** The elements of every template of a file, each with its in-template parent. */
96
+ static elements(text, filename) {
97
+ const result = [];
98
+ UiBuildingBlocks_Util.templates(text, filename).forEach((template) => {
99
+ const code = UiBuildingBlocks_Util.blankNonMarkup(template.text);
100
+ const stack = [];
101
+ const tagRegex = /<(\/?)([a-zA-Z][\w.:-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g;
102
+ let match = tagRegex.exec(code);
103
+ while (match !== null) {
104
+ const tag = match[2].toLowerCase();
105
+ if (match[1]) {
106
+ // closing tag: pop to the matching open element (tolerant of unclosed children)
107
+ const index = stack.map((e) => e.tag).lastIndexOf(tag);
108
+ if (index >= 0) {
109
+ stack.length = index;
110
+ }
111
+ }
112
+ else {
113
+ const attributes = match[3];
114
+ const element = {
115
+ tag: tag,
116
+ classes: UiBuildingBlocks_Util.classesOf(attributes),
117
+ heightStyle: /(?:^|\s)style\s*=\s*["'][^"']*\bheight\s*:|\[style\.(?:max-)?height|\[ngStyle\][^>]*height/i
118
+ .test(attributes),
119
+ offset: template.offset + match.index,
120
+ parent: stack[stack.length - 1],
121
+ outOfFlow: UiBuildingBlocks_Util.outOfFlowAttribute.test(attributes),
122
+ };
123
+ result.push(element);
124
+ if (!attributes.trim().endsWith('/') && !UiBuildingBlocks_Util.voidTags.has(tag)) {
125
+ stack.push(element);
126
+ }
127
+ }
128
+ match = tagRegex.exec(code);
129
+ }
130
+ });
131
+ return result;
132
+ }
133
+ /** ① The scroll containers of a file that sit in a chain growing to the content height. */
134
+ static scrollFindings(text, filename, scrollerTags) {
135
+ const tags = new Set(scrollerTags.map((t) => t.toLowerCase()));
136
+ const findings = [];
137
+ UiBuildingBlocks_Util.elements(text, filename).forEach((element) => {
138
+ if (!UiBuildingBlocks_Util.isScroller(element, tags) || UiBuildingBlocks_Util.hasFixedHeight(element)) {
139
+ return;
140
+ }
141
+ // walk up to the element that gives the chain its height; a column-flex item on the way must be able to shrink
142
+ let culprit;
143
+ let ancestor = element.parent;
144
+ while (ancestor) {
145
+ if (UiBuildingBlocks_Util.isScroller(ancestor, tags)) {
146
+ // an outer scroll container takes over: the page still scrolls, just not in the inner one
147
+ return;
148
+ }
149
+ if (UiBuildingBlocks_Util.givesHeight(ancestor)) {
150
+ if (culprit) {
151
+ findings.push({
152
+ offset: element.offset, tag: element.tag, culpritOffset: culprit.offset, culpritTag: culprit.tag,
153
+ });
154
+ }
155
+ return;
156
+ }
157
+ const bases = UiBuildingBlocks_Util.bases(ancestor);
158
+ if (bases.includes('absolute') || bases.includes('fixed') || ancestor.outOfFlow) {
159
+ // out of the flex flow: its height comes from the containing block, not from this chain
160
+ return;
161
+ }
162
+ const isColumnFlexItem = !!ancestor.parent && UiBuildingBlocks_Util.isColumnFlex(ancestor.parent);
163
+ const canShrink = bases.some((c) => UiBuildingBlocks_Util.shrinkClasses.test(c));
164
+ // a component host without classes in this template is sized by its own `host` / `:host` — not visible here
165
+ const sizedHere = !ancestor.tag.includes('-') || ancestor.classes.length > 0;
166
+ if (isColumnFlexItem && !canShrink && sizedHere && !culprit) {
167
+ culprit = ancestor;
168
+ }
169
+ ancestor = ancestor.parent;
170
+ }
171
+ // no height source inside the template: the chain is decided by the host's parents — not decidable here
172
+ });
173
+ return findings;
174
+ }
175
+ /** ② Offsets of the loading states in a file's templates (comments / interpolations ignored). */
176
+ static loadingOffsets(text, filename) {
177
+ const result = [];
178
+ UiBuildingBlocks_Util.templates(text, filename).forEach((template) => {
179
+ const code = UiBuildingBlocks_Util.blankComments(template.text);
180
+ const regex = new RegExp(UiBuildingBlocks_Util.loadingPattern.source, 'g');
181
+ const subFrame = UiBuildingBlocks_Util.isSubFrameComponent(text, filename);
182
+ let match = regex.exec(code);
183
+ while (match !== null) {
184
+ // BFR-MASTERPROMPTER-075 ⓒ: a `DyNX_SubFrame` component's bare `loading` is its ROUTE-CHANGE flag
185
+ // (`updateState(url, loading)`), ⛔ a data load — a failed branch cannot belong to it
186
+ if (!(subFrame && UiBuildingBlocks_Util.subFrameLoadingCondition.test(match[0]))) {
187
+ result.push(template.offset + match.index);
188
+ }
189
+ match = regex.exec(code);
190
+ }
191
+ });
192
+ return result;
193
+ }
194
+ /**
195
+ * BFR-MASTERPROMPTER-075 ⓒ: the component (inline template: this file; external template: its sibling `.ts`)
196
+ * extends `DyNX_SubFrame_Component`. An unreadable sibling ⇒ `false` (measure, never silence).
197
+ */
198
+ static isSubFrameComponent(text, filename) {
199
+ const extendsSubFrame = /\bextends\s+DyNX_SubFrame_Component\b/;
200
+ if (filename.endsWith('.ts')) {
201
+ return extendsSubFrame.test(text);
202
+ }
203
+ const sibling = filename.replace(/\.html$/, '.ts');
204
+ try {
205
+ return sibling !== filename && (0, fs_1.existsSync)(sibling) && extendsSubFrame.test((0, fs_1.readFileSync)(sibling, 'utf8'));
206
+ }
207
+ catch {
208
+ return false;
209
+ }
210
+ }
211
+ /** ② Whether a file's templates show a failed / error state. */
212
+ static hasFailedBranch(text, filename) {
213
+ return UiBuildingBlocks_Util.templates(text, filename).some((template) => UiBuildingBlocks_Util.failedPattern.test(UiBuildingBlocks_Util.blankComments(template.text)));
214
+ }
215
+ /** ② The module folder of a file: the path up to the FIRST `_modules/<name>` segment (`undefined` = not in one). */
216
+ static moduleDir(filename) {
217
+ const normalized = UiBuildingBlocks_Util.normalize(filename);
218
+ const match = /^(.*?\/_modules\/[^/]+)\//.exec(normalized);
219
+ return match ? match[1] : undefined;
220
+ }
221
+ /**
222
+ * ② Whether any template of a module shows a failed state. `current` = the file being linted with its IN-EDITOR
223
+ * text (it may differ from the disk). Cached per module until a file of it changes.
224
+ */
225
+ static moduleHasFailedBranch(moduleDir, current) {
226
+ if (UiBuildingBlocks_Util.hasFailedBranch(current.text, current.filename)) {
227
+ return true;
228
+ }
229
+ const currentFile = UiBuildingBlocks_Util.normalize(current.filename).toLowerCase();
230
+ const files = UiBuildingBlocks_Util.moduleFiles(moduleDir)
231
+ .filter((f) => UiBuildingBlocks_Util.normalize(f).toLowerCase() !== currentFile);
232
+ const fingerprint = files.map((f) => f + ':' + UiBuildingBlocks_Util.stamp(f)).join('|');
233
+ const cached = UiBuildingBlocks_Util.moduleCache.get(moduleDir + '|' + currentFile);
234
+ if (cached?.fingerprint === fingerprint) {
235
+ return cached.hasFailedBranch;
236
+ }
237
+ const hasFailedBranch = files.some((f) => UiBuildingBlocks_Util.hasFailedBranch((0, fs_1.readFileSync)(f, 'utf8'), f));
238
+ UiBuildingBlocks_Util.moduleCache.set(moduleDir + '|' + currentFile, { fingerprint: fingerprint, hasFailedBranch: hasFailedBranch });
239
+ return hasFailedBranch;
240
+ }
241
+ /** ② The template-bearing files of a module folder (recursive, tests excluded). */
242
+ static moduleFiles(moduleDir) {
243
+ const result = [];
244
+ const walk = (dir) => {
245
+ (0, fs_1.readdirSync)(dir, { withFileTypes: true }).forEach((entry) => {
246
+ const full = path.join(dir, entry.name);
247
+ if (entry.isDirectory()) {
248
+ if (entry.name !== 'node_modules') {
249
+ walk(full);
250
+ }
251
+ }
252
+ else if (UiBuildingBlocks_Util.isInScope(full)) {
253
+ result.push(full);
254
+ }
255
+ });
256
+ };
257
+ if ((0, fs_1.existsSync)(moduleDir)) {
258
+ walk(moduleDir);
259
+ }
260
+ return result.sort();
261
+ }
262
+ /** A path in baseline form: forward slashes, relative to `cwd` when inside it. */
263
+ static relativeKey(filename, cwd) {
264
+ const file = UiBuildingBlocks_Util.normalize(filename);
265
+ const root = UiBuildingBlocks_Util.normalize(cwd).replace(/\/$/, '');
266
+ return file.toLowerCase().startsWith(root.toLowerCase() + '/') ? file.slice(root.length + 1) : file;
267
+ }
268
+ /** Reads the committed baseline (missing file = empty baseline; a broken file THROWS — never a silent pass). */
269
+ static readBaseline(baselinePath) {
270
+ if (!(0, fs_1.existsSync)(baselinePath)) {
271
+ return { scrollerTags: [], scrollContainers: {}, modulesWithoutLoadFailedBranch: [], emptyStatesWithoutGuard: {} };
272
+ }
273
+ const stamp = UiBuildingBlocks_Util.stamp(baselinePath);
274
+ const cached = UiBuildingBlocks_Util.baselineCache.get(baselinePath);
275
+ if (cached?.stamp === stamp) {
276
+ return cached.baseline;
277
+ }
278
+ const parsed = JSON.parse((0, fs_1.readFileSync)(baselinePath, 'utf8'));
279
+ const field = (name) => (typeof parsed === 'object' && parsed !== null ? Reflect.get(parsed, name) : undefined);
280
+ const settings = field('settings');
281
+ const scrollContainers = field('scrollContainers');
282
+ const modules = field('modulesWithoutLoadFailedBranch');
283
+ const emptyStates = field('emptyStatesWithoutGuard');
284
+ if (!scrollContainers || typeof scrollContainers !== 'object' || !Array.isArray(modules)) {
285
+ throw new Error(`UI-building-blocks baseline ${baselinePath} has no "scrollContainers" object / `
286
+ + '"modulesWithoutLoadFailedBranch" array — regenerate it with `npx dynamo-ui-building-blocks-baseline`.');
287
+ }
288
+ const tags = settings && typeof settings === 'object' ? Reflect.get(settings, 'scrollerTags') : undefined;
289
+ const baseline = {
290
+ scrollerTags: Array.isArray(tags) ? tags.filter((t) => typeof t === 'string') : [],
291
+ scrollContainers: {},
292
+ modulesWithoutLoadFailedBranch: modules.filter((m) => typeof m === 'string')
293
+ .map((m) => UiBuildingBlocks_Util.normalize(m)),
294
+ };
295
+ // BFR-QA-003: optional — a baseline generated before the rule existed simply has none (the preset keeps the rule off)
296
+ if (emptyStates && typeof emptyStates === 'object') {
297
+ baseline.emptyStatesWithoutGuard = {};
298
+ Object.entries(emptyStates).forEach(([key, value]) => {
299
+ baseline.emptyStatesWithoutGuard[UiBuildingBlocks_Util.normalize(key)] =
300
+ typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : 0;
301
+ });
302
+ }
303
+ Object.entries(scrollContainers).forEach(([key, value]) => {
304
+ baseline.scrollContainers[UiBuildingBlocks_Util.normalize(key)] =
305
+ typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : 0;
306
+ });
307
+ UiBuildingBlocks_Util.baselineCache.set(baselinePath, { stamp: stamp, baseline: baseline });
308
+ return baseline;
309
+ }
310
+ /** Forward slashes. */
311
+ static normalize(value) {
312
+ return value.replace(/\\/g, '/');
313
+ }
314
+ /** A change stamp of a file: mtime AND size (a rewrite inside one mtime tick still changes the size). */
315
+ static stamp(file) {
316
+ const stat = (0, fs_1.statSync)(file);
317
+ return stat.mtimeMs + ':' + stat.size;
318
+ }
319
+ /** Class names without variant prefixes (`md:overflow-auto` → `overflow-auto`). */
320
+ static bases(element) {
321
+ return element.classes.map((c) => c.slice(c.lastIndexOf(':') + 1));
322
+ }
323
+ static isScroller(element, tags) {
324
+ return tags.has(element.tag)
325
+ || UiBuildingBlocks_Util.bases(element).some((c) => UiBuildingBlocks_Util.scrollClasses.has(c));
326
+ }
327
+ /** The element that bounds the chain: its own height, or `h-full` / `max-h-full` (the height of its parent). */
328
+ static givesHeight(element) {
329
+ return UiBuildingBlocks_Util.hasFixedHeight(element)
330
+ || UiBuildingBlocks_Util.bases(element).some((c) => c === 'h-full' || c === 'max-h-full' || c === 'inset-0' || c === 'inset-y-0');
331
+ }
332
+ static hasFixedHeight(element) {
333
+ return element.heightStyle
334
+ || UiBuildingBlocks_Util.bases(element).some((c) => UiBuildingBlocks_Util.fixedHeightClasses.test(c));
335
+ }
336
+ static isColumnFlex(element) {
337
+ const bases = UiBuildingBlocks_Util.bases(element);
338
+ return (bases.includes('flex') || bases.includes('inline-flex'))
339
+ && (bases.includes('flex-col') || bases.includes('flex-col-reverse'));
340
+ }
341
+ /** Static `class`, `[class.x]` bindings and the quoted keys of `[ngClass]`. */
342
+ static classesOf(attributes) {
343
+ const result = [];
344
+ const staticClass = /(?:^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(attributes);
345
+ if (staticClass) {
346
+ result.push(...(staticClass[1] ?? staticClass[2]).split(/\s+/).filter(Boolean));
347
+ }
348
+ const bindingRegex = /\[class\.([^\]=\s]+)\]/g;
349
+ let binding = bindingRegex.exec(attributes);
350
+ while (binding !== null) {
351
+ result.push(binding[1]);
352
+ binding = bindingRegex.exec(attributes);
353
+ }
354
+ const ngClass = /\[ngClass\]\s*=\s*"([^"]*)"/.exec(attributes);
355
+ if (ngClass) {
356
+ (ngClass[1].match(/'[^']*'/g) ?? []).forEach((quoted) => {
357
+ result.push(...quoted.slice(1, -1).split(/\s+/).filter(Boolean));
358
+ });
359
+ }
360
+ return result;
361
+ }
362
+ /** Comments → spaces (offsets and line breaks preserved). */
363
+ static blankComments(text) {
364
+ return text.replace(/<!--[\s\S]*?-->/g, (match) => match.replace(/[^\n]/g, ' '));
365
+ }
366
+ /** Comments AND `{{ … }}` interpolations → spaces, so a `<` in an expression is never read as a tag. */
367
+ static blankNonMarkup(text) {
368
+ /** An expression becomes spaces — offsets and line breaks stay where they were. */
369
+ const blank = (match) => match.replace(/[^\n]/g, ' ');
370
+ return UiBuildingBlocks_Util.blankComments(text)
371
+ .replace(/\{\{[\s\S]*?\}\}/g, blank)
372
+ // control-flow conditions (`@if (count<limit) {`), one level of nested parentheses
373
+ .replace(/@\w+(?:\s+if)?\s*\((?:[^()]|\([^()]*\))*\)/g, blank);
374
+ }
375
+ }
376
+ exports.UiBuildingBlocks_Util = UiBuildingBlocks_Util;
377
+ //# sourceMappingURL=ui-building-blocks.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-building-blocks.util.js","sourceRoot":"","sources":["../../../../src/plugin/rules/angular/ui-building-blocks.util.ts"],"names":[],"mappings":";;;;AAAA,2BAAqE;AACrE,mDAA6B;AAY7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,qBAAqB;IAEhC,6GAA6G;IAC7G,MAAM,CAAU,mBAAmB,GAAW,0CAA0C,CAAC;IAEzF,4CAA4C;IAC5C,MAAM,CAAU,OAAO,GAAa;QAClC,4CAA4C;QAC5C,6CAA6C;QAC7C,8CAA8C;KAC/C,CAAC;IAEF;;;OAGG;IACH,MAAM,CAAU,cAAc,GAAW,IAAI,MAAM,CACjD,kCAAkC;UAChC,uDAAuD;UACvD,iDAAiD,CACpD,CAAC;IAEF,uFAAuF;IACvF,MAAM,CAAU,aAAa,GAAW,IAAI,MAAM,CAChD,0DAA0D;UACxD,qDAAqD;UACrD,0DAA0D;UAC1D,gDAAgD;QAClD,8GAA8G;QAC9G,mHAAmH;UACjH,wDAAwD,CAC3D,CAAC;IAEF,2GAA2G;IACnG,MAAM,CAAU,kBAAkB,GAAW,oCAAoC,CAAC;IAE1F,8GAA8G;IACtG,MAAM,CAAU,wBAAwB,GAAW,uBAAuB,CAAC;IAE3E,MAAM,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,EAAE,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IACnG,CAAC;IAED,wGAAwG;IAChG,MAAM,CAAC,cAAc,CAAC,IAAY;QACxC,mFAAmF;QACnF,MAAM,KAAK,GAA8B,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAEjG,OAAO,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC;aAC7C,OAAO,CAAC,mBAAmB,EAAE,KAAK,CAAC;YACpC,mFAAmF;aAClF,OAAO,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;;AA9aH,sDA+aC"}
@@ -0,0 +1,14 @@
1
+ /** A component that is built but used nowhere (BFR-QA-006). */
2
+ export interface UnusedComponent_Finding_Interface {
3
+ /** The source file (forward slashes, as it was given to the scanner). */
4
+ file: string;
5
+ /** The component class. */
6
+ className: string;
7
+ /** Its selectors (empty = selector-less; then only a class reference can use it). */
8
+ selectors: string[];
9
+ /** Offset of the class name in the file. */
10
+ offset: number;
11
+ /** A reference to it exists, but ONLY inside a comment (`// T_Search_Component,`, `<!-- <app-x> -->`). */
12
+ commentedOut: boolean;
13
+ }
14
+ //# sourceMappingURL=unused-component-finding.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unused-component-finding.interface.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/angular/unused-component-finding.interface.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,WAAW,iCAAiC;IAChD,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,0GAA0G;IAC1G,YAAY,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=unused-component-finding.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unused-component-finding.interface.js","sourceRoot":"","sources":["../../../../src/plugin/rules/angular/unused-component-finding.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,86 @@
1
+ import { UnusedComponent_Finding_Interface } from './unused-component-finding.interface';
2
+ /** A source file of the project. */
3
+ interface UnusedComponent_Source_Interface {
4
+ file: string;
5
+ text: string;
6
+ }
7
+ /** What the project uses: template tags, template text (attribute selectors), class references per identifier. */
8
+ interface UnusedComponent_Index_Interface {
9
+ /** Element names used in (comment-free) templates. */
10
+ tags: Set<string>;
11
+ /** All comment-free template text (for attribute selectors). */
12
+ templates: string;
13
+ /** identifier → the files that reference it in a USAGE position. */
14
+ references: Map<string, Set<string>>;
15
+ /** identifier / tag → the files that mention it inside a COMMENT (`// X,`, `<!-- <app-x> -->`). */
16
+ commented: Map<string, Set<string>>;
17
+ }
18
+ /**
19
+ * BFR-QA-006 — the ONE scanner behind the `no-unused-component` rule AND the `dynamo-unused-components-baseline`
20
+ * generator: an Angular `@Component` that is built but used NOWHERE — its selector is in no (comment-free) template
21
+ * and its class is referenced in no other source in a usage position.
22
+ *
23
+ * Usage positions: routes (`component: X`, `loadComponent: … m.X`), dialogs (`dialog.open(X`), bootstrap,
24
+ * `createComponent(X)`, an assignment… — any reference EXCEPT:
25
+ * - `import … from` / `export … from` statements (a route can disappear while its import stays — measured on the
26
+ * credit client: `Ad_Page_Component` imported by a routing module and routed nowhere);
27
+ * - `imports` / `declarations` / `exports` arrays (registering a component is not using it — the organizer's
28
+ * `T_Search_Component` was one uncommented line away from being "registered but never rendered");
29
+ * - its own file, `*.spec.ts` (a component only its own test uses is exactly the case) and `*.stories.ts`.
30
+ * A reference that exists only inside a comment is flagged separately (`commentedOut`).
31
+ */
32
+ export declare class UnusedComponent_Util {
33
+ /** The default location of the committed per-project baseline (relative to the ESLint working directory). */
34
+ static readonly defaultBaselineFile: string;
35
+ /** The rule id the baseline belongs to. */
36
+ static readonly ruleId: string;
37
+ /** The project files the scan reads (relative globs, run in the ESLint working directory). */
38
+ static readonly globs: string[];
39
+ /** Never part of the scan: generated / vendored folders, tests, stories, declarations. */
40
+ static readonly ignore: string[];
41
+ /** How long a project scan is trusted before its files are re-stamped (editor lint-on-save). */
42
+ private static readonly recheckMs;
43
+ private static readonly projectCache;
44
+ private static readonly baselineCache;
45
+ /** The unused components declared in `sources`, measured against the whole project index. */
46
+ static findUnused(sources: UnusedComponent_Source_Interface[], index: UnusedComponent_Index_Interface): UnusedComponent_Finding_Interface[];
47
+ /** The `@Component`s of a TypeScript source: class name, selectors, class-name offset. */
48
+ static componentsOf(text: string): {
49
+ className: string;
50
+ selectors: string[];
51
+ offset: number;
52
+ }[];
53
+ /** Builds the usage index of a project's sources. */
54
+ static buildIndex(sources: UnusedComponent_Source_Interface[]): UnusedComponent_Index_Interface;
55
+ /**
56
+ * The index of the project in `root` (cached; re-stamped at most every few seconds, rebuilt only when a file
57
+ * changed).
58
+ */
59
+ static projectIndex(root: string): {
60
+ sources: UnusedComponent_Source_Interface[];
61
+ index: UnusedComponent_Index_Interface;
62
+ };
63
+ /** Reads the committed baseline: the accepted component keys (`<file>#<Class>`). Broken file THROWS. */
64
+ static readBaseline(baselinePath: string): string[];
65
+ /** Forgets every cached project scan and baseline (tests; a long-lived process after a bulk change). */
66
+ static clearCache(): void;
67
+ /** The baseline key of a finding. */
68
+ static key(finding: {
69
+ file: string;
70
+ className: string;
71
+ }): string;
72
+ /** Forward slashes. */
73
+ static normalize(value: string): string;
74
+ /** Whether one selector (`app-x`, `button[app-btn]`, `[appX]`) is used in the templates. */
75
+ private static selectorUsed;
76
+ /** The element part of a selector (`app-x` of `app-x[y]:not(z)`), lower-case; empty for attribute-only. */
77
+ private static elementOf;
78
+ /** Element names opened in a template text. */
79
+ private static tagsIn;
80
+ /** Identifiers of a code text. */
81
+ private static identifiersIn;
82
+ /** Removes `import`/`export … from` statements and `imports`/`declarations`/`exports` arrays (not usages). */
83
+ private static stripRegistrations;
84
+ }
85
+ export {};
86
+ //# sourceMappingURL=unused-component.util.d.ts.map