- 
                Notifications
    
You must be signed in to change notification settings  - Fork 53
 
fix: types node16 resolution #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| _vdom: ReturnType<typeof h> | null; | ||
| _props: Record<string, unknown>; | ||
| }; | ||
| import { AnyComponent } from 'preact'; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer a module file, had to move this out
| options?: Options | ||
| ): HTMLElement; | ||
| 
               | 
          ||
| export = register; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actual fix
| "prepare": "npx simple-git-hooks", | ||
| "build": "microbundle -f cjs,es,umd --no-generateTypes", | ||
| "lint": "eslint src/*.{js,jsx}", | ||
| "lint": "eslint src/*.js", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint fails if it can't find a single matching file & we have no .jsx files in src/.
| 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; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
53a4399    to
    8f41e93      
    Compare
  
    | 
           Size Change: +3 B (+0.07%) Total Size: 4.04 kB 
 ℹ️ View Unchanged
  | 
    
9bd5bd0    to
    5e6eb49      
    Compare
  
    
Are the types wrong?
npm run build && npm packwill show this PR fixes the issue.