2

I'm building a website using Cherrpy, and I have in my code lines such as if (vacant < parseInt({{warnLevel}}),10) {. {{warnLevel}} is replaced by a variable I pass from a Python script, allowing me to set variables externally. However, this results in a lot of errors, as, although this works, VSCode doesn't recognise this as valid JS. Is there a way I can disable JS validation for a specific line? I've tried // @ts-ignore as suggested here but it doesn't seem to work.

gman
  • 100,619
  • 31
  • 269
  • 393
clubby789
  • 2,543
  • 4
  • 16
  • 32

2 Answers2

1

You can just add either

// eslint-disable-line

at the end of a line

or

// eslint-disable-next-line 

on the line before

more details here

note there is no reason to install an extra extension. The eslint extension already offers these options

enter image description here

note you can configure any rules you want by adding comments

gman
  • 100,619
  • 31
  • 269
  • 393
0

install eslint-disable-snippets extention for this purpose.

you can include snippets for ignoring; a block, the current line, or the next line.

extention preview

gman
  • 100,619
  • 31
  • 269
  • 393
mh. bitarafan
  • 886
  • 9
  • 16