Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
imjordanxd committed Sep 15, 2024
1 parent 9a689a2 commit 8c3bccb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/lib/rules/no-useless-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ ruleTester.run("no-useless-constructor", rule, {
output: "class A {\nfoo = 5;\n\nbar() {}\n}"
}]
}]
},
{
code: "class A { foo = \"bar\"\nconstructor() { }\n[0]() { } }",
languageOptions: { ecmaVersion: 2022 },
errors: [{
...error,
suggestions: [{
messageId: "removeConstructor",
output: "class A { foo = \"bar\"\n;\n[0]() { } }"
}]
}]
}
]
});

0 comments on commit 8c3bccb

Please sign in to comment.