Disabling eslint for .ejs files

4.5k Views Asked by At

I have a template file on my project and while running the eslint I am facing various issues because of it. Some of those are -

error Parsing error: Unexpected token !

error Parsing error: Unexpected token <

To overcome from that I tried to use eslint-plugin-ejs with no help. I have visited below SO links as well -

Turning off eslint rule for a specific file

ESLint Parsing error: Unexpected token

Mysterious ESLint Parsing Error

and many more but again with no luck. Now I just want this file to be excluded from eslint but couldn't find the way to do that. Any help would be greatly appreciated.

1

There are 1 best solutions below

6
On BEST ANSWER

As the documentation says.

You can use of inline configuration /*eslint-disable*/ and /*eslint-enable*/.


enter image description here


@EDIT to what you've said in comment, there are two solutions

1 You can use of the property excludedFiles, I've found an example in the documentation :

enter image description here


2 You can handle the HTML and EJS files in a particular way as described here

3 You can also use the .eslintignore file as described at Ignoring Files and Directories