Skip to content

Commit

Permalink
Upgrade typescript to 4.4.2 (#1550)
Browse files Browse the repository at this point in the history
* upgrade typescript to 4.4.2

* remove an inexisting failing case when theme is any

* comment wording

Co-authored-by: Isaiah Thomason <[email protected]>

* changelog for ts upgrade

Co-authored-by: Isaiah Thomason <[email protected]>
  • Loading branch information
kof and ITenthusiasm authored Sep 18, 2021
1 parent 0a0d7ad commit 8e13468
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Since you are interested in what happens next, in case, you work for a for-profi

- [all] Flow types are now moved from .js files to .flow type defs [1509](https://github.com/cssinjs/jss/pull/1509)

- [all] Upgrade typescript to 4.4.2 [1550](https://github.com/cssinjs/jss/pull/1550)

## 10.7.1 (2021-6-28)

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"rollup-plugin-terser": "^7.0.2",
"shelljs": "^0.8.2",
"sinon": "4.5.0",
"typescript": "^3.7.0",
"typescript": "^4.4.2",
"webpack": "^4.28.3",
"zen-observable": "^0.6.0"
}
Expand Down
22 changes: 6 additions & 16 deletions packages/react-jss/tests/types/withStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ ComponentTest = () => <ResultingComponent property="" />

/* -------------------- Failing Cases -------------------- */

// A function argument cannot provide another defined theme type conflicting with `undefined`
function failingFunctionRedefineTheme(theme: MyTheme): Styles<string, unknown, any> {
function failingFunctionWrongTheme(theme: MyTheme): Styles<string, unknown, MyTheme> {
return {
someClassName: '',
anotherClassName: {
Expand All @@ -146,7 +145,7 @@ function failingFunctionRedefineTheme(theme: MyTheme): Styles<string, unknown, a
}
}

function passingFunctionUnknownTheme(theme: MyTheme): Styles<string, unknown, unknown> {
function failingFunctionNullTheme(theme: MyTheme): Styles<string, unknown, null> {
return {
someClassName: '',
anotherClassName: {
Expand All @@ -155,16 +154,7 @@ function passingFunctionUnknownTheme(theme: MyTheme): Styles<string, unknown, un
}
}

function passingFunctionNullTheme(theme: MyTheme): Styles<string, unknown, null> {
return {
someClassName: '',
anotherClassName: {
fontWeight: 'bold'
}
}
}

// @ts-expect-error
withStyles(failingFunctionRedefineTheme)(SimpleComponent)
withStyles(passingFunctionUnknownTheme)(SimpleComponent)
withStyles(passingFunctionNullTheme)(SimpleComponent)
// @ts-expect-error - can't override `theme` argument
withStyles(failingFunctionWrongTheme)(SimpleComponent)
// @ts-expect-error - can't use null as a theme
withStyles(failingFunctionNullTheme)(SimpleComponent)
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10000,10 +10000,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^3.7.0:
version "3.9.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.3.tgz#d3ac8883a97c26139e42df5e93eeece33d610b8a"
integrity sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==
typescript@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==

uglify-js@^3.1.4:
version "3.8.0"
Expand Down

0 comments on commit 8e13468

Please sign in to comment.