//noinspection for entire file?


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?

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

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


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

<?php /** @noinspection PhpUndefinedClassInspection */

this doesn't work for me in WS anymore


Fetis26, it's not yet implemented for JavaScript/TypeScript: https://youtrack.jetbrains.com/issue/WEB-10308

Please consider the workaround suggested by Andriy.