Skip to content

Commit 60d3ed7

Browse files
committed
fix: default to leftToBeResolved, fixes eslint-community#205
1 parent f10d8fc commit 60d3ed7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rules/no-native.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@ module.exports = {
4545
return {
4646
'Program:exit'() {
4747
const scope = context.getScope()
48+
const leftToBeResolved =
49+
scope.implicit.left ||
50+
/* istanbul ignore next
51+
* Fixes https://github.com/xjamundx/eslint-plugin-promise/issues/205.
52+
* The problem was that @typescript-eslint has a scope manager
53+
* which has `leftToBeResolved` instead of the default `left`.
54+
*/
55+
scope.implicit.leftToBeResolved
4856

49-
scope.implicit.left.forEach((ref) => {
57+
leftToBeResolved.forEach((ref) => {
5058
if (ref.identifier.name !== 'Promise') {
5159
return
5260
}

0 commit comments

Comments
 (0)