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

no-implicit-conversion should not warn on "" + "foo" #7057

Closed
TheSavior opened this issue Sep 5, 2016 · 3 comments
Closed

no-implicit-conversion should not warn on "" + "foo" #7057

TheSavior opened this issue Sep 5, 2016 · 3 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion 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

@TheSavior
Copy link
Contributor

What version of ESLint are you using?
3.4.0

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:
Running the test suite

What did you do? Please include the actual source code causing the issue.
I added a test that the following should be valid:

{code: "1 * 1"},
{code: "'' + 'foo'"},

and ran

./node_modules/.bin/mocha /Users/eli/projects/eslint/tests/lib/rules/no-implicit-coercion.js

What did you expect to happen?
I expected these to be valid

What actually happened? Please include the actual, raw output from ESLint.
eslint was fine with 1 * 1 but not with "" + "foo".

While both of these aren't very good patterns for people to be following, there is nothing happening with type conversion here and thus no-implicit-conversion should not care about these cases.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Sep 5, 2016
@platinumazure
Copy link
Member

Just to be clear, the issue here is that there is no conversion because the other operand is definitely the same type?

@kaicataldo kaicataldo added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Sep 5, 2016
@kaicataldo
Copy link
Member

kaicataldo commented Sep 5, 2016

Seems like a bug to me, given that no coercion is happening. Confirmed locally.

@TheSavior
Copy link
Contributor Author

@platinumazure yep, exactly.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion 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

No branches or pull requests

4 participants