(val: K): K;
+declare function a(val: number): number;
+declare function a(val: boolean): boolean;
+
+a('B');
+ `.trim(),
+ errors: [
+ {
+ messageId: 'deprecatedSignature',
+ line: 6,
+ data: {
+ signature: `<"B">(val: "B"): "B"`,
+ name: 'a',
+ },
+ },
+ ],
+ },
+ {
+ code: `
+class A {
+ /** @deprecated */
+ constructor(value: string) {}
+}
+
+new A('VALUE');
+ `,
+ errors: [
+ {
+ messageId: 'deprecatedSignature',
+ },
+ ],
+ },
+ {
+ code: `
+declare interface A {
+ /** @deprecated */
+ new (value: string): A;
+}
+declare const A: A;
+
+new A('VALUE');
+ `,
+ errors: [
+ {
+ messageId: 'deprecatedSignature',
+ },
+ ],
+ },
+ ],
+});
diff --git a/packages/typescript-eslint/src/configs/all.ts b/packages/typescript-eslint/src/configs/all.ts
index f01ac17c8ddb..19dad3f81543 100644
--- a/packages/typescript-eslint/src/configs/all.ts
+++ b/packages/typescript-eslint/src/configs/all.ts
@@ -38,6 +38,7 @@ export default (
'@typescript-eslint/consistent-type-imports': 'error',
'default-param-last': 'off',
'@typescript-eslint/default-param-last': 'error',
+ '@typescript-eslint/deprecation': 'error',
'dot-notation': 'off',
'@typescript-eslint/dot-notation': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
diff --git a/packages/typescript-eslint/src/configs/disable-type-checked.ts b/packages/typescript-eslint/src/configs/disable-type-checked.ts
index 9df504415e37..43f946a69afc 100644
--- a/packages/typescript-eslint/src/configs/disable-type-checked.ts
+++ b/packages/typescript-eslint/src/configs/disable-type-checked.ts
@@ -16,6 +16,7 @@ export default (
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/consistent-return': 'off',
'@typescript-eslint/consistent-type-exports': 'off',
+ '@typescript-eslint/deprecation': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-array-delete': 'off',
diff --git a/packages/typescript-eslint/src/configs/strict-type-checked-only.ts b/packages/typescript-eslint/src/configs/strict-type-checked-only.ts
index 415dd3eb342b..1bd10ccfa719 100644
--- a/packages/typescript-eslint/src/configs/strict-type-checked-only.ts
+++ b/packages/typescript-eslint/src/configs/strict-type-checked-only.ts
@@ -20,6 +20,7 @@ export default (
name: 'typescript-eslint/strict-type-checked-only',
rules: {
'@typescript-eslint/await-thenable': 'error',
+ '@typescript-eslint/deprecation': 'error',
'@typescript-eslint/no-array-delete': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
diff --git a/packages/typescript-eslint/src/configs/strict-type-checked.ts b/packages/typescript-eslint/src/configs/strict-type-checked.ts
index 61d0a4d579a2..acee87d8c307 100644
--- a/packages/typescript-eslint/src/configs/strict-type-checked.ts
+++ b/packages/typescript-eslint/src/configs/strict-type-checked.ts
@@ -25,6 +25,7 @@ export default (
{ minimumDescriptionLength: 10 },
],
'@typescript-eslint/ban-types': 'error',
+ '@typescript-eslint/deprecation': 'error',
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-array-delete': 'error',
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy