3

When I'm in a workspace and open an external file (from outside of workspace) in VSCode, how can I exclude this file from lint? More specifically from pug-lint but the same applies to ESLint?

MrT77
  • 141
  • 3

1 Answers1

0

The documentation for pug-lint lists the option of excludeFiles as follows:

excludeFiles

Type: Array

Default: ["node_modules/**"]

Disables style checking for specified paths declared with glob patterns.

From examining the source-code of pug-lint, it seems that these options are specified in a .js file in the rules sub-folder, or specified in the Configuration file.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • The thing is that I want to exclude all files from outside my project (workspace), as in: if ./ is my project root folder, I want to exclude everything out of this (.././). This happens if I'm working in a project and open some file from outside that project, and ESLint starts working on it and messaging me about lint errors... – MrT77 Mar 04 '19 at 15:40
  • The developers didn't think about this possibility - you will have to write rules for `excludeFiles` that cover your main outside-project folders. – harrymc Mar 04 '19 at 15:51
  • sorry, it's not clear for me how could I do that? – MrT77 Mar 05 '19 at 11:20
  • I suppose add a JavaScript file under the `rules` subfolder of pug-lint that contains something like `{ "excludeFiles": [array of paths] }`. As I'm not using pug-lint, that's as far as I can go. – harrymc Mar 05 '19 at 11:26