//noinspection for entire file?

Answered

We are using a test framework and get a lot of unused warnings and would like to disable that for the entire file. I put this at the top but it doesn't seem to work.

//noinspection JSHint, JSUnusedLocalSymbols



Is there a way to do this?
3 comments

Hi there,

You can do it this way (do not know how convenient it would be in your case though; if you need to disable specific inspection in all files within certain folder (or file names match certain pattern) -- this will work ok):

  1. Create separate scope that will include such files (Settings | Scopes)
  2. "Settings | Inspections"
  3. Select "problematic" inspection, right click and choose "Add Scope"
  4. Now you can enable/disable this inspection for this scope / all other files
0

I would like to disable a specific inspection for an entire file but in a way that is shared with the team, so I'd like to write a @noinspection line that applies to a file / scope

0

@Jonathan file-level suppressions for PHP work starting 2018.1.1 PhpStorm version, e.g.:

<?php /** @noinspection PhpUndefinedClassInspection */
2

Please sign in to leave a comment.