How to ignore specific files/folders from eslint within NX workspaces (nrwl)

4.8k Views Asked by At

I have a huge project that we want to convert from tslint to eslint. Because its so big we want to do this in small chunks which is why we want to be able to ignore folders. Does anyone know how to do this?

I have tried to add "[exclude":["my main app here"]

However when I add this exclude to the workspace.json I get an error "exclude is not found in schema" ?

I am not sure if this is the correct way to ignore these files?

any help is greatly appreciated :)

1

There are 1 best solutions below

1
On

The reason no answers have been accepted is that NX adds "ignorePatterns": ["**/*"] to the base monorepo .eslintrc and then "ignorePatterns": ["!**/*"] to the package .eslintrc files. I presume this is to cause only files within the package to get linted.

Unfortunately, I have not found any documentation on what "!" does in an eslintignore pattern. In a gitignore-like system, I could circumvent this by writing my own pattern after the !**/* or specifying folders at the top level.

Unfortunately, eslint differs from observing gitignore rules in this case. Someone with more insight into eslint would be able to either refer to documentation or file a bug.