Search code examples
visual-studio-code

How do I make the Visual Studio Code linter ignore a line?


For example this, at the top of a node.js source file:

#!/usr/bin/env node

...or unused local variables, etc.


Solution

  • Late to the party but in VSCode you can write // @ts-ignore just before the line you want to ignore.

    enter image description here enter image description here

    It is important to notice that it will just ignore the line after the declaration.

    enter image description here

    There is more info about it in the official documentation.