You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/tmp/consistent-function-scoping-issue/issue2.js
7:3 error Move function to the outer scope unicorn/consistent-function-scoping
✖ 1 problem (1 error, 0 warnings)
I believe this is incorrect since onError2 can not be moved to the global scope, since it calls onError, which is only defined in the function scope.
My apologies for the late follow-up, but I don't believe this issue is completely fixed.
With ESLint 6.8.0, eslint-plugin-unicorn 15.0.1, and "extends": "plugin:unicorn/recommended" I still observe the same error with the original example code. #378 appears to have fixed the issue if module.exports = is not present, but when it is present (as in the original example) the issue still occurs.
Running ESLint 6.4.0 with eslint-plugin-unicorn 11.0.0 and "extends": "plugin:unicorn/recommended" on a file with the following reduced example code:
gives the following output:
I believe this is incorrect since
onError2
can not be moved to the global scope, since it callsonError
, which is only defined in the function scope.Thanks,
Kevin
Note: Split from #374 per #374 (comment)
The text was updated successfully, but these errors were encountered: