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

comma-dangle problem using es6 imports with new line #4704

Closed
bryce-larson opened this Issue Dec 15, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@bryce-larson
Copy link

commented Dec 15, 2015

We are having issues with comma-dangle when are using really long es6 import statements that we wrap with new lines.

eslint: v1.10.3
rule: "comma-dangle": [2, "always-multiline"],
error: Missing trailing comma

// error, Missing trailing comma error
import {ReallyLongImportName} from 
  'path/to/really/long/export/file/location/requires/line/wrap'

// works, but line too long
import {ReallyLongImportName} from '../../../path/to/really/long/export/file/location/requires/line/wrap';

// works, but requires comma dangle
import {ReallyLongImportName, } from 
   'path/to/really/long/export/file/location/requires/line/wrap';

We would like the first example not to error, since the following works with the same rule:

   const {foo} = 
      bar;
@eslintbot

This comment has been minimized.

Copy link

commented Dec 15, 2015

@bryce-larson Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@eslintbot eslintbot added the triage label Dec 15, 2015

@nzakas

This comment has been minimized.

Copy link
Member

commented Dec 15, 2015

Can you please provide the requested information?

@nzakas nzakas added bug rule accepted and removed triage labels Dec 15, 2015

@nzakas

This comment has been minimized.

Copy link
Member

commented Dec 15, 2015

Confirmed with default parser.

@bryce-larson a quick question: did you see the comment from eslintbot?

@bryce-larson

This comment has been minimized.

Copy link
Author

commented Dec 15, 2015

@nzakas, missed that I am using:
"parser": "babel-eslint"

I guess I read the "What you did (the source code and ESLint configuration)", as just the rules I was using and not the parser.

@nzakas nzakas closed this in 2fac51b Dec 21, 2015

nzakas added a commit that referenced this issue Dec 21, 2015

Merge pull request #4718 from eslint/issue4704
Fix: always-multiline for comma-dangle import (fixes #4704)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.