How to make Quokka.js Untitled file to be ignored by Eslint?

392 Views Asked by At

I have a JS project with strict ESLint rules and "eslint.run": "onType" setting. I would like to ignore new Quokka.js Untitled editors, which are just a playground and I do not want to bother with clean syntax there. Is there any way how to disable VS Code ESLint for Quokka Untitled editors?

A possible workaround could be to automatically add a line /* eslint-disable */ to every Quokka.js New JavaScript File, but I also do not know if it's possible. (Maybe by a Quokka.js plugin, but that's the last option due to complexity.)

3

There are 3 best solutions below

1
On BEST ANSWER

The ESLint extension in VSCode has a Eslint: Ignore Untitled option which solved the issue for me.

2
On

in your eslintrc.json add

"files": [ 
  {
    "patterns": "**/*()" // For Quokka files -> dont have a valid file extension
  }
],
0
On

As a workaround, I've created a code snippet:

    "Quokka": {
        "prefix": "Quokka",
        "body": ["/* eslint-disable */", "//... may have other lines ..."]
    }

And insert it when I open new Quokka window.