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
69 changes: 69 additions & 0 deletions packages/eslint-plugin/tests/rules/no-empty-function.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ class Person {
},
line: 3,
messageId: 'unexpected',
suggestions: [
{
messageId: 'suggestComment',
output: `
class Person {
constructor(name: string) { /* empty */ }
}
`,
},
],
},
],
},
Expand All @@ -113,6 +123,16 @@ class Person {
},
line: 3,
messageId: 'unexpected',
suggestions: [
{
messageId: 'suggestComment',
output: `
class Person {
otherMethod(name: string) { /* empty */ }
}
`,
},
],
},
],
},
Expand All @@ -130,6 +150,16 @@ class Foo {
},
line: 3,
messageId: 'unexpected',
suggestions: [
{
messageId: 'suggestComment',
output: `
class Foo {
private constructor() { /* empty */ }
}
`,
},
],
},
],
},
Expand All @@ -147,6 +177,16 @@ class Foo {
},
line: 3,
messageId: 'unexpected',
suggestions: [
{
messageId: 'suggestComment',
output: `
class Foo {
protected constructor() { /* empty */ }
}
`,
},
],
},
],
},
Expand All @@ -162,6 +202,14 @@ function foo() {}
},
line: 2,
messageId: 'unexpected',
suggestions: [
{
messageId: 'suggestComment',
output: `
function foo() { /* empty */ }
`,
},
],
},
],
},
Expand All @@ -180,6 +228,17 @@ class Foo {
},
line: 4,
messageId: 'unexpected',
suggestions: [
{
messageId: 'suggestComment',
output: `
class Foo {
@decorator()
foo() { /* empty */ }
}
`,
},
],
},
],
},
Expand All @@ -197,6 +256,16 @@ class Foo extends Base {
},
line: 3,
messageId: 'unexpected',
suggestions: [
{
messageId: 'suggestComment',
output: `
class Foo extends Base {
override foo() { /* empty */ }
}
`,
},
],
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/typings/eslint-rules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ declare module 'eslint/lib/rules/no-empty-function' {
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';

const rule: TSESLint.RuleModule<
'unexpected',
'suggestComment' | 'unexpected',
[
{
allow?: string[];
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3679,7 +3679,7 @@ __metadata:
languageName: node
linkType: hard

"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.5.1, @eslint-community/eslint-utils@npm:^4.7.0":
"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.5.1, @eslint-community/eslint-utils@npm:^4.7.0, @eslint-community/eslint-utils@npm:^4.8.0":
version: 4.9.0
resolution: "@eslint-community/eslint-utils@npm:4.9.0"
dependencies:
Expand Down Expand Up @@ -3762,10 +3762,10 @@ __metadata:
languageName: node
linkType: hard

"@eslint/js@npm:*, @eslint/js@npm:9.34.0, @eslint/js@npm:^9.26.0":
version: 9.34.0
resolution: "@eslint/js@npm:9.34.0"
checksum: 933d4ba321b1abc83eecde40eb703871ce00f133eedec54cf928b7fedb61706174dd526997c3f151776922412e3d95cb3634f97ef7b5861b4908f9992f403a63
"@eslint/js@npm:*, @eslint/js@npm:9.35.0, @eslint/js@npm:^9.26.0":
version: 9.35.0
resolution: "@eslint/js@npm:9.35.0"
checksum: ea644f0b1abb4da49ba0cb61db4d039492e844d959e7127dd7c501aa27a256348496bce43334ecd3ca990c9a49fb3ea93d6729de0a79d216f63869236c153148
languageName: node
linkType: hard

Expand Down Expand Up @@ -9972,16 +9972,16 @@ __metadata:
linkType: hard

"eslint@npm:*, eslint@npm:^9.15.0, eslint@npm:^9.26.0":
version: 9.34.0
resolution: "eslint@npm:9.34.0"
version: 9.35.0
resolution: "eslint@npm:9.35.0"
dependencies:
"@eslint-community/eslint-utils": ^4.2.0
"@eslint-community/eslint-utils": ^4.8.0
"@eslint-community/regexpp": ^4.12.1
"@eslint/config-array": ^0.21.0
"@eslint/config-helpers": ^0.3.1
"@eslint/core": ^0.15.2
"@eslint/eslintrc": ^3.3.1
"@eslint/js": 9.34.0
"@eslint/js": 9.35.0
"@eslint/plugin-kit": ^0.3.5
"@humanfs/node": ^0.16.6
"@humanwhocodes/module-importer": ^1.0.1
Expand Down Expand Up @@ -10017,7 +10017,7 @@ __metadata:
optional: true
bin:
eslint: bin/eslint.js
checksum: 6de97f6197774821a086783e1bd73b9518c4eb8896165e448a8bb2359142c63cad40faa5dc79bcdc28fab20b57e1376ccbb76a6ae081da5e94baa18d2d3b92fe
checksum: 45b12539f84d7ae474920f279b4a0f1e1074eaff152f6d2b6a5fb112174914853f18071876da6421c11d678319fd78745ea03ed56b6808d77f76397e488cde28
languageName: node
linkType: hard

Expand Down
Loading