Skip to content

Commit

Permalink
fix: default to leftToBeResolved, fixes #205
Browse files Browse the repository at this point in the history
  • Loading branch information
aaditmshah committed Aug 24, 2022
1 parent f10d8fc commit 60d3ed7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rules/no-native.js
Expand Up @@ -45,8 +45,16 @@ module.exports = {
return {
'Program:exit'() {
const scope = context.getScope()
const leftToBeResolved =
scope.implicit.left ||
/* istanbul ignore next
* Fixes https://github.com/xjamundx/eslint-plugin-promise/issues/205.
* The problem was that @typescript-eslint has a scope manager
* which has `leftToBeResolved` instead of the default `left`.
*/
scope.implicit.leftToBeResolved

scope.implicit.left.forEach((ref) => {
leftToBeResolved.forEach((ref) => {
if (ref.identifier.name !== 'Promise') {
return
}
Expand Down

0 comments on commit 60d3ed7

Please sign in to comment.