-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve internal JSDoc types (#4173)
* change ts-ignore to ts-expect-error * Improve internal types to better type check src * Move nextSibling to PreactElement * Add createRootFragment TS test * Reference property from dom types in PreactElement * Use ContainerNode in compat types * Add linting jsconfig.json * Fix new type checking errors * Put internal types into the global namespace so we don't have to import them * Improving typing a bit more * rename lint:tsc to just tsc * Ensure nested node_modules and dist directories are excluded
- Loading branch information
1 parent
cff2df5
commit 180b3b1
Showing
21 changed files
with
397 additions
and
291 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from '../../src'; | ||
|
||
React.render(<div />, document.createElement('div')); | ||
React.render(<div />, document.createDocumentFragment()); | ||
React.render(<div />, document.body.shadowRoot!); | ||
|
||
React.hydrate(<div />, document.createElement('div')); | ||
React.hydrate(<div />, document.createDocumentFragment()); | ||
React.hydrate(<div />, document.body.shadowRoot!); | ||
|
||
React.unmountComponentAtNode(document.createElement('div')); | ||
React.unmountComponentAtNode(document.createDocumentFragment()); | ||
React.unmountComponentAtNode(document.body.shadowRoot!); | ||
|
||
React.createPortal(<div />, document.createElement('div')); | ||
React.createPortal(<div />, document.createDocumentFragment()); | ||
React.createPortal(<div />, document.body.shadowRoot!); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./jsconfig.json", | ||
"include": ["src/**/*"] | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const EMPTY_OBJ = {}; | ||
export const EMPTY_OBJ = /** @type {any} */ ({}); | ||
export const EMPTY_ARR = []; | ||
export const IS_NON_DIMENSIONAL = | ||
/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i; |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.