Skip to content

Commit bfca8bc

Browse files
web/maintenance: lint pass to add missing HTMLElementTagNameMap entries
# What This code mechanically adds HTMLElementTagNameMap entries to those files that were missing it. Every entry in the report is in this format: ./src/elements/ak-table/stories/ak-select-table.stories.ts 'ak-select-table-test-sort' has not been registered on HTMLElementTagNameMap 84: export class SimpleTableSortTest extends LitElem no-missing-element-type-definition It was trivial to create a Perl script that extracted the file name, the tag name, and the class name, and turn that into a “Open this file and append the HTMLElementTagNameMap definition to the end,” then run `prettier` and `build` to validate that nothing broke. I also had to hand-edit the JSDoc for `Form`. It is not, by itself, an element. It is an abstract class from which you can derive elements. The `@element` tag there confused lit-analyze, and lit-analyze was correct to call it out. # Why These entries help Typescript & Lit-Analyze lint our product, validating that each element is being used correctly and that the types being passed to it are correct.
1 parent 9a4c56e commit bfca8bc

16 files changed

Lines changed: 92 additions & 1 deletion

File tree

web/src/admin/AdminInterface/AboutModal.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,9 @@ export class AboutModal extends WithLicenseSummary(WithBrandConfig(ModalButton))
133133
</div>`;
134134
}
135135
}
136+
137+
declare global {
138+
interface HTMLElementTagNameMap {
139+
"ak-about-modal": AboutModal;
140+
}
141+
}

web/src/admin/applications/entitlements/ApplicationEntitlementPage.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,9 @@ declare global {
144144
"ak-application-roles-list": ApplicationEntitlementsPage;
145145
}
146146
}
147+
148+
declare global {
149+
interface HTMLElementTagNameMap {
150+
"ak-application-entitlements-list": ApplicationEntitlementsPage;
151+
}
152+
}

web/src/admin/applications/wizard/ak-application-wizard-main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,9 @@ export class AkApplicationWizardMain extends AKElement {
110110
</ak-wizard-steps>`;
111111
}
112112
}
113+
114+
declare global {
115+
interface HTMLElementTagNameMap {
116+
"ak-application-wizard-main": AkApplicationWizardMain;
117+
}
118+
}

web/src/admin/applications/wizard/steps/ak-application-wizard-bindings-step.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,9 @@ declare global {
165165
"ak-application-wizard-applications-step": ApplicationWizardBindingsStep;
166166
}
167167
}
168+
169+
declare global {
170+
interface HTMLElementTagNameMap {
171+
"ak-application-wizard-bindings-step": ApplicationWizardBindingsStep;
172+
}
173+
}

web/src/admin/applications/wizard/steps/bindings/ak-application-wizard-bindings-edit-button.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ export function makeEditButton(
4646
${label}
4747
</ak-application-wizard-binding-step-edit-button>`;
4848
}
49+
50+
declare global {
51+
interface HTMLElementTagNameMap {
52+
"ak-application-wizard-binding-step-edit-button": ApplicationWizardBindingStepEditButton;
53+
}
54+
}

web/src/admin/events/EventMap.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,10 @@ export class EventMap extends AKElement {
164164
</div>`;
165165
}
166166
}
167+
168+
declare global {
169+
interface HTMLElementTagNameMap {
170+
"ak-map": Map;
171+
"ak-events-map": EventMap;
172+
}
173+
}

web/src/admin/policies/geoip/GeoIPPolicyForm.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,9 @@ export class GeoIPPolicyForm extends BasePolicyForm<GeoIPPolicy> {
195195
</ak-form-group>`;
196196
}
197197
}
198+
199+
declare global {
200+
interface HTMLElementTagNameMap {
201+
"ak-policy-geoip-form": GeoIPPolicyForm;
202+
}
203+
}

web/src/admin/rbac/InitialPermissionsListPage.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,9 @@ declare global {
115115
"initial-permissions-list": InitialPermissionsListPage;
116116
}
117117
}
118+
119+
declare global {
120+
interface HTMLElementTagNameMap {
121+
"ak-initial-permissions-list": InitialPermissionsListPage;
122+
}
123+
}

web/src/components/ak-nav-buttons.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,9 @@ export class NavigationButtons extends WithSession(AKElement) {
213213
</div>`;
214214
}
215215
}
216+
217+
declare global {
218+
interface HTMLElementTagNameMap {
219+
"ak-nav-buttons": NavigationButtons;
220+
}
221+
}

web/src/elements/ak-table/stories/ak-select-table.stories.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,9 @@ export const TableWithSorting: Story = {
137137
export const MultiselectTableWithSorting: Story = {
138138
render: () => container(html`<ak-select-table-test-sort multiple></ak-select-table-test-sort>`),
139139
};
140+
141+
declare global {
142+
interface HTMLElementTagNameMap {
143+
"ak-select-table-test-sort": SimpleTableSortTest;
144+
}
145+
}

0 commit comments

Comments
 (0)