indent rule should be more lax on line comments on consecutive lines
See original GitHub issueTell us about your environment
- ESLint Version: 4.1.0
- Node Version: 7.9.0
- npm Version: 4.2.0
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
"indent": [ 2, "tab", {
"MemberExpression": "off"
}],
Full configuration here: https://github.com/Canop/miaou/blob/master/gulpfile.js#L80
What did you do? Please include the actual source code causing the issue.
var now = (Date.now()/1000|0);
m.room = shoe.room.id; // to trigger a security exception if user tried
// to mod_delete a message of another room
m.content = "!!deleted by:" + shoe.publicUser.id + ' on:'+ now + ' ' + m.content;
return this.storeMessage(m, true)
code around: https://github.com/Canop/miaou/blob/44970cf80b4f26a127744af64432aca9f536f0ca/libs/ws.js#L783
What did you expect to happen?
I expected eslint to either
- accept this comments formatting without triggering an error (as in previous eslint versions)
- let me disable indent checks on comments
- let me configure the indent rule to accept (not exclusively) this kind of comment formatting (self aligned on the first possible tab indent (which depends on the number of spaces per tab))
What actually happened? Please include the actual, raw output from ESLint.
I didn’t find any way to keep this comment as is without disabling the whole indent rule.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (5 by maintainers)
Top Results From Across the Web
comment indentation can break code indentation
I feel that single line comments that are ALONE on their line should be indented to match the start of the previous line....
Read more >SQL Statement indentation good practice - Stack Overflow
If there many more columns on the select clause, I would indent the second and subsequent lines... I generally do NOT adhere to...
Read more >Write better Markdown - BrettTerpstra.com
Blank lines between list items can be interpreted very differently between processors. Keep list items consecutive, but you can use blank lines ...
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 >R Packages (2e) - 10 DESCRIPTION
If your description spans multiple lines (and it should!), each line must be no more than 80 characters wide. Indent subsequent lines with...
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
Edited the title to make it a little more clear (I interpreted “multi-line comments” as “block comments” on initial read).
Currently, comments are allowed to be indented in one of three ways:
The comment in your example is none of those.
It might be worth enhancing the rule (either by default, or via new option) to allow a line comment’s indentation to be the same location as the beginning of the previous line’s line comment (where there is one).
@not-an-aardvark Thoughts?
I want ESLIST to completely ignore comments. it’s pissing me off that I don’t have full control and then my stack shows a TON of warnings for my code comments in million files. so annoying.