Skip to content
Permalink
Browse files

fix(eslint-plugin): [no-unsafe-call] allow import expressions (#1800)

  • Loading branch information
bradzacher committed Mar 26, 2020
1 parent b1b8284 commit 4fa710754ecc412b65ac3864fe0c7857c254ac1b
@@ -41,10 +41,10 @@ export default util.createRule<[], MessageIds>({
}

return {
'CallExpression, OptionalCallExpression'(
node: TSESTree.CallExpression | TSESTree.OptionalCallExpression,
':matches(CallExpression, OptionalCallExpression) > :not(Import)'(
node: Exclude<TSESTree.LeftHandSideExpression, TSESTree.Import>,
): void {
checkCall(node.callee, node.callee, 'unsafeCall');
checkCall(node, node, 'unsafeCall');
},
NewExpression(node): void {
checkCall(node.callee, node, 'unsafeNew');
@@ -20,6 +20,7 @@ ruleTester.run('no-unsafe-call', rule, {
'function foo(x: { a?: () => void }) { x.a?.() }',
'new Map()',
'String.raw`foo`',
'const x = import("./foo");',
],
invalid: [
...batchedSingleLineTests({

0 comments on commit 4fa7107

Please sign in to comment.
You can’t perform that action at this time.