question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

const notDefined = notDefined; doesn't trigger no-undef

See original GitHub issue

Eslint 2.11.1 doesn’t show any errors (violations of rule no-undef) for:

const notDefined = notDefined;

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
michaelficarracommented, Aug 5, 2016

👍 Let’s move it to no-undef.

1reaction
nzakascommented, Aug 10, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found