-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli.js and ignore list (question) #779
Comments
@ainthek The original change was introduced in the node-jshint repository at jshint/node-jshint@c170fec#L0R164. Not sure how this change is related to the intent of the commit as indicated by the commit message. |
This makes sure that |
@antonkovalyov
and .jshintignore being:
when jshint is run in that directory and on that directory, it should scan only file1.js, but actually scans both files.
and they both evaluate to false, because the pattern is not recognized as negated pattern by minimatch. BTW, I started checking tests for this (tests\cli.js - testIgnoreFile) and it seems to me that the second part of the test (from https://github.com/jshint/jshint/blob/master/tests/cli.js#L248 onward) doesn't do anything - it sets up the stubs, but doesn't exercise cli with them. |
ignoreFile = _searchFile(".jshintignore");
console.log("ignoreFile:",ignoreFile);
if (ignoreFile) {
ignores = fs.readFileSync(ignoreFile, "utf8").split("\n")
.filter(function (line) {
return !!line.trim();
});
//.map(function (line) {
// return path.resolve(path.dirname(ignoreFile), line.trim());
//});
}
please can you explain the intention of map section and prefixing all minimatch expressions with dir name ? I think it makes them not to work as expected when running from other than project file.
Please extend .jshintignore docs.
The text was updated successfully, but these errors were encountered: