0

I am creating documentation in a React app (using web-pack) by running the following command,

jsdoc src -r -d docs

This creates a folder on the root of the app called docs.

However when I run npm test sometest.test.js, eslint runs before the test and throws a long list of errors because it runs on the docs folder. I have tried excluding docs folder from eslint by adding it in the .eslintignore file like in the example shared below.

.eslintignore

docs/*

But still I see a long list of errors created by eslint on the docs folder. Errors shown below,

3:7 error unnecessary escape character: \> no-useless-escape
...

How can I fix this? Thank you

Ahmet Emre Kilinc
  • 5,489
  • 12
  • 30
  • 42
Ahmed
  • 2,966
  • 7
  • 42
  • 69
  • Have you tried `docs/` or `docs/**` perhaps? Just throwing some ideas since your concept seems okay – Antonio Erdeljac Oct 07 '20 at 21:57
  • Nope. It didnt worked. By any chance is it about the versions that I am using? Using eslint 4.19.1 – Ahmed Oct 07 '20 at 21:58
  • 1
    Huh... the newest version is 7.10.0, so you are due to update soon, but I am still not 100% sure it is related to the version, but have you tried using `ignorePatterns`? You can add `docs/*` in the array as you would in the `.eslintignore` file https://eslint.org/docs/user-guide/configuring#ignorepatterns-in-config-files – Antonio Erdeljac Oct 07 '20 at 22:02
  • Ignore-pattern in the file did not work for some reason. However upon adding the ignore pattern in package.json did worked. But that too not directly. Worked as a prehook – Ahmed Oct 07 '20 at 22:16

0 Answers0