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.

New quick fix options to disable the rule for the line, file or the project

See original GitHub issue

Example, from vscode-groovy-lint:

Gp2fRQPOKU

Disable for the line

Includes a statement in the previous line, such as # shellcheck disable=SC2035. Reference.

Disable for the entire file

Includes a ShellCheck directive statement before the first command in the file.

Disable for the project

Adds the ShellCheck directive statement to the .shellcheckrc file (and create the file if it does not exist).

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

3reactions
felipecrscommented, Sep 25, 2020

E.g.:

#!/bin/bash

# Copyright Felipe
# Dummy line

# Another comment

# Usage: hello-world

echo "hello-world"

would become:

#!/bin/bash

# Copyright Felipe
# Dummy line

# Another comment

# Usage: hello-world

# shellcheck disable=SC2035

echo "hello-world"

More calls would result in:

#!/bin/bash

# Copyright Felipe
# Dummy line

# Another comment

# Usage: hello-world

# shellcheck disable=SC2035
# shellcheck disable=SC2034

echo "hello-world"

(preferably)

2reactions
felipecrscommented, Sep 25, 2020

That was not what I meant… when koalaman said “command” I believe he meant anything except “comments”. Does not matter which is the number of the line, the first command can be in the final of the file for example.

Regarding:

skip_all_comment_lines at the start of the file();
insert_new_directive()

Yes, it’s the same thing that I’m thinking, I believe, which is:

find_first_command_in_the_file(); // this implies skipping all the comments
insert_new_directive_one_line_above_it() 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Idea: quick fix to disable rule for selected line(s) #245 - GitHub
I make frequent use of comments to disable selected ESLint rules for selected lines, for example: // eslint-disable-next-line max-len {} // long ...
Read more >
Turning off eslint rule for a specific line - Stack Overflow
To disable next line: // eslint-disable-next-line no-use-before-define var thing = new Thing();. Or use the single line syntax: var thing = new Thing(); ......
Read more >
Command Line Interface - 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 >
Disabling and enabling inspections | PyCharm Documentation
In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | Inspections. Locate the inspection you want to disable, and clear the ...
Read more >
Code-style rule options - .NET - Microsoft Learn
You can enable or disable individual rules and configure the ... NET .editorconfig file to your project from the Add New Item dialog...
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