linter icon indicating copy to clipboard operation
linter copied to clipboard

How can I disable lint checks for a code block?

Open huangjs opened this issue 9 years ago • 7 comments

huangjs avatar Mar 19 '15 10:03 huangjs

Currently you cannot, but you can ignore specific lines with //linter:disable[:OptionalCheckNames...]

What kind of syntax would you recommend?

HairyFotr avatar Mar 19 '15 10:03 HairyFotr

I would recommend scalastyle-like switcher.

// linter:off ... // linter:on

Jianshi

On Thu, Mar 19, 2015 at 6:33 PM, Matic Potočnik [email protected] wrote:

Currently you cannot, but you can ignore specific lines with //linter:disable[:OptionalCheckNames...]

What kind of syntax would you recommend?

— Reply to this email directly or view it on GitHub https://github.com/HairyFotr/linter/issues/19#issuecomment-83496530.

Jianshi Huang

LinkedIn: jianshi Twitter: @jshuang Github & Blog: http://huangjs.github.com/

huangjs avatar Mar 19 '15 13:03 huangjs

Yeah, that sounds good, I'll try to implement something over the weekend.

I'll likely also replace "disable" in favour of "ignore" to make it even more similar to scalastyle, and because having "disable" and "off"/"on" together would be confusing.

HairyFotr avatar Mar 19 '15 16:03 HairyFotr

Thanks!

Jianshi

On Fri, Mar 20, 2015 at 12:51 AM, Matic Potočnik [email protected] wrote:

Yeah, that sounds good, I'll try to implement something over the weekend.

I'll likely also replace "disable" in favour of "ignore" to make it even more similar to scalastyle, and because having "disable" and "off"/"on" together would be confusing.

— Reply to this email directly or view it on GitHub https://github.com/HairyFotr/linter/issues/19#issuecomment-83659892.

Jianshi Huang

LinkedIn: jianshi Twitter: @jshuang Github & Blog: http://huangjs.github.com/

huangjs avatar Mar 20 '15 04:03 huangjs

any update on this?

ngbinh avatar May 17 '16 15:05 ngbinh

👍 I would also like to be able to turn off just specific warnings.

TomasMikula avatar Aug 09 '16 19:08 TomasMikula

Android Studio (or IntelliJ)'s CtrlAltL formatter supports similar grammar to ignore a code block, ref https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html#exclude_part_of_code

// @formatter:off
blahblah
// @formatter:on

Of course

// linter:disable[:OptionalCheckNames...]
// linter:enable[:OptionalCheckNames...]

is appreciate, while if it's difficult to implement, a whole off / on is also welcome.

KANGOD avatar Dec 09 '19 09:12 KANGOD