fix: types node16 resolution#117
Merged
Merged
Conversation
rschristian
commented
Oct 17, 2025
| _vdom: ReturnType<typeof h> | null; | ||
| _props: Record<string, unknown>; | ||
| }; | ||
| import { AnyComponent } from 'preact'; |
Member
Author
There was a problem hiding this comment.
No longer a module file, had to move this out
| options?: Options | ||
| ): HTMLElement; | ||
|
|
||
| export = register; |
| "prepare": "npx simple-git-hooks", | ||
| "build": "microbundle -f cjs,es,umd --no-generateTypes", | ||
| "lint": "eslint src/*.{js,jsx}", | ||
| "lint": "eslint src/*.js", |
Member
Author
There was a problem hiding this comment.
ESLint fails if it can't find a single matching file & we have no .jsx files in src/.
Comment on lines
-16
to
+24
| inst._root = | ||
| options && options.shadow | ||
| ? inst.attachShadow({ mode: options.mode || 'open' }) | ||
| : inst; | ||
|
|
||
| if (options && options.adoptedStyleSheets) { | ||
| inst._root.adoptedStyleSheets = options.adoptedStyleSheets; | ||
| if (options && options.shadow) { | ||
| inst._root = inst.attachShadow({ mode: options.mode || 'open' }); | ||
|
|
||
| if (options.adoptedStyleSheets) { | ||
| inst._root.adoptedStyleSheets = options.adoptedStyleSheets; | ||
| } | ||
| } else { | ||
| inst._root = inst; |
Member
Author
There was a problem hiding this comment.
Drive-by, TS complains that .adoptedStyleSheets might not be set as it'll only exist if options.shadow is enabled. Nesting these initializations corrects the type issue for 1-2b.
JoviDeCroock
approved these changes
Oct 17, 2025
53a4399 to
8f41e93
Compare
|
Size Change: +3 B (+0.07%) Total Size: 4.04 kB
ℹ️ View Unchanged
|
9bd5bd0 to
5e6eb49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Are the types wrong?
npm run build && npm packwill show this PR fixes the issue.