const notDefined = notDefined; doesn't trigger no-undef
See original GitHub issueEslint 2.11.1 doesn’t show any errors (violations of rule no-undef
) for:
const notDefined = notDefined;
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (11 by maintainers)
Top Results From Across the Web
Incorrectly triggers no-undef and no-redeclare in some cases
I have tried restarting my IDE and the issue persists. I have updated to the latest version of the packages. I have read...
Read more >Error "Failed to Compile" Variable is not defined no-undef
just remove the Product variable from your code and it will work import React, { Component } from "react"; class Counter extends Component ......
Read more >How to Fix ReferenceError: Event is Not Defined in JavaScript
JavaScript's ReferenceError: Event is Not Defined occurs if the event parameter is not declared correctly when using an event handler.
Read more >[Solved]-error 'Stripe' is not defined no-undef-Reactjs
It's only a problem of getting it compiled. The proper way to fix it is to ask compiler to not look for Stripe...
Read more >Airbnb JavaScript Style Guide()
7.3 Never declare a function in a non-function block ( if , while , etc). Assign the function to a variable instead. Browsers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 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.