Extend no-multi-spaces with allow alignment option
See original GitHub issueIs it possible to have a rule to allow alignment of =
(which introduces multi spaces) without having to turn off no-multi-spaces
?
The following would be considered a warning:
var a = 1;
var a = 1;
var bar = 1;
The following would not:
var a = 1;
var bar = 1;
Currently no-multi-space
complains about what ESLint calls good coding conventions:
// Good
var count = 10,
name = "Nicholas",
found = false,
empty;
I agree that this is good, but turning off no-multi-spaces
completely is a blunt instrument that would hide warnings you want.
Issue Analytics
- State:
- Created 9 years ago
- Comments:23 (10 by maintainers)
Top Results From Across the Web
no-multi-spaces - ESLint - Pluggable JavaScript Linter
Options. This rule's configuration consists of an object with the following properties: "ignoreEOLComments": true (defaults to false ) ignores multiple ...
Read more >eslintrc.json no-multi-spaces value assignment equal sign ...
You want to use the VariableDeclarator option, as explained in the documentation: https://eslint.org/docs/rules/indent#variabledeclarator.
Read more >Adjust indents and spacing
Choose Justify to align text both left and right, adding space between words (Ctrl+J). Outline level. The level at which the paragraph appears...
Read more >Align and distribute layers in Adobe Photoshop
Choose Edit > Auto-Align Layers, and choose an alignment option. For stitching together multiple images that share overlapping areas—for example ...
Read more >CSS Box Alignment - CSS: Cascading Style Sheets | MDN
There needs to be space available in the dimension you wish to align the items in, in order for these keywords to take...
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
What about for aligning literals in function calls?
I think there has to be a smarter option than just ignoring a whole class of node for this type of alignment. Shouldn’t it be possible to compare the
start
prop of the AST?Try astexplorer.net to inspect the syntax tree from a number of popular parsers. @alexilyaev in your case with babel-eslint, it looks like you want
ClassProperty
.