question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

align argument for indent VariableDeclarator

See original GitHub issue

I’d like to allow eslint to accept code that looks like this:

const foo = 'bar',
      baz = 'foo';

if (foo === 'bar') {
    console.log(baz);
}

I created a pull request for a change to the VariableDeclarator rule adding decimals (#8975), but it was pointed out that a different argument altogether (ie “first”) would be a better way of solving the problem.

What it would do would be to allow variable declaractions to be aligned as above regardless of the indentation level

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
snooopcattcommented, Nov 23, 2018

I am interested in this. So much, in fact, I’m about to start working on PR.

0reactions
aladdin-addcommented, Nov 23, 2018

we might have to close the issue in the near future if no one has interests – it has been open for a long time. /cc @eslint/eslint-team

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to align const indent in ESLint? - javascript - Stack Overflow
According https://eslint.org/docs/rules/indent you can use: indent: ["error", 2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }.
Read more >
indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
ESLint - indent - The --fix option on the command line can ...
"ImportDeclaration" (default: 1) enforces indentation level for import statements. It can be set to the string "first" , indicating that all imported members ......
Read more >
On pretty printers | William Durand
The idea is to print all the arguments of the function on the same line if the ... align all the arguments with...
Read more >
Indent with tabs, align with spaces - Dmitry Frank
Conclusion · Use tabs for indentation, spaces for alignment: the superior approach. Code is indented and aligned properly, and indentation is flexible. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found