I'm having trouble getting grunt-eslint
to pick up an .eslintignore
file.
My setup is rather atypical in that I'm running the task on files in sibling directories rather than in the working directory itself.
grunt.initConfig({
eslint: {
options: {
configFile: '.eslintrc',
extensions: ['.js', '.html', '.xhtml', '.htm']
},
one: ['../' + project],
all: ['../*']
},
});
My .eslintignore
:
**/*.js
**/*.html
These patterns don't seem to match any files in the sibling directories. Any ideas?
This issue is tantamount to how
minimatch
(used byeslint
) resolves file paths preceeded by**
. Indeed,**
recursively traverses all subdirectories from the working directory only, which makes sense.To properly match files in a sibling directory, it's a simple question of prepending the
.eslintignore
file paths with../
, e.g.Hope this helps!