You are correct. With base indentation of 4 spaces, it’s not possible to align 
`const`s. This is due to historical reasons (using multipliers of base in 
configuration), that we wouldn’t be able to change now.

 

Thanks,

 

Ilya Volodin

 

From: [email protected] [mailto:[email protected]] On Behalf Of 
[email protected]
Sent: Saturday, April 29, 2017 3:25 PM
To: ESLint <[email protected]>
Cc: [email protected]
Subject: Re: [ESLint] Align var, let and const

 

Have you even read my entire post?



W dniu sobota, 29 kwietnia 2017 17:18:16 UTC+2 użytkownik Nicholas Zakas 
napisał:

Yes, you need to use the VariableDeclarator option. From the docs:

> Indent of 2 spaces with VariableDeclarator set to {"var": 2, "let": 2, 
> "const": 3} will indent the multi-line variable declarations with 4 spaces 
> for var and let, 6 spaces for const statements.

See http://eslint.org/docs/rules/indent#options for more information on how to 
configure the rule. 

On Sat, Apr 29, 2017 at 3:00 AM <[email protected] <javascript:> > wrote:

Hi guys,

 

can ESLint force alignment of var, let and const blocks? I know it can do var 
and let, but what about the const?

 

var start = 0,

    end = 10;

 

let start = 0,

    end = 10;

 

const start = 0,

      end = 10;

 

I'm using indent rule, but it can only take a multiplication of basic 
indentation as a parameter and that must be an integer. My base is 4, so it 
doesn't seem possible to align const block like that. It is possible for var 
and let, but only because they indeed take 4 characters to align.

 

Am I missing some feature?

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected] <javascript:> .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected] 
<mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to