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.

`indent` should check tabs in front of block comments

See original GitHub issue

What rule do you want to change? indent Does this change cause the rule to produce more or fewer warnings? More warnings How will the change be implemented? (New option, new default behavior, etc.)? This could be a new option or modify default behavior. The former would be a non-breaking change and likely preferred. Please provide some example code that this change will affect:

export class Human {
	constructor(name) {
		this.name = name;
	}

	/**
	 * Set the `name` of the class
	 * @param {string} value - value to be set
	 */
	set name(value) {
		this._name = value;
	}

    /**
     * Get the `name` of the class
     * @returns {string}
     */
    get name() {
        return this._name;
    }
}

What does the rule currently do for this code? demo link. Notice how on lines 7-9 are prepended with tabs, but an error is not thrown. The inverse is true when ["error", "tab"] is used. What will the rule do after it’s changed? The rule should check blocked comments and ensure they follow the indent rule properly. Are you willing to submit a pull request to implement this change? No.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Apr 1, 2019

Hi @ibbignerd, just wanted to leave a note about the demo…

You can pass options in the demo by having your source code use an inline configuration comment. Here’s an example.

Hope this helps! (Sorry, I can’t help with the actual issue at the moment.)

0reactions
ibbignerdcommented, Jul 10, 2019

@not-an-aardvark Did you see my demo that highlights the issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to indent/format a selection of code in Visual Studio Code?
I want to indent a specific section of code in Visual Studio Code: Select the lines you want to indent, and; use Ctrl...
Read more >
How do you indent? - Codecademy
If you use “TAB” at the start of the line of code you want to write, you will see that you indent. The...
Read more >
HTML Indentation and Spacing - LearnHowToProgram.com
The first debate is on whether we should use spaces or tabs to indent our code. The second is on whether our indents...
Read more >
Indenting within block comments in C-mode Emacs
The usual way to check if you are in a comment is to use syntax-ppss . A simple way to do what you...
Read more >
The Objectively Best Way to Indent your Code
Okay, hear me out: You can use tabs and spaces for different kinds of indentation. For instance you could use tabs to indent...
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