eslint: const notDefined = notDefined; doesn't trigger no-undef
Eslint 2.11.1 doesn’t show any errors (violations of rule no-undef
) for:
const notDefined = notDefined;
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (11 by maintainers)
👍 Let’s move it to
no-undef
.I’m not sure I agree with this suggestion.
no-undef
doesn’t currently know anything about TDZ, it only warns when a variable hasn’t been defined at all.no-use-before-define
is explicitly for this case. Plus, I think we cause more confusion by moving a check from one rule to another vs. just keeping it as-is.@mhagmajer None of our rules are turned on by default. But
no-use-before-define
sounds like the right rule to put this in.Either way, I believe that
no-undef
is the right rule to handle this to prevent runtime errors.On Fri, Jun 10, 2016, 22:11 Marcin Hagmajer mhagmajer@gmail.com wrote: