8000 feat: update to TypeScript 4.9 (#5716) · omril1/typescript-eslint@aed2ecd · GitHub
[go: up one dir, main page]

Skip to content

Commit aed2ecd

Browse files
sosukesuzukiOmri Luzon
authored and
Omri Luzon
committed
feat: update to TypeScript 4.9 (typescript-eslint#5716)
* feat: update typescript to 4.9.1 * fix: add patch file for 4.9.1-beta * feat(typescript-estree): update version range * feat: run `generate-lib` script * chore: update patch for typescript * fix: run `lint-fix` * feat: update to typescript 4.9.2-rc * chore: run patch-package * chore: update `@types/node`
1 parent 7e2185e commit aed2ecd

File tree

11 files changed

+61
-33
lines changed

11 files changed

+61
-33
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@types/lodash": "^4.14.182",
6868
"@types/marked": "^4.0.3",
6969
"@types/ncp": "^2.0.5",
70-
"@types/node": "^18.0.0",
70+
"@types/node": "^18.11.9",
7171
"@types/prettier": "^2.6.0",
7272
"@types/rimraf": "^3.0.2",
7373
"@types/semver": "^7.3.9",
@@ -104,11 +104,11 @@
104104
"tmp": "^0.2.1",
105105
"ts-node": "^10.7.0",
106106
"tslint": "^6.1.3",
107-
"typescript": ">=3.3.1 <4.9.0"
107+
"typescript": ">=3.3.1 <4.8.3 || 4.9.2-rc"
108108
},
109109
"resolutions": {
110-
"typescript": "~4.8.3",
111-
"@types/node": "^18.0.0",
110+
"typescript": "~4.9.2-rc",
111+
"@types/node": "^18.11.9",
112112
"//": "Pin jest to v29 across the repo",
113113
"@jest/create-cache-key-function": "^29",
114114
"@jest/reporters": "^29",

packages/scope-manager/src/lib/dom.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const dom = {
6666
DeviceMotionEventInit: TYPE,
6767
DeviceMotionEventRotationRateInit: TYPE,
6868
DeviceOrientationEventInit: TYPE,
69-
DisplayMediaStreamConstraints: TYPE,
69+
DisplayMediaStreamOptions: TYPE,
7070
DocumentTimelineOptions: TYPE,
7171
DoubleRange: TYPE,
7272
DragEventInit: TYPE,
@@ -143,7 +143,6 @@ export const dom = {
143143
MediaMetadataInit: TYPE,
144144
MediaPositionState: TYPE,
145145
MediaQueryListEventInit: TYPE,
146-
MediaRecorderErrorEventInit: TYPE,
147146
MediaRecorderOptions: TYPE,
148147
MediaSessionActionDetails: TYPE,
149148
MediaStreamAudioSourceOptions: TYPE,
@@ -184,6 +183,7 @@ export const dom = {
184183
PeriodicWaveConstraints: TYPE,
185184
PeriodicWaveOptions: TYPE,
186185
PermissionDescriptor: TYPE,
186+
PictureInPictureEventInit: TYPE,
187187
PointerEventInit: TYPE,
188188
PopStateEventInit: TYPE,
189189
PositionOptions: TYPE,
@@ -243,6 +243,7 @@ export const dom = {
243243
RTCStats: TYPE,
244244
RTCTrackEventInit: TYPE,
245245
RTCTransportStats: TYPE,
246+
ReadableStreamGetReaderOptions: TYPE,
246247
ReadableStreamReadDoneResult: TYPE,
247248
ReadableStreamReadValueResult: TYPE,
248249
ReadableWritablePair: TYPE,
@@ -284,6 +285,8 @@ export const dom = {
284285
TransitionEventInit: TYPE,
285286
UIEventInit: TYPE,
286287
ULongRange: TYPE,
288+
UnderlyingByteSource: TYPE,
289+
UnderlyingDefaultSource: TYPE,
287290
UnderlyingSink: TYPE,
288291
UnderlyingSource: TYPE,
289292
ValidityStateFlags: TYPE,
@@ -350,10 +353,13 @@ export const dom = {
350353
CSSConditionRule: TYPE_VALUE,
351354
CSSCounterStyleRule: TYPE_VALUE,
352355
CSSFontFaceRule: TYPE_VALUE,
356+
CSSFontPaletteValuesRule: TYPE_VALUE,
353357
CSSGroupingRule: TYPE_VALUE,
354358
CSSImportRule: TYPE_VALUE,
355359
CSSKeyframeRule: TYPE_VALUE,
356360
CSSKeyframesRule: TYPE_VALUE,
361+
CSSLayerBlockRule: TYPE_VALUE,
362+
CSSLayerStatementRule: TYPE_VALUE,
357363
CSSMediaRule: TYPE_VALUE,
358364
CSSNamespaceRule: TYPE_VALUE,
359365
CSSPageRule: TYPE_VALUE,
@@ -449,6 +455,7 @@ export const dom = {
449455
EXT_frag_depth: TYPE,
450456
EXT_sRGB: TYPE,
451457
EXT_shader_texture_lod: TYPE,
458+
EXT_texture_compression_bptc: TYPE,
452459
EXT_texture_compression_rgtc: TYPE,
453460
EXT_texture_filter_anisotropic: TYPE,
454461
ElementEventMap: TYPE,
@@ -641,7 +648,6 @@ export const dom = {
641648
MediaQueryListEvent: TYPE_VALUE,
642649
MediaRecorderEventMap: TYPE,
643650
MediaRecorder: TYPE_VALUE,
644-
MediaRecorderErrorEvent: TYPE_VALUE,
645651
MediaSession: TYPE_VALUE,
646652
MediaSourceEventMap: TYPE,
647653
MediaSource: TYPE_VALUE,
@@ -724,6 +730,7 @@ export const dom = {
724730
PermissionStatusEventMap: TYPE,
725731
PermissionStatus: TYPE_VALUE,
726732
Permissions: TYPE_VALUE,
733+
PictureInPictureEvent: TYPE_VALUE,
727734
PictureInPictureWindowEventMap: TYPE,
728735
PictureInPictureWindow: TYPE_VALUE,
729736
Plugin: TYPE_VALUE,
@@ -1123,8 +1130,6 @@ export const dom = {
11231130
TimerHandler: TYPE,
11241131
Transferable: TYPE,
11251132
Uint32List: TYPE,
1126-
UvmEntries: TYPE,
1127-
UvmEntry: TYPE,
11281133
VibratePattern: TYPE,
11291134
WindowProxy: TYPE,
11301135
XMLHttpRequestBodyInit: TYPE,
@@ -1227,7 +1232,6 @@ export const dom = {
12271232
RTCIceCandidateType: TYPE,
12281233
RTCIceComponent: TYPE,
12291234
RTCIceConnectionState: TYPE,
1230-
RTCIceCredentialType: TYPE,
12311235
RTCIceGathererState: TYPE,
12321236
RTCIceGatheringState: TYPE,
12331237
RTCIceProtocol: TYPE,
@@ -1243,6 +1247,8 @@ export const dom = {
12431247
RTCSignalingState: TYPE,
12441248
RTCStatsIceCandidatePairState: TYPE,
12451249
RTCStatsType: TYPE,
1250+
ReadableStreamReaderMode: TYPE,
1251+
ReadableStreamType: TYPE,
12461252
ReadyState: TYPE,
12471253
RecordingState: TYPE,
12481254
ReferrerPolicy: TYPE,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// THIS CODE WAS AUTOMATICALLY GENERATED
2+
// DO NOT EDIT THIS CODE BY HAND
3+
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
4+
// npx nx generate-lib @typescript-eslint/scope-manager
5+
6+
import type { ImplicitLibVariableOptions } from '../variable';
7+
import { TYPE_VALUE } from './base-config';
8+
9+
export const es2019_intl = {
10+
Intl: TYPE_VALUE,
11+
} as Record<string, ImplicitLibVariableOptions>;

packages/scope-manager/src/lib/es2019.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import type { ImplicitLibVariableOptions } from '../variable';
77
import { es2018 } from './es2018';
88
import { es2019_array } from './es2019.array';
9+
import { es2019_intl } from './es2019.intl';
910
import { es2019_object } from './es2019.object';
1011
import { es2019_string } from './es2019.string';
1112
import { es2019_symbol } from './es2019.symbol';
@@ -16,4 +17,5 @@ export const es2019 = {
1617
...es2019_object,
1718
...es2019_string,
1819
...es2019_symbol,
20+
...es2019_intl,
1921
} as Record<string, ImplicitLibVariableOptions>;

packages/scope-manager/src/lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { es2018_regexp } from './es2018.regexp';
3838
import { es2019 } from './es2019';
3939
import { es2019_array } from './es2019.array';
4040
import { es2019_full } from './es2019.full';
41+
import { es2019_intl } from './es2019.intl';
4142
import { es2019_object } from './es2019.object';
4243
import { es2019_string } from './es2019.string';
4344
import { es2019_symbol } from './es2019.symbol';
@@ -124,6 +125,7 @@ const lib = {
124125
'es2019.object': es2019_object,
125126
'es2019.string': es2019_string,
126127
'es2019.symbol': es2019_symbol,
128+
'es2019.intl': es2019_intl,
127129
'es2020.bigint': es2020_bigint,
128130
'es2020.date': es2020_date,
129131
'es2020.promise': es2020_promise,

packages/scope-manager/src/lib/webworker.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export const webworker = {
8888
QueuingStrategyInit: TYPE,
8989
RTCEncodedAudioFrameMetadata: TYPE,
9090
RTCEncodedVideoFrameMetadata: TYPE,
91+
ReadableStreamGetReaderOptions: TYPE,
9192
ReadableStreamReadDoneResult: TYPE,
9293
ReadableStreamReadValueResult: TYPE,
9394
ReadableWritablePair: TYPE,
@@ -108,6 +109,8 @@ export const webworker = {
108109
TextDecoderOptions: TYPE,
109110
TextEncoderEncodeIntoResult: TYPE,
110111
Transformer: TYPE,
112+
UnderlyingByteSource: TYPE,
113+
UnderlyingDefaultSource: TYPE,
111114
UnderlyingSink: TYPE,
112115
UnderlyingSource: TYPE,
113116
VideoColorSpaceInit: TYPE,
@@ -157,6 +160,7 @@ export const webworker = {
157160
EXT_frag_depth: TYPE,
158161
EXT_sRGB: TYPE,
159162
EXT_shader_texture_lod: TYPE,
163+
EXT_texture_compression_bptc: TYPE,
160164
EXT_texture_compression_rgtc: TYPE,
161165
EXT_texture_filter_anisotropic: TYPE,
162166
ErrorEvent: TYPE_VALUE,
@@ -431,6 +435,8 @@ export const webworker = {
431435
PremultiplyAlpha: TYPE,
432436
PushEncryptionKeyName: TYPE,
433437
RTCEncodedVideoFrameType: TYPE,
438+
ReadableStreamReaderMode: TYPE,
439+
ReadableStreamType: TYPE,
434440
ReferrerPolicy: TYPE,
435441
RequestCache: TYPE,
436442
RequestCredentials: TYPE,

packages/scope-manager/src/referencer/Referencer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ class Referencer extends Visitor {
675675
member.id.type === AST_NODE_TYPES.Literal &&
676676
typeof member.id.value === 'string'
677677
) {
678-
const name = member.id as TSESTree.StringLiteral;
678+
const name = member.id;
679679
this.currentScope().defineLiteralIdentifier(
680680
name,
681681
new TSEnumMemberDefinition(name, member),

packages/types/src/lib.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Lib =
4646
| 'es2019.object'
4747
| 'es2019.string'
4848
| 'es2019.symbol'
49+
| 'es2019.intl'
4950
| 'es2020.bigint'
5051
| 'es2020.date'
5152
| 'es2020.promise'

packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import type { ParseSettings } from './index';
66
* This needs to be kept in sync with the top-level README.md in the
77
* typescript-eslint monorepo
88
*/
9-
const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.9.0';
9+
const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <5.0.0';
1010

1111
/*
1212
* The semver package will ignore prerelease ranges, and we don't want to explicitly document every one
1313
* List them all separately here, so we can automatically create the full string
1414
*/
15-
const SUPPORTED_PRERELEASE_RANGES: string[] = [];
15+
const SUPPORTED_PRERELEASE_RANGES: string[] = ['4.9.2-rc'];
1616
const ACTIVE_TYPESCRIPT_VERSION = ts.version;
1717
const isRunningSupportedTypeScriptVersion = semver.satisfies(
1818
ACTIVE_TYPESCRIPT_VERSION,

patches/typescript+4.8.3.patch renamed to patches/typescript+4.9.2-rc.patch

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
diff --git a/node_modules/typescript/lib/typescript.d.ts b/node_modules/typescript/lib/typescript.d.ts
2-
index 0fd60ae..02f4fe7 100644
2+
index 54e4c65..aa00912 100644
33
--- a/node_modules/typescript/lib/typescript.d.ts
44
+++ b/node_modules/typescript/lib/typescript.d.ts
5-
@@ -425,8 +425,8 @@ declare namespace ts {
6-
JSDocFunctionType = 317,
7-
JSDocVariadicType = 318,
8-
JSDocNamepathType = 319,
5+
@@ -428,8 +428,8 @@ declare namespace ts {
6+
JSDocFunctionType = 320,
7+
JSDocVariadicType = 321,
8+
JSDocNamepathType = 322,
99
+ /** @deprecated This was only added in 4.7 */
10-
JSDoc = 320,
10+
JSDoc = 323,
1111
- /** @deprecated Use SyntaxKind.JSDoc */
12-
JSDocComment = 320,
13-
JSDocText = 321,
14-
JSDocTypeLiteral = 322,
15-
@@ -4374,7 +4374,13 @@ declare namespace ts {
12+
JSDocComment = 323,
13+
JSDocText = 324,
14+
JSDocTypeLiteral = 325,
15+
@@ -4395,7 +4395,13 @@ declare namespace ts {
1616
function symbolName(symbol: Symbol): string;
1717
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
1818
function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;
@@ -26,7 +26,7 @@ index 0fd60ae..02f4fe7 100644
2626
function getModifiers(node: HasModifiers): readonly Modifier[] | undefined;
2727
/**
2828
* Gets the JSDoc parameter tags for the node if present.
29-
@@ -4834,7 +4840,13 @@ declare namespace ts {
29+
@@ -4857,7 +4863,13 @@ declare namespace ts {
3030
}
3131
declare namespace ts {
3232
function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
@@ -40,7 +40,7 @@ index 0fd60ae..02f4fe7 100644
4040
function canHaveDecorators(node: Node): node is HasDecorators;
4141
}
4242
declare namespace ts {
43-
@@ -7924,7 +7936,7 @@ declare namespace ts {
43+
@@ -7958,7 +7970,7 @@ declare namespace ts {
4444
* const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined;
4545
* ```
4646
*/

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,10 +4124,10 @@
41244124
dependencies:
41254125
"@types/node" "*"
41264126

4127-
"@types/node@*", "@types/node@12.20.24", "@types/node@^17.0.5", "@types/node@^18.0.0":
4128-
version "18.8.3"
4129-
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.8.3.tgz#ce750ab4017effa51aed6a7230651778d54e327c"
4130-
integrity sha512-0os9vz6BpGwxGe9LOhgP/ncvYN5Tx1fNcd2TM3rD/aCGBkysb+ZWpXEocG24h6ZzOi13+VB8HndAQFezsSOw1w==
4127+
"@types/node@*", "@types/node@12.20.24", "@types/node@^17.0.5", "@types/node@^18.11.9":
4128+
version "18.11.9"
4129+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
4130+
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
41314131

41324132
"@types/normalize-package-data@^2.4.0":
41334133
version "2.4.1"
@@ -13627,10 +13627,10 @@ typedarray@^0.0.6:
1362713627
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
1362813628
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1362913629

13630-
typescript@*, "typescript@>=3.3.1 <4.9.0", "typescript@^3 || ^4", typescript@next, typescript@~4.8.3, typescript@~4.8.4:
13631-
version "4.8.4"
13632-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
13633-
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
13630+
typescript@*, "typescript@>=3.3.1 <4.8.3 || 4.9.2-rc", "typescript@^3 || ^4", typescript@next, typescript@~4.8.4, typescript@~4.9.2-rc:
13631+
version "4.9.2-rc"
13632+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.2-rc.tgz#3525dbeb8458a8c98ce7d60724e4a9380d7b46e7"
13633+
integrity sha512-Ly9UUxJBfiiFjfegI1gsW9FI8Xhw1cuwRMBJ4wdYg+UXZR4VnZvD1OnBDj/iQ2U+tWbWEjYqJ5xx1Cwr4Vsa4w==
1363413634

1363513635
ua-parser-js@^0.7.30:
1363613636
version "0.7.31"

0 commit comments

Comments
 (0)
0