Skip to content

Commit

Permalink
feat: update to TypeScript 4.7-rc (#4829)
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed May 16, 2022
1 parent 0ecd58f commit 6fe783c
Show file tree
Hide file tree
Showing 19 changed files with 121 additions and 24 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -112,10 +112,10 @@
"tmp": "^0.2.1",
"ts-node": "^10.7.0",
"tslint": "^6.1.3",
"typescript": ">=3.3.1 <4.7.0"
"typescript": ">=3.3.1 <4.6.0 || 4.7.1-rc"
},
"resolutions": {
"typescript": "4.6.4",
"typescript": "4.7.1-rc",
"@types/node": "^17.0.31",
"pretty-format": "^28.1.0",
"//": "Pin jest to v28 across the repo",
Expand Down
Expand Up @@ -12,7 +12,8 @@ type ParameterCapableTSNode =
| ts.TypeReferenceNode
| ts.ExpressionWithTypeArguments
| ts.JsxOpeningElement
| ts.JsxSelfClosingElement;
| ts.JsxSelfClosingElement
| ts.TypeQueryNode;

type MessageIds = 'unnecessaryTypeParameter';

Expand Down
4 changes: 4 additions & 0 deletions packages/scope-manager/src/lib/dom.iterable.ts
Expand Up @@ -18,6 +18,7 @@ export const dom_iterable = {
DOMStringList: TYPE,
DOMTokenList: TYPE,
DataTransferItemList: TYPE,
EventCounts: TYPE,
FileList: TYPE,
FontFaceSet: TYPE,
FormData: TYPE,
Expand All @@ -29,6 +30,9 @@ export const dom_iterable = {
Headers: TYPE,
IDBDatabase: TYPE,
IDBObjectStore: TYPE,
MIDIInputMap: TYPE,
MIDIOutput: TYPE,
MIDIOutputMap: TYPE,
MediaKeyStatusMap: TYPE,
MediaList: TYPE,
MessageEvent: TYPE,
Expand Down
48 changes: 44 additions & 4 deletions packages/scope-manager/src/lib/dom.ts
Expand Up @@ -127,6 +127,9 @@ export const dom = {
LockInfo: TYPE,
LockManagerSnapshot: TYPE,
LockOptions: TYPE,
MIDIConnectionEventInit: TYPE,
MIDIMessageEventInit: TYPE,
MIDIOptions: TYPE,
MediaCapabilitiesDecodingInfo: TYPE,
MediaCapabilitiesEncodingInfo: TYPE,
MediaCapabilitiesInfo: TYPE,
Expand Down Expand Up @@ -157,6 +160,7 @@ export const dom = {
MouseEventInit: TYPE,
MultiCacheQueryOptions: TYPE,
MutationObserverInit: TYPE,
NavigationPreloadState: TYPE,
NotificationAction: TYPE,
NotificationOptions: TYPE,
OfflineAudioCompletionEventInit: TYPE,
Expand Down Expand Up @@ -206,6 +210,10 @@ export const dom = {
RTCDataChannelEventInit: TYPE,
RTCDataChannelInit: TYPE,
RTCDtlsFingerprint: TYPE,
RTCEncodedAudioFrameMetadata: TYPE,
RTCEncodedVideoFrameMetadata: TYPE,
RTCErrorEventInit: TYPE,
RTCErrorInit: TYPE,
RTCIceCandidateInit: TYPE,
RTCIceCandidatePairStats: TYPE,
RTCIceServer: TYPE,
Expand Down Expand Up @@ -280,7 +288,9 @@ export const dom = {
ULongRange: TYPE,
UnderlyingSink: TYPE,
UnderlyingSource: TYPE,
VideoColorSpaceInit: TYPE,
VideoConfiguration: TYPE,
VideoFrameMetadata: TYPE,
WaveShaperOptions: TYPE,
WebGLContextAttributes: TYPE,
WebGLContextEventInit: TYPE,
Expand Down Expand Up @@ -449,6 +459,7 @@ export const dom = {
ElementInternals: TYPE_VALUE,
ErrorEvent: TYPE_VALUE,
Event: TYPE_VALUE,
EventCounts: TYPE_VALUE,
EventListener: TYPE,
EventListenerObject: TYPE,
EventSourceEventMap: TYPE,
Expand Down Expand Up @@ -504,7 +515,7 @@ export const dom = {
HTMLDataElement: TYPE_VALUE,
HTMLDataListElement: TYPE_VALUE,
HTMLDetailsElement: TYPE_VALUE,
HTMLDialogElement: TYPE,
HTMLDialogElement: TYPE_VALUE,
HTMLDirectoryElement: TYPE_VALUE,
HTMLDivElement: TYPE_VALUE,
HTMLDocument: TYPE_VALUE,
Expand Down Expand Up @@ -609,6 +620,17 @@ export const dom = {
Location: TYPE_VALUE,
Lock: TYPE_VALUE,
LockManager: TYPE_VALUE,
MIDIAccessEventMap: TYPE,
MIDIAccess: TYPE_VALUE,
MIDIConnectionEvent: TYPE_VALUE,
MIDIInputEventMap: TYPE,
MIDIInput: TYPE_VALUE,
MIDIInputMap: TYPE_VALUE,
MIDIMessageEvent: TYPE_VALUE,
MIDIOutput: TYPE_VALUE,
MIDIOutputMap: TYPE_VALUE,
MIDIPortEventMap: TYPE,
MIDIPort: TYPE_VALUE,
MathMLElementEventMap: TYPE,
MathMLElement: TYPE_VALUE,
MediaCapabilities: TYPE_VALUE,
Expand Down Expand Up @@ -653,13 +675,15 @@ export const dom = {
MutationObserver: TYPE_VALUE,
MutationRecord: TYPE_VALUE,
NamedNodeMap: TYPE_VALUE,
NavigationPreloadManager: TYPE_VALUE,
Navigator: TYPE_VALUE,
NavigatorAutomationInformation: TYPE,
NavigatorConcurrentHardware: TYPE,
NavigatorContentUtils: TYPE,
NavigatorCookies: TYPE,
NavigatorID: TYPE,
NavigatorLanguage: TYPE,
NavigatorLocks: TYPE,
NavigatorNetworkInformation: TYPE,
NavigatorOnLine: TYPE,
NavigatorPlugins: TYPE,
Expand Down Expand Up @@ -736,7 +760,12 @@ export const dom = {
RTCDataChannelEvent: TYPE_VALUE,
RTCDtlsTransportEventMap: TYPE,
RTCDtlsTransport: TYPE_VALUE,
RTCEncodedAudioFrame: TYPE_VALUE,
RTCEncodedVideoFrame: TYPE_VALUE,
RTCError: TYPE_VALUE,
RTCErrorEvent: TYPE_VALUE,
RTCIceCandidate: TYPE_VALUE,
RTCIceTransportEventMap: TYPE,
RTCIceTransport: TYPE_VALUE,
RTCPeerConnectionEventMap: TYPE,
RTCPeerConnection: TYPE_VALUE,
Expand All @@ -745,6 +774,8 @@ export const dom = {
RTCRtpReceiver: TYPE_VALUE,
RTCRtpSender: TYPE_VALUE,
RTCRtpTransceiver: TYPE_VALUE,
RTCSctpTransportEventMap: TYPE,
RTCSctpTransport: TYPE_VALUE,
RTCSessionDescription: TYPE_VALUE,
RTCStatsReport: TYPE_VALUE,
RTCTrackEvent: TYPE_VALUE,
Expand Down Expand Up @@ -934,14 +965,14 @@ export const dom = {
VTTCue: TYPE_VALUE,
VTTRegion: TYPE_VALUE,
ValidityState: TYPE_VALUE,
VideoColorSpace: TYPE_VALUE,
VideoPlaybackQuality: TYPE_VALUE,
VisualViewportEventMap: TYPE,
VisualViewport: TYPE_VALUE,
WEBGL_color_buffer_float: TYPE,
WEBGL_compressed_texture_astc: TYPE,
WEBGL_compressed_texture_etc: TYPE,
WEBGL_compressed_texture_etc1: TYPE,
WEBGL_compressed_texture_pvrtc: TYPE,
WEBGL_compressed_texture_s3tc: TYPE,
WEBGL_compressed_texture_s3tc_srgb: TYPE,
WEBGL_debug_renderer_info: TYPE,
Expand Down Expand Up @@ -1040,6 +1071,7 @@ export const dom = {
UnderlyingSourceCancelCallback: TYPE,
UnderlyingSourcePullCallback: TYPE,
UnderlyingSourceStartCallback: TYPE,
VideoFrameRequestCallback: TYPE,
VoidFunction: TYPE,
HTMLElementTagNameMap: TYPE,
HTMLElementDeprecatedTagNameMap: TYPE,
Expand All @@ -1055,7 +1087,6 @@ export const dom = {
CSSNumberish: TYPE,
CanvasImageSource: TYPE,
ClipboardItemData: TYPE,
ClipboardItemDataType: TYPE,
ClipboardItems: TYPE,
ConstrainBoolean: TYPE,
ConstrainDOMString: TYPE,
Expand Down Expand Up @@ -1170,6 +1201,9 @@ export const dom = {
KeyUsage: TYPE,
LineAlignSetting: TYPE,
LockMode: TYPE,
MIDIPortConnectionState: TYPE,
MIDIPortDeviceState: TYPE,
MIDIPortType: TYPE,
MediaDecodingType: TYPE,
MediaDeviceKind: TYPE,
MediaEncodingType: TYPE,
Expand All @@ -1181,7 +1215,7 @@ export const dom = {
MediaSessionAction: TYPE,
MediaSessionPlaybackState: TYPE,
MediaStreamTrackState: TYPE,
NavigationType: TYPE,
NavigationTimingType: TYPE,
NotificationDirection: TYPE,
NotificationPermission: TYPE,
OrientationLockType: TYPE,
Expand All @@ -1203,6 +1237,8 @@ export const dom = {
RTCDataChannelState: TYPE,
RTCDegradationPreference: TYPE,
RTCDtlsTransportState: TYPE,
RTCEncodedVideoFrameType: TYPE,
RTCErrorDetailType: TYPE,
RTCIceCandidateType: TYPE,
RTCIceComponent: TYPE,
RTCIceConnectionState: TYPE,
Expand All @@ -1217,6 +1253,7 @@ export const dom = {
RTCPriorityType: TYPE,
RTCRtcpMuxPolicy: TYPE,
RTCRtpTransceiverDirection: TYPE,
RTCSctpTransportState: TYPE,
RTCSdpType: TYPE,
RTCSignalingState: TYPE,
RTCStatsIceCandidatePairState: TYPE,
Expand Down Expand Up @@ -1250,7 +1287,10 @@ export const dom = {
TouchType: TYPE,
TransferFunction: TYPE,
UserVerificationRequirement: TYPE,
VideoColorPrimaries: TYPE,
VideoFacingModeEnum: TYPE,
VideoMatrixCoefficients: TYPE,
VideoTransferCharacteristics: TYPE,
WebGLPowerPreference: TYPE,
WorkerType: TYPE,
XMLHttpRequestResponseType: TYPE,
Expand Down
2 changes: 2 additions & 0 deletions packages/scope-manager/src/lib/es2020.bigint.ts
Expand Up @@ -4,9 +4,11 @@
// npx nx generate-lib @typescript-eslint/scope-manager

import { ImplicitLibVariableOptions } from '../variable';
import { es2020_intl } from './es2020.intl';
import { TYPE, TYPE_VALUE } from './base-config';

export const es2020_bigint = {
...es2020_intl,
BigIntToLocaleStringOptions: TYPE,
BigInt: TYPE_VALUE,
BigIntConstructor: TYPE,
Expand Down
13 changes: 13 additions & 0 deletions packages/scope-manager/src/lib/es2020.date.ts
@@ -0,0 +1,13 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager

import { ImplicitLibVariableOptions } from '../variable';
import { es2020_intl } from './es2020.intl';
import { TYPE } from './base-config';

export const es2020_date = {
...es2020_intl,
Date: TYPE,
} as Record<string, ImplicitLibVariableOptions>;
13 changes: 13 additions & 0 deletions packages/scope-manager/src/lib/es2020.number.ts
@@ -0,0 +1,13 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager

import { ImplicitLibVariableOptions } from '../variable';
import { es2020_intl } from './es2020.intl';
import { TYPE } from './base-config';

export const es2020_number = {
...es2020_intl,
Number: TYPE,
} as Record<string, ImplicitLibVariableOptions>;
4 changes: 4 additions & 0 deletions packages/scope-manager/src/lib/es2020.ts
Expand Up @@ -6,6 +6,8 @@
import { ImplicitLibVariableOptions } from '../variable';
import { es2019 } from './es2019';
import { es2020_bigint } from './es2020.bigint';
import { es2020_date } from './es2020.date';
import { es2020_number } from './es2020.number';
import { es2020_promise } from './es2020.promise';
import { es2020_sharedmemory } from './es2020.sharedmemory';
import { es2020_string } from './es2020.string';
Expand All @@ -15,6 +17,8 @@ import { es2020_intl } from './es2020.intl';
export const es2020 = {
...es2019,
...es2020_bigint,
...es2020_date,
...es2020_number,
...es2020_promise,
...es2020_sharedmemory,
...es2020_string,
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2022.object.ts
Expand Up @@ -7,5 +7,5 @@ import { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';

export const es2022_object = {
Object: TYPE,
ObjectConstructor: TYPE,
} as Record<string, ImplicitLibVariableOptions>;
2 changes: 2 additions & 0 deletions packages/scope-manager/src/lib/esnext.bigint.ts
Expand Up @@ -4,9 +4,11 @@
// npx nx generate-lib @typescript-eslint/scope-manager

import { ImplicitLibVariableOptions } from '../variable';
import { es2020_intl } from './es2020.intl';
import { TYPE, TYPE_VALUE } from './base-config';

export const esnext_bigint = {
...es2020_intl,
BigIntToLocaleStringOptions: TYPE,
BigInt: TYPE_VALUE,
BigIntConstructor: TYPE,
Expand Down
4 changes: 4 additions & 0 deletions packages/scope-manager/src/lib/index.ts
Expand Up @@ -46,11 +46,13 @@ import { es2019_object } from './es2019.object';
import { es2019_string } from './es2019.string';
import { es2019_symbol } from './es2019.symbol';
import { es2020_bigint } from './es2020.bigint';
import { es2020_date } from './es2020.date';
import { es2020_promise } from './es2020.promise';
import { es2020_sharedmemory } from './es2020.sharedmemory';
import { es2020_string } from './es2020.string';
import { es2020_symbol_wellknown } from './es2020.symbol.wellknown';
import { es2020_intl } from './es2020.intl';
import { es2020_number } from './es2020.number';
import { es2021_promise } from './es2021.promise';
import { es2021_string } from './es2021.string';
import { es2021_weakref } from './es2021.weakref';
Expand Down Expand Up @@ -121,11 +123,13 @@ const lib = {
'es2019.string': es2019_string,
'es2019.symbol': es2019_symbol,
'es2020.bigint': es2020_bigint,
'es2020.date': es2020_date,
'es2020.promise': es2020_promise,
'es2020.sharedmemory': es2020_sharedmemory,
'es2020.string': es2020_string,
'es2020.symbol.wellknown': es2020_symbol_wellknown,
'es2020.intl': es2020_intl,
'es2020.number': es2020_number,
'es2021.promise': es2021_promise,
'es2021.string': es2021_string,
'es2021.weakref': es2021_weakref,
Expand Down

0 comments on commit 6fe783c

Please sign in to comment.