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

sort-imports examples don't pass with default config #8734

Closed
epmatsw opened this issue Jun 14, 2017 · 2 comments
Closed

sort-imports examples don't pass with default config #8734

epmatsw opened this issue Jun 14, 2017 · 2 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 documentation Relates to ESLint's documentation good first issue Good for people who haven't worked on ESLint before rule Relates to ESLint's core rules

Comments

@epmatsw
Copy link

epmatsw commented Jun 14, 2017

Tell us about your environment

http://eslint.org/demo/ with ecmaVersion6 and sourceType module.

  • ESLint Version:
  • Node Version:
  • npm Version:

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

Please show your full configuration:

The default configuration on http://eslint.org/demo/, but with ecmaVersion 6, sourceType of module, turned off no-unused-var, turned on sort-imports.

What did you do? Please include the actual source code causing the issue.

import 'module-without-export.js';
import * as foo from 'foo.js';
import * as bar from 'bar.js';
import {alpha, beta} from 'alpha.js';
import {delta, gamma} from 'delta.js';
import a from 'baz.js';
import b from 'qux.js';
import 'foo.js'
import * from 'bar.js';
import {a, b} from 'baz.js';
import c from 'qux.js';

What did you expect to happen?
Those are the two examples of "correct" default code from http://eslint.org/docs/rules/sort-imports#default-settings. I expected them to both pass without issue in the default sort-imports behavior.

What actually happened? Please include the actual, raw output from ESLint.

For the first one, it gives 3:1 - Imports should be sorted alphabetically. (sort-imports) (this matches the issue I was investigating when I found this, unexpected complaints about sort order). For the second one, it gives 2:10 - Parsing error: Unexpected token from (), which is pretty strange.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jun 14, 2017
@epmatsw
Copy link
Author

epmatsw commented Jun 14, 2017

Having now looked at it, it's cause foo is alphabetically after bar and because the import * from needs to be an import * as <something> from

@kaicataldo kaicataldo added bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jun 14, 2017
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion good first issue Good for people who haven't worked on ESLint before documentation Relates to ESLint's documentation and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Aug 14, 2017
@i-ron-y
Copy link
Contributor

i-ron-y commented Sep 6, 2017

Fixed the doc, made a PR.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 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 Mar 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 documentation Relates to ESLint's documentation good first issue Good for people who haven't worked on ESLint before rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

5 participants