-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add TypeScript tooling and configs #2360
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
88817f1
Add typescript-eslint and base tsconfig.json
with-heart f5170eb
Create/move tsconfig.json files and extend from root
with-heart 3d13655
Add "site" and "test" to root tsconfig include
with-heart 26621a9
Add @babel/preset-typescript
with-heart b151d5a
Add tsconfig.json for site
with-heart 3cf6566
Add "playgrounds" to root tsconfig include
with-heart 4557859
Add typescript-eslint as eslint plugin
with-heart ad73e27
Remove standard
with-heart d854e5a
Add eslint files override for ts,tsx
with-heart 672ca33
Add eslint import and react plugins
with-heart c97bd9f
Remove eslint-plugin-import and related rules
with-heart 5bf48d3
Add extend for @typescript-extend/eslint-recommended
with-heart 8a14f2f
Restore **/types/tsconfig.json files
with-heart bea1079
Remove typescript-eslint resolutions
with-heart feafd8e
Move parserOptions to ts overrides
with-heart 7ebda67
Enable skipDefaultLibCheck
with-heart c32e45c
Exclude types tests from root tsconfig
with-heart 3f886f4
Add tsconfig content for jsx-pragmatic
with-heart 945eaad
Update eslint prettier parser and add auto-fixes
with-heart 8210bea
Remove per-package tsconfig.json files
with-heart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,32 @@ | ||
| /* import type { EmotionCache } from '@emotion/utils' */ | ||
|
|
||
| const createExtractCritical = (cache /*: EmotionCache */) => ( | ||
| html /*: string */ | ||
| ) => { | ||
| // parse out ids from html | ||
| // reconstruct css/rules/cache to pass | ||
| let RGX = new RegExp(`${cache.key}-([a-zA-Z0-9-_]+)`, 'gm') | ||
| const createExtractCritical = | ||
| (cache /*: EmotionCache */) => (html /*: string */) => { | ||
| // parse out ids from html | ||
| // reconstruct css/rules/cache to pass | ||
| let RGX = new RegExp(`${cache.key}-([a-zA-Z0-9-_]+)`, 'gm') | ||
|
|
||
| let o = { html, ids: [], css: '' } | ||
| let match | ||
| let ids = {} | ||
| while ((match = RGX.exec(html)) !== null) { | ||
| if (ids[match[1]] === undefined) { | ||
| ids[match[1]] = true | ||
| let o = { html, ids: [], css: '' } | ||
| let match | ||
| let ids = {} | ||
| while ((match = RGX.exec(html)) !== null) { | ||
| if (ids[match[1]] === undefined) { | ||
| ids[match[1]] = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| o.ids = Object.keys(cache.inserted).filter(id => { | ||
| if ( | ||
| (ids[id] !== undefined || | ||
| cache.registered[`${cache.key}-${id}`] === undefined) && | ||
| cache.inserted[id] !== true | ||
| ) { | ||
| o.css += cache.inserted[id] | ||
| return true | ||
| } | ||
| }) | ||
| o.ids = Object.keys(cache.inserted).filter(id => { | ||
| if ( | ||
| (ids[id] !== undefined || | ||
| cache.registered[`${cache.key}-${id}`] === undefined) && | ||
| cache.inserted[id] !== true | ||
| ) { | ||
| o.css += cache.inserted[id] | ||
| return true | ||
| } | ||
| }) | ||
|
|
||
| return o | ||
| } | ||
| return o | ||
| } | ||
|
|
||
| export default createExtractCritical |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "forceConsistentCasingInFileNames": true, | ||
| "isolatedModules": true, | ||
| "jsx": "react", | ||
| "lib": ["es6", "dom"], | ||
| "module": "commonjs", | ||
| "noEmit": true, | ||
| "skipDefaultLibCheck": true, | ||
| "strict": true, | ||
with-heart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "target": "es5" | ||
| }, | ||
| "include": ["packages", "scripts", "site", "test", "playgrounds"], | ||
| "exclude": ["node_modules", "packages/*/types/test/*"] | ||
| } | ||
with-heart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.