From 8e13468005200baf966718443e8af47361d124e1 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sat, 18 Sep 2021 12:10:20 +0200 Subject: [PATCH] Upgrade typescript to 4.4.2 (#1550) * upgrade typescript to 4.4.2 * remove an inexisting failing case when theme is any * comment wording Co-authored-by: Isaiah Thomason <47364027+ITenthusiasm@users.noreply.github.com> * changelog for ts upgrade Co-authored-by: Isaiah Thomason <47364027+ITenthusiasm@users.noreply.github.com> --- changelog.md | 2 ++ package.json | 2 +- packages/react-jss/tests/types/withStyles.tsx | 22 +++++-------------- yarn.lock | 8 +++---- 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/changelog.md b/changelog.md index f19522168..33fb80e20 100755 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/package.json b/package.json index 54dd049f4..508be5aff 100644 --- a/package.json +++ b/package.json @@ -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" } diff --git a/packages/react-jss/tests/types/withStyles.tsx b/packages/react-jss/tests/types/withStyles.tsx index b7dfa9aa1..4838e6df5 100644 --- a/packages/react-jss/tests/types/withStyles.tsx +++ b/packages/react-jss/tests/types/withStyles.tsx @@ -136,8 +136,7 @@ ComponentTest = () => /* -------------------- Failing Cases -------------------- */ -// A function argument cannot provide another defined theme type conflicting with `undefined` -function failingFunctionRedefineTheme(theme: MyTheme): Styles { +function failingFunctionWrongTheme(theme: MyTheme): Styles { return { someClassName: '', anotherClassName: { @@ -146,7 +145,7 @@ function failingFunctionRedefineTheme(theme: MyTheme): Styles { +function failingFunctionNullTheme(theme: MyTheme): Styles { return { someClassName: '', anotherClassName: { @@ -155,16 +154,7 @@ function passingFunctionUnknownTheme(theme: MyTheme): Styles { - 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) diff --git a/yarn.lock b/yarn.lock index eed488c5d..2e35607bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"