Bump typescript to 4.9.3 (#14430)

This commit is contained in:
Bram Kragten 2022-11-21 20:27:47 +01:00 committed by GitHub
parent 2aa7b95a5a
commit fc80daa3e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1060 additions and 940 deletions

View File

@ -148,18 +148,18 @@
"xss": "^1.0.9" "xss": "^1.0.9"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.15.5", "@babel/core": "^7.20.2",
"@babel/plugin-external-helpers": "^7.14.5", "@babel/plugin-external-helpers": "^7.18.6",
"@babel/plugin-proposal-class-properties": "^7.14.5", "@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.15.4", "@babel/plugin-proposal-decorators": "^7.20.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.15.6", "@babel/plugin-proposal-object-rest-spread": "^7.20.2",
"@babel/plugin-proposal-optional-chaining": "^7.14.5", "@babel/plugin-proposal-optional-chaining": "^7.18.9",
"@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5",
"@babel/preset-env": "^7.15.6", "@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.15.0", "@babel/preset-typescript": "^7.18.6",
"@koa/cors": "^3.1.0", "@koa/cors": "^3.1.0",
"@open-wc/dev-server-hmr": "^0.0.2", "@open-wc/dev-server-hmr": "^0.0.2",
"@rollup/plugin-babel": "^5.2.1", "@rollup/plugin-babel": "^5.2.1",
@ -179,11 +179,11 @@
"@types/qrcode": "^1.4.2", "@types/qrcode": "^1.4.2",
"@types/sortablejs": "^1", "@types/sortablejs": "^1",
"@types/webspeechapi": "^0.0.29", "@types/webspeechapi": "^0.0.29",
"@typescript-eslint/eslint-plugin": "^4.32.0", "@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^4.32.0", "@typescript-eslint/parser": "^5.44.0",
"@web/dev-server": "^0.0.24", "@web/dev-server": "^0.0.24",
"@web/dev-server-rollup": "^0.2.11", "@web/dev-server-rollup": "^0.2.11",
"babel-loader": "^8.2.2", "babel-loader": "^9.1.0",
"chai": "^4.3.4", "chai": "^4.3.4",
"del": "^4.0.0", "del": "^4.0.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
@ -231,7 +231,7 @@
"systemjs": "^6.3.2", "systemjs": "^6.3.2",
"terser-webpack-plugin": "^5.2.4", "terser-webpack-plugin": "^5.2.4",
"ts-lit-plugin": "^1.2.1", "ts-lit-plugin": "^1.2.1",
"typescript": "^4.4.3", "typescript": "^4.9.3",
"vinyl-buffer": "^1.0.1", "vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0", "vinyl-source-stream": "^2.0.0",
"webpack": "^5.55.1", "webpack": "^5.55.1",

View File

@ -9,7 +9,6 @@ if (__BUILD__ === "latest" && polyfillsLoaded) {
const formatRelTimeMem = memoizeOne( const formatRelTimeMem = memoizeOne(
(locale: FrontendLocaleData) => (locale: FrontendLocaleData) =>
// @ts-expect-error
new Intl.RelativeTimeFormat(locale.language, { numeric: "auto" }) new Intl.RelativeTimeFormat(locale.language, { numeric: "auto" })
); );
@ -25,7 +24,6 @@ export const relativeTime = (
} }
return Intl.NumberFormat(locale.language, { return Intl.NumberFormat(locale.language, {
style: "unit", style: "unit",
// @ts-expect-error
unit: diff.unit, unit: diff.unit,
unitDisplay: "long", unitDisplay: "long",
}).format(Math.abs(diff.value)); }).format(Math.abs(diff.value));

View File

@ -198,7 +198,6 @@ export const loadPolyfillLocales = async (language: string) => {
Intl.NumberFormat.__addLocaleData(await result.json()); Intl.NumberFormat.__addLocaleData(await result.json());
} }
if ( if (
// @ts-expect-error
Intl.RelativeTimeFormat && Intl.RelativeTimeFormat &&
// @ts-ignore // @ts-ignore
typeof Intl.RelativeTimeFormat.__addLocaleData === "function" typeof Intl.RelativeTimeFormat.__addLocaleData === "function"

View File

@ -257,7 +257,6 @@ export class HaComboBox extends LitElement {
) { ) {
this._overlayMutationObserver?.disconnect(); this._overlayMutationObserver?.disconnect();
this._overlayMutationObserver = undefined; this._overlayMutationObserver = undefined;
// @ts-expect-error
overlay.inert = false; overlay.inert = false;
} else if (mutation.type === "childList") { } else if (mutation.type === "childList") {
mutation.removedNodes.forEach((node) => { mutation.removedNodes.forEach((node) => {

View File

@ -61,7 +61,9 @@ const triggerPhrases = {
}; };
const DATA_CACHE: { const DATA_CACHE: {
[cacheKey: string]: { [entityId: string]: Promise<LogbookEntry[]> }; [cacheKey: string]: {
[entityId: string]: Promise<LogbookEntry[]> | undefined;
};
} = {}; } = {};
export const getLogbookDataForContext = async ( export const getLogbookDataForContext = async (
@ -115,11 +117,11 @@ const getLogbookDataCache = async (
} }
if (entityIdKey in DATA_CACHE[cacheKey]) { if (entityIdKey in DATA_CACHE[cacheKey]) {
return DATA_CACHE[cacheKey][entityIdKey]; return DATA_CACHE[cacheKey][entityIdKey]!;
} }
if (entityId && DATA_CACHE[cacheKey][ALL_ENTITIES]) { if (entityId && DATA_CACHE[cacheKey][ALL_ENTITIES]) {
const entities = await DATA_CACHE[cacheKey][ALL_ENTITIES]; const entities = await DATA_CACHE[cacheKey][ALL_ENTITIES]!;
return entities.filter( return entities.filter(
(entity) => entity.entity_id && entityId.includes(entity.entity_id) (entity) => entity.entity_id && entityId.includes(entity.entity_id)
); );
@ -131,7 +133,7 @@ const getLogbookDataCache = async (
endDate, endDate,
entityId entityId
); );
return DATA_CACHE[cacheKey][entityIdKey]; return DATA_CACHE[cacheKey][entityIdKey]!;
}; };
const getLogbookDataFromServer = ( const getLogbookDataFromServer = (

View File

@ -103,7 +103,7 @@ class HuiTimestampDisplay extends LitElement {
} }
private _updateRelative(): void { private _updateRelative(): void {
if (this.ts && this.hass!.localize) { if (this.ts && this.hass?.localize) {
this._relative = this._relative =
this._format === "relative" this._format === "relative"
? relativeTime(this.ts, this.hass!.locale) ? relativeTime(this.ts, this.hass!.locale)

View File

@ -49,9 +49,9 @@ const getLovelaceStrategy = async <
if ( if (
(await Promise.race([ (await Promise.race([
customElements.whenDefined(tag), customElements.whenDefined(tag),
new Promise((resolve) => new Promise((resolve) => {
setTimeout(() => resolve(true), MAX_WAIT_STRATEGY_LOAD) setTimeout(() => resolve(true), MAX_WAIT_STRATEGY_LOAD);
), }),
])) === true ])) === true
) { ) {
throw new Error( throw new Error(
@ -74,6 +74,7 @@ const generateStrategy = async <T extends keyof GenerateMethods>(
strategyType: string | undefined strategyType: string | undefined
): Promise<ReturnType<GenerateMethods[T]>> => { ): Promise<ReturnType<GenerateMethods[T]>> => {
if (!strategyType) { if (!strategyType) {
// @ts-ignore
return renderError("No strategy type found"); return renderError("No strategy type found");
} }
@ -86,7 +87,7 @@ const generateStrategy = async <T extends keyof GenerateMethods>(
// eslint-disable-next-line // eslint-disable-next-line
console.error(err); console.error(err);
} }
// @ts-ignore
return renderError(err); return renderError(err);
} }
}; };

1949
yarn.lock

File diff suppressed because it is too large Load Diff