Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eqeqeq: an error should point to the equation symbol #1029

Closed
mgol opened this issue Jun 30, 2014 · 2 comments · Fixed by #1031
Closed

eqeqeq: an error should point to the equation symbol #1029

mgol opened this issue Jun 30, 2014 · 2 comments · Fixed by #1031
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@mgol
Copy link
Contributor

mgol commented Jun 30, 2014

The file a.js:

/* global o */
if (o.a == o.b) {
   o.c = o.d;
}

gives the following result:

a.js
  2:4  error  Expected '===' and instead saw '=='  eqeqeq

✖ 1 problem

i.e. it points to the beginning of the whole expression containing the incorrect equality mark. It makes it more difficult to see what's wrong (imagine having something really long instead of o.a), it doesn't cooperate with IDE plugins that will mark a perfectly valid o token as wrong and it doesn't match jsHint which points to the end of the equation mark.

@nzakas
Copy link
Member

nzakas commented Jun 30, 2014

Yup, that's a bug. Thanks.

@jonvuri
Copy link
Contributor

jonvuri commented Jun 30, 2014

I can pick this up.

jonvuri added a commit to jonvuri/eslint that referenced this issue Jun 30, 2014
jonvuri added a commit to jonvuri/eslint that referenced this issue Jun 30, 2014
jonvuri added a commit to jonvuri/eslint that referenced this issue Jul 4, 2014
nzakas added a commit that referenced this issue Jul 4, 2014
Fix: Point eqeqeq error at operator (Fixes #1029)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants