align argument for indent VariableDeclarator
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:6
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am interested in this. So much, in fact, I’m about to start working on PR.
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