This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
🐛 noInnerDeclarations
incorrectly reports on functions in esm/strict mode
#4492
Labels
Environment information
What happened?
In the playground example:
myFn
accessesval
in the block scope, so moving it outside the block would breakmyFn
.myFn
is scoped to the block in esm/strict mode, so there's nothing wrong with keeping it in the block.Calling
myFn()
from outside the block would throw an error. Typescript correctly reports it (Cannot find name 'myFn'.
)Expected result
From the ESLint docs for no-inner-declarations:
The rule should only catch functions in blocks when the file is not an ESM or when the block is not in strict mode.
Code of Conduct
The text was updated successfully, but these errors were encountered: