glat / MultiLinter

VisualStudio multiple and customizable linting and formatting made easy
9 stars 4 forks source link

.eslintignore not honoured #4

Closed martiensk closed 4 years ago

martiensk commented 4 years ago

It looks like the .eslintignore file is not honoured. It works if I lint from my project root directory, which is also the directory my .eslintrc and .eslintignore files are located in.

Here is the directory structure:

| Project Root
| -- .eslintrc
| -- .multilinterrc
| -- .eslintignore
| -> node_modules
     | -> .bin
          | -- eslint.cmd

This is the content of my .eslintignore:

/node_modules
/Content
/packages
/Scripts

The file that I am trying to ignore with the linter is located in the "Content" folder. This is the result when linting via the terminal: image

However, if I navigate to the same file in Visual Studio it is definitely linted. This is from the multilinter debug console:

image

I have also tried different glob patterns in the .eslintignore, including:

/Content/*
/Content/**/*
/Content/**/*.js
glat commented 4 years ago

I confirm the behaviour. It seems that current directory should be set to the project directory when launching linter. In last release it is set to the file directory and linter does not understand that it's in a directory to ignore to.

Fix will come. I'll let you know.

Keep in mind that you've to set "On Save" linting, otherwise the shadow copy created is located in %TEMP% and so no ignore will be honoured.

glat commented 4 years ago

Fix is live on extensions store. Please upgrade and check it.

I changed "Real Time" linting. Now shadow file is temporarily saved in same directory of file with a temporary filename [fileName].multilinter.[fileExtension] and deleted after linting. In folder projects it can appear for a moment in VS project explorer. To let VS ignore them add the following section in your .csproj

`

`

Default value of InstallationType is now local, so you can omit in your config.

Let me know

martiensk commented 4 years ago

Looks good mate. Thank you very much, I will happily close this issue.