Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default createRule({

case AST_NODE_TYPES.ArrowFunctionExpression:
case AST_NODE_TYPES.BlockStatement:
case AST_NODE_TYPES.ClassBody:
case AST_NODE_TYPES.ClassDeclaration:
case AST_NODE_TYPES.TSInterfaceDeclaration:
case AST_NODE_TYPES.FunctionDeclaration:
case AST_NODE_TYPES.FunctionExpression:
Expand Down
93 changes: 93 additions & 0 deletions packages/eslint-plugin/tests/rules/no-deprecated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2354,5 +2354,98 @@ ruleTester.run('no-deprecated', rule, {
},
},
},
{
code: `
/** @deprecated */
interface Foo {}

class Bar implements Foo {}
`,
errors: [
{
column: 30,
data: { name: 'Foo' },
endColumn: 33,
endLine: 5,
line: 5,
messageId: 'deprecated',
},
],
},
{
code: `
/** @deprecated */
interface Foo {}

export class Bar implements Foo {}
`,
errors: [
{
column: 37,
data: { name: 'Foo' },
endColumn: 40,
endLine: 5,
line: 5,
messageId: 'deprecated',
},
],
},
{
code: `
/** @deprecated */
interface Foo {}

interface Baz {}

export class Bar implements Baz, Foo {}
`,
errors: [
{
column: 42,
data: { name: 'Foo' },
endColumn: 45,
endLine: 7,
line: 7,
messageId: 'deprecated',
},
],
},
{
code: `
/** @deprecated */
class Foo {}

export class Bar extends Foo {}
`,
errors: [
{
column: 34,
data: { name: 'Foo' },
endColumn: 37,
endLine: 5,
line: 5,
messageId: 'deprecated',
},
],
},
{
code: `
/** @deprecated */
declare function decorator(constructor: Function);

@decorator
export class Foo {}
`,
errors: [
{
column: 10,
data: { name: 'decorator' },
endColumn: 19,
endLine: 5,
line: 5,
messageId: 'deprecated',
},
],
},
],
});
Loading