Skip to content

Commit 077c3d9

Browse files
committed
adress comments
1 parent 3122d6b commit 077c3d9

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lib/rules/no-try-invoke.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ module.exports = {
3434
},
3535

3636
CallExpression(node) {
37-
if (
38-
types.isIdentifier(node.callee) &&
39-
node.callee.name === importedTryInvokeName &&
40-
(node.arguments.length === 3 || node.arguments.length === 2)
41-
) {
37+
if (types.isIdentifier(node.callee) && node.callee.name === importedTryInvokeName) {
4238
context.report({
4339
node,
4440
message: ERROR_MESSAGE,

tests/lib/rules/no-try-invoke.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ruleTester.run('no-try-invoke', rule, {
1818
"tryInvoke(this, 'foo');",
1919
"import { tryInvoke } from '@ember/utils'; foo.tryInvoke(this, 'foo');",
2020
"import { tryInvoke } from '@ember/utils'; tryInvoke.foo(this, 'foo');",
21+
"import { tryInvoke } from '@ember/utils'; foo();",
2122
],
2223
invalid: [
2324
{

0 commit comments

Comments
 (0)