Skip to content

Commit

Permalink
lint: add explicit codegen type annotation
Browse files Browse the repository at this point in the history
```
>deno publish --dry-run
Checking for slow types in the public API...
error[missing-explicit-type]: missing explicit type in the public API
  --> C:\Users\ethan\Documents\GitHub\ht\cli\codegen.ts:26:14
   |
26 | export const bcdElementEventNames = Object.keys(bcd.api.Element)
   |              ^^^^^^^^^^^^^^^^^^^^ this symbol is missing an explicit type
   |
   = hint: add an explicit type annotation to the symbol

  info: all symbols in the public API must have an explicit type
  docs: https://jsr.io/go/slow-type-missing-explicit-type

This package contains errors for slow types. Fixing these errors will:

  1. Significantly improve your package users' type checking performance.
  2. Improve the automatic documentation generation.
  3. Enable automatic .d.ts generation for Node.js.

Don't want to bother? You can choose to skip this step by
providing the --allow-slow-types flag.

error: Found 1 problem
```
  • Loading branch information
EthanThatOneKid committed Nov 5, 2024
1 parent f04dab3 commit ffe6c53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import bcd from "@mdn/browser-compat-data" with { type: "json" };
/**
* bcdElementEventNames is a list of all element event names in BCD.
*/
export const bcdElementEventNames = Object.keys(bcd.api.Element)
export const bcdElementEventNames: string[] = Object.keys(bcd.api.Element)
.filter((key) => key.endsWith("_event"))
.map((key) => key.toLowerCase().replace(/_event$/, ""))
.toSorted();
Expand Down

0 comments on commit ffe6c53

Please sign in to comment.