Skip to content

Commit 4c7732a

Browse files
authored
Chore: Upgrade Typescript to 4.8.2 (grafana#54901)
* Chore: Upgrade typescript to 4.8.2
1 parent 4866898 commit 4c7732a

File tree

54 files changed

+522
-482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+522
-482
lines changed

.betterer.results

+1-4
Original file line numberDiff line numberDiff line change
@@ -1210,10 +1210,7 @@ exports[`better eslint`] = {
12101210
"packages/grafana-toolkit/src/cli/utils/prompt.ts:5381": [
12111211
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
12121212
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
1213-
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
1214-
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
1215-
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
1216-
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
1213+
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
12171214
],
12181215
"packages/grafana-toolkit/src/cli/utils/useSpinner.ts:5381": [
12191216
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],

.yarn/releases/yarn-3.2.2.cjs .yarn/releases/yarn-3.2.3.cjs

+266-266
Large diffs are not rendered by default.

.yarn/sdks/eslint/bin/eslint.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
if (existsSync(absPnpApiPath)) {
1313
if (!process.versions.pnp) {

.yarn/sdks/eslint/lib/api.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
if (existsSync(absPnpApiPath)) {
1313
if (!process.versions.pnp) {

.yarn/sdks/eslint/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint",
3-
"version": "8.20.0-sdk",
3+
"version": "8.22.0-sdk",
44
"main": "./lib/api.js",
55
"type": "commonjs"
66
}

.yarn/sdks/prettier/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
if (existsSync(absPnpApiPath)) {
1313
if (!process.versions.pnp) {

.yarn/sdks/typescript/bin/tsc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
if (existsSync(absPnpApiPath)) {
1313
if (!process.versions.pnp) {

.yarn/sdks/typescript/bin/tsserver

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
if (existsSync(absPnpApiPath)) {
1313
if (!process.versions.pnp) {

.yarn/sdks/typescript/lib/tsc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
if (existsSync(absPnpApiPath)) {
1313
if (!process.versions.pnp) {

.yarn/sdks/typescript/lib/tsserver.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
const moduleWrapper = tsserver => {
1313
if (!process.versions.pnp) {

.yarn/sdks/typescript/lib/tsserverlibrary.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
const moduleWrapper = tsserver => {
1313
if (!process.versions.pnp) {

.yarn/sdks/typescript/lib/typescript.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire} = require(`module`);
55
const {resolve} = require(`path`);
66

77
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
10+
const absRequire = createRequire(absPnpApiPath);
1111

1212
if (existsSync(absPnpApiPath)) {
1313
if (!process.versions.pnp) {

.yarn/sdks/typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript",
3-
"version": "4.7.4-sdk",
3+
"version": "4.8.2-sdk",
44
"main": "./lib/typescript.js",
55
"type": "commonjs"
66
}

.yarnrc.yml

+29-29
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,40 @@ enableTelemetry: false
33
nodeLinker: pnp
44

55
packageExtensions:
6-
'@mdx-js/[email protected]':
6+
"@mdx-js/[email protected]":
77
peerDependencies:
88
react: 17.0.1
9-
'@storybook/[email protected]':
9+
"@npmcli/[email protected]":
10+
dependencies:
11+
which: ^2.0.2
12+
"@storybook/[email protected]":
1013
peerDependencies:
11-
'@storybook/manager-webpack5': 6.4.21
12-
'@storybook/[email protected]':
14+
"@storybook/manager-webpack5": 6.4.21
15+
"@storybook/[email protected]":
1316
peerDependencies:
14-
'@storybook/components': 6.4.21
15-
'@storybook/core-events': 6.4.21
16-
'@storybook/manager-webpack5': 6.4.21
17-
'@storybook/theming': 6.4.21
18-
'@storybook/[email protected]':
17+
"@storybook/components": 6.4.21
18+
"@storybook/core-events": 6.4.21
19+
"@storybook/manager-webpack5": 6.4.21
20+
"@storybook/theming": 6.4.21
21+
"@storybook/[email protected]":
1922
peerDependencies:
20-
'@babel/core': ^7.0.0
21-
'@storybook/[email protected]':
23+
"@babel/core": ^7.0.0
24+
"@storybook/[email protected]":
2225
peerDependencies:
23-
'@babel/core': ^7.0.0
24-
'@storybook/manager-webpack5': 6.4.21
25-
'@storybook/[email protected]':
26+
"@babel/core": ^7.0.0
27+
"@storybook/manager-webpack5": 6.4.21
28+
"@storybook/[email protected]":
2629
peerDependencies:
27-
'@babel/core': ^7.0.0
28-
'@storybook/[email protected]':
30+
"@babel/core": ^7.0.0
31+
"@storybook/[email protected]":
2932
peerDependencies:
30-
'@storybook/manager-webpack5': 6.4.21
33+
"@storybook/manager-webpack5": 6.4.21
3134
3235
dependencies:
3336
assert: 2.0.0
3437
3538
dependencies:
36-
'@daybrush/utils': 1.7.0
39+
"@daybrush/utils": 1.7.0
3740
framework-utils: ^1.1.0
3841
3942
peerDependencies:
@@ -48,9 +51,9 @@ packageExtensions:
4851
react-simple-compat: 1.2.2
4952
5053
dependencies:
51-
'@egjs/agent': ^2.2.1
52-
'@egjs/children-differ': ^1.0.1
53-
'@scena/matrix': 1.1.1
54+
"@egjs/agent": ^2.2.1
55+
"@egjs/children-differ": ^1.0.1
56+
"@scena/matrix": 1.1.1
5457
css-to-mat: ^1.0.3
5558
gesto: ^1.9.0
5659
overlap-area: ^1.0.0
@@ -62,20 +65,17 @@ packageExtensions:
6265
webpack: 4.41.5
6366
6467
peerDependencies:
65-
prop-types: '*'
68+
prop-types: "*"
6669
6770
peerDependencies:
6871
react-dom: 17.0.1
69-
'@npmcli/[email protected]':
70-
dependencies:
71-
which: ^2.0.2
7272

7373
plugins:
7474
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
75-
spec: '@yarnpkg/plugin-typescript'
75+
spec: "@yarnpkg/plugin-typescript"
7676
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
77-
spec: '@yarnpkg/plugin-interactive-tools'
77+
spec: "@yarnpkg/plugin-interactive-tools"
7878
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
79-
spec: 'https://mskelton.dev/yarn-outdated/v2'
79+
spec: "https://mskelton.dev/yarn-outdated/v2"
8080

81-
yarnPath: .yarn/releases/yarn-3.2.2.cjs
81+
yarnPath: .yarn/releases/yarn-3.2.3.cjs

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@
164164
"@types/testing-library__react-hooks": "^3.2.0",
165165
"@types/tinycolor2": "1.4.3",
166166
"@types/uuid": "8.3.4",
167-
"@typescript-eslint/eslint-plugin": "5.31.0",
168-
"@typescript-eslint/parser": "5.31.0",
167+
"@typescript-eslint/eslint-plugin": "5.36.2",
168+
"@typescript-eslint/parser": "5.36.2",
169169
"@wojtekmaj/enzyme-adapter-react-17": "0.6.7",
170170
"autoprefixer": "10.4.7",
171171
"axios": "0.27.2",
@@ -234,7 +234,7 @@
234234
"ts-jest": "28.0.7",
235235
"ts-loader": "9.3.1",
236236
"ts-node": "10.9.1",
237-
"typescript": "4.7.4",
237+
"typescript": "4.8.2",
238238
"wait-on": "6.0.1",
239239
"webpack": "5.74.0",
240240
"webpack-bundle-analyzer": "4.5.0",
@@ -280,7 +280,7 @@
280280
"@react-stately/collections": "3.4.1",
281281
"@react-stately/menu": "3.4.1",
282282
"@react-stately/tree": "3.3.1",
283-
"@reduxjs/toolkit": "1.8.3",
283+
"@reduxjs/toolkit": "1.8.5",
284284
"@sentry/browser": "6.19.7",
285285
"@sentry/types": "6.19.7",
286286
"@sentry/utils": "6.19.7",
@@ -420,5 +420,5 @@
420420
"engines": {
421421
"node": ">= 16"
422422
},
423-
"packageManager": "[email protected].2"
423+
"packageManager": "[email protected].3"
424424
}

packages/grafana-data/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"rollup-plugin-esbuild": "^4.9.1",
8888
"rollup-plugin-node-externals": "^4.1.0",
8989
"sinon": "14.0.0",
90-
"typescript": "4.7.4"
90+
"typescript": "4.8.2"
9191
},
9292
"peerDependencies": {
9393
"react": "^16.8.0 || ^17.0.0",

packages/grafana-data/src/types/app.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export enum CoreApp {
1818
PanelViewer = 'panel-viewer',
1919
}
2020

21-
export interface AppRootProps<T = KeyValue> {
21+
export interface AppRootProps<T extends KeyValue = KeyValue> {
2222
meta: AppPluginMeta<T>;
2323
/**
2424
* base URL segment for an app, /app/pluginId
@@ -44,11 +44,11 @@ export interface AppRootProps<T = KeyValue> {
4444
path: string;
4545
}
4646

47-
export interface AppPluginMeta<T = KeyValue> extends PluginMeta<T> {
47+
export interface AppPluginMeta<T extends KeyValue = KeyValue> extends PluginMeta<T> {
4848
// TODO anything specific to apps?
4949
}
5050

51-
export class AppPlugin<T = KeyValue> extends GrafanaPlugin<AppPluginMeta<T>> {
51+
export class AppPlugin<T extends KeyValue = KeyValue> extends GrafanaPlugin<AppPluginMeta<T>> {
5252
// Content under: /a/${plugin-id}/*
5353
root?: ComponentType<AppRootProps<T>>;
5454
rootNav?: NavModel; // Initial navigation model

packages/grafana-data/src/types/datasource.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ import { CustomVariableSupport, DataSourceVariableSupport, StandardVariableSuppo
1616

1717
import { DataSourceRef, WithAccessControlMetadata } from '.';
1818

19-
export interface DataSourcePluginOptionsEditorProps<JSONData = DataSourceJsonData, SecureJSONData = {}> {
19+
export interface DataSourcePluginOptionsEditorProps<
20+
JSONData extends DataSourceJsonData = DataSourceJsonData,
21+
SecureJSONData = {}
22+
> {
2023
options: DataSourceSettings<JSONData, SecureJSONData>;
2124
onOptionsChange: (options: DataSourceSettings<JSONData, SecureJSONData>) => void;
2225
}

packages/grafana-data/src/types/fieldOverrides.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export interface FieldOverrideContext extends StandardEditorContext<any, any> {
6363
field?: Field;
6464
dataFrameIndex?: number; // The index for the selected field frame
6565
}
66-
export interface FieldConfigEditorProps<TValue, TSettings>
66+
export interface FieldConfigEditorProps<TValue, TSettings extends {}>
6767
extends Omit<StandardEditorProps<TValue, TSettings>, 'item'> {
6868
item: FieldConfigPropertyItem<any, TValue, TSettings>; // The property info
6969
value: TValue;

0 commit comments

Comments
 (0)