Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat: support TS 5.3#7968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
feat: support TS 5.3#7968
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -7,7 +7,7 @@ import packageJson from '../../package.json'; | ||
## ESLint | ||
> The version range of ESLint currently supported is `^7.0.0 || ^8.0.0`. | ||
bradzacher marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
We generally support at least the latest two major versions of ESLint. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -191,6 +191,7 @@ export function isComment(node: ts.Node): boolean { | ||
* @returns is JSDoc comment | ||
*/ | ||
function isJSDocComment(node: ts.Node): node is ts.JSDoc { | ||
// eslint-disable-next-line deprecation/deprecation -- SyntaxKind.JSDoc was only added in TS4.7 so we can't use it yet | ||
bradzacher marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
return node.kind === SyntaxKind.JSDocComment; | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4,9 +4,9 @@ import type * as ts from 'typescript'; | ||
// Eg: https://github.com/typescript-eslint/typescript-eslint/issues/2388, https://github.com/typescript-eslint/typescript-eslint/issues/2784 | ||
/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/no-empty-interface */ | ||
declare module 'typescript' { | ||
/** @ts-ignore - added in TS 4.5, deprecated and converted to a type-alias in TS 5.3 */ | ||
export interface AssertClause extends ts.Node {} | ||
/** @ts-ignore - added in TS 4.5, deprecated and converted to a type-alias in TS 5.3 */ | ||
export interface AssertEntry extends ts.Node {} | ||
Comment on lines +7 to 10 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is a problem for us. We don't get this error locally because we use Note that this blocks the full support. | ||
// added in TS 4.9 | ||
export interface SatisfiesExpression extends ts.Node {} | ||
@@ -25,6 +25,10 @@ export type TSNode = | ||
| ts.Identifier | ||
| ts.ImportAttribute | ||
| ts.ImportAttributes | ||
/* eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-duplicate-type-constituents -- intentional for old TS versions */ | ||
| ts.AssertClause | ||
/* eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-duplicate-type-constituents -- intentional for old TS versions */ | ||
| ts.AssertEntry | ||
| ts.PrivateIdentifier | ||
| ts.QualifiedName | ||
| ts.ComputedPropertyName | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,4 +10,48 @@ declare module 'typescript' { | ||
interface JSDocContainer { | ||
jsDoc?: JSDoc[]; | ||
} | ||
// add back the deprecated properties that were removed in newer TS versions | ||
// make sure these properties are marked as @ deprecated so they're flagged | ||
// by the `deprecation/deprecation` lint rule | ||
interface PropertySignature { | ||
/** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */ | ||
readonly initializer?: Expression | undefined; | ||
} | ||
interface PropertyAssignment { | ||
/** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */ | ||
readonly questionToken?: QuestionToken | undefined; | ||
/** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */ | ||
readonly exclamationToken?: ExclamationToken | undefined; | ||
} | ||
interface ShorthandPropertyAssignment { | ||
/** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */ | ||
readonly modifiers?: NodeArray<Modifier> | undefined; | ||
/** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */ | ||
readonly questionToken?: QuestionToken | undefined; | ||
/** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */ | ||
readonly exclamationToken?: ExclamationToken | undefined; | ||
} | ||
interface FunctionTypeNode { | ||
/** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */ | ||
readonly modifiers?: NodeArray<Modifier> | undefined; | ||
} | ||
/** | ||
* @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `src/getModifiers.ts`. | ||
*/ | ||
function getDecorators(node: HasDecorators): readonly Decorator[] | undefined; | ||
/** | ||
* @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `src/getModifiers.ts`. | ||
*/ | ||
function getModifiers(node: HasModifiers): readonly Modifier[] | undefined; | ||
/** | ||
* @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `src/getModifiers.ts`. | ||
*/ | ||
function canHaveModifiers(node: Node): node is HasModifiers; | ||
/** | ||
* @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `src/getModifiers.ts`. | ||
*/ | ||
function canHaveDecorators(node: Node): node is HasDecorators; | ||
bradzacher marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
} |
Uh oh!
There was an error while loading.Please reload this page.