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

vars-on-top conflicts with ES6 import #2099

Closed
srigi opened this issue Mar 18, 2015 · 3 comments
Closed

vars-on-top conflicts with ES6 import #2099

srigi opened this issue Mar 18, 2015 · 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

@srigi
Copy link

srigi commented Mar 18, 2015

When vars-on-top is enabled, it warns (IMO incorrectly) on this ES6 code

import React from 'react';

var foo = 'bar';

It wants var declaration to be before import call. That is unnecessary.

I'm using babel-eslint parser and browser env.

@nzakas nzakas 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 labels Mar 18, 2015
@nzakas
Copy link
Member

nzakas commented Mar 18, 2015

Yeah, I think the rule just doesn't understand import. Should be an easy fix.

@gyandeeps
Copy link
Member

Working on this.
@nzakas What should be allowed for this rule to not fail?
import for sure, anyothers

@nzakas
Copy link
Member

nzakas commented Mar 18, 2015

I think starting with import is good. Maybe there will be more, but I'm not sure at this point.

@nzakas nzakas closed this as completed in 9e226ad Mar 18, 2015
nzakas added a commit that referenced this issue Mar 18, 2015
Fix: vars-on-top conflict with ES6 import (fixes #2099)
@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
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

3 participants