4

We can suppress inspections using special comments like this one: // noinspection JSIgnoredPromiseFromCall, but it only works for a next line of code.

I have a big test suite where I call functions and ignore the returned promises. I don't want to add // noinspection JSIgnoredPromiseFromCall comment for each call.

Is there a way to disabled some specific inspection for an entire file?

Slava Fomin II
  • 26,865
  • 29
  • 124
  • 202

2 Answers2

2

Yup. Alt+Enter on a warning, right arrow key > Suppress for file:

enter image description here

Dmitrii
  • 3,377
  • 1
  • 21
  • 38
  • 3
    Some inspections can be suppressed for file, others - not; *Result of method call returning promise is ignored* inspection can only be suppressed for current statement, it can't be disabled on file level. – lena Sep 25 '18 at 14:21
  • What I'd like to know is how to revert this. If I decide that I want to show the warnings again in that particular file, how do I turn them on again? – cezar Jun 04 '21 at 05:12
  • Oh, now I see it adds an annotated comment on the first code line. – cezar Jun 04 '21 at 05:23
0

Currently there is no way to disable JS inspection for an entire life.

But there is a feature request for this case, you can vote for it: https://youtrack.jetbrains.com/issue/WEB-24722

mcmimik
  • 1,389
  • 15
  • 32