-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript): convert to typescript
update tests to tsx match types version with dep versions generic type change to main/types to exports change build to dist change target to es6 update types/react to 18 to provide modern context type switched to vitest and react-testing-library updated to stricter eslint update to react@17 install and enforce prettier during testing fixed snapshot removed timezone from setup
- Loading branch information
Showing
17 changed files
with
23,614 additions
and
18,280 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"presets": [ | ||
"amex" | ||
] | ||
} | ||
"presets": ["amex", "@babel/preset-typescript"] | ||
} |
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,3 +1,54 @@ | ||
{ | ||
"extends": "amex" | ||
} | ||
"extends": ["amex", "plugin:@typescript-eslint/recommended", "prettier"], | ||
"settings": { "import/resolver": { "typescript": {} } }, | ||
"parserOptions": { | ||
"project": true, | ||
"extraFileExtensions": [".json"] | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"ignorePatterns": ["dist/**/*", "commitlint.config.js"], | ||
"overrides": [ | ||
{ | ||
"files": ["__tests__/**"], | ||
"extends": [ | ||
"amex/test", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"rules": { | ||
"import/extensions": [ | ||
"error", | ||
"ignorePackages", | ||
{ | ||
"ts": "never", | ||
"tsx": "never", | ||
"js": "never", | ||
"jsx": "never" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["src/**"], | ||
"extends": [ | ||
"amex", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/strict-type-checked", | ||
"prettier" | ||
], | ||
"rules": { | ||
"import/extensions": [ | ||
"error", | ||
"ignorePackages", | ||
{ | ||
"ts": "never", | ||
"tsx": "never", | ||
"js": "never", | ||
"jsx": "never" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
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,3 +1,4 @@ | ||
node_modules | ||
test-results | ||
.jest-cache | ||
coverage | ||
dist |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
import { afterEach } from "vitest"; | ||
import { cleanup } from "@testing-library/react"; | ||
|
||
afterEach(() => { | ||
cleanup(); | ||
}); |
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,40 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`createSharedReactContext > should not return the same context object if the key does not match 1`] = ` | ||
<body> | ||
<div> | ||
<div | ||
data-testid="consumerDiv" | ||
id="value" | ||
> | ||
default | ||
</div> | ||
</div> | ||
</body> | ||
`; | ||
|
||
exports[`createSharedReactContext > should return the same context object if the key matches 1`] = ` | ||
<body> | ||
<div> | ||
<div | ||
data-testid="consumerDiv" | ||
id="value" | ||
> | ||
context value | ||
</div> | ||
</div> | ||
</body> | ||
`; | ||
|
||
exports[`createSharedReactContext > should use the same default value from first call 1`] = ` | ||
<body> | ||
<div> | ||
<div | ||
data-testid="consumerDiv" | ||
id="value" | ||
> | ||
default | ||
</div> | ||
</div> | ||
</body> | ||
`; |
Oops, something went wrong.