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

An indentation problem with const and chaining #539

Closed
mbork opened this issue Nov 15, 2019 · 2 comments
Closed

An indentation problem with const and chaining #539

mbork opened this issue Nov 15, 2019 · 2 comments

Comments

@mbork
Copy link

mbork commented Nov 15, 2019

When declaring a const variable which is assigned a value of a long, chained expression, the default indentation is wrong (compared to a let declaration):

let a = /regex/
    .test('regex hello');

const a = /regex/
      .test('regex hello');

I would expect (and prefer) this:

let a = /regex/
    .test('regex hello');

const a = /regex/
    .test('regex hello');

(Eslint agrees.)

I tried various values of js2-pretty-multiline-declarations, but to no avail, apparently that setting is related to a different situation.

@dgutov
Copy link
Collaborator

dgutov commented Nov 15, 2019

First of all, see https://github.com/mooz/js2-mode#bugs about indentation problems.

In the Emacs bug report you are going to file, please add some extra info as for why it should be indented this way. Is this an ESLint default? Does it have a relevant configuration option?

@mbork
Copy link
Author

mbork commented Nov 15, 2019

Hi Dmitry,
and thanks for the fast response!
I will do as you told me (sorry, I missed that information) soon. Hence, I'm closing this issue.

@mbork mbork closed this as completed Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants