Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(eslint-plugin): [no-unsafe-call] fix incorrect selector (#1826)
  • Loading branch information
bradzacher committed Mar 31, 2020
1 parent 9b0023a commit 8ec53a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-unsafe-call.ts
Expand Up @@ -41,7 +41,7 @@ export default util.createRule<[], MessageIds>({
}

return {
':matches(CallExpression, OptionalCallExpression) > :not(Import)'(
':matches(CallExpression, OptionalCallExpression) > :not(Import).callee'(
node: Exclude<TSESTree.LeftHandSideExpression, TSESTree.Import>,
): void {
checkCall(node, node, 'unsafeCall');
Expand Down
5 changes: 5 additions & 0 deletions packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts
Expand Up @@ -21,6 +21,11 @@ ruleTester.run('no-unsafe-call', rule, {
'new Map()',
'String.raw`foo`',
'const x = import("./foo");',
// https://github.com/typescript-eslint/typescript-eslint/issues/1825
`
let foo: any = 23;
String(foo); // ERROR: Unsafe call of an any typed value
`,
],
invalid: [
...batchedSingleLineTests({
Expand Down

0 comments on commit 8ec53a3

Please sign in to comment.