Skip to content

Commit

Permalink
better windows path separator support
Browse files Browse the repository at this point in the history
  • Loading branch information
electric-el committed Nov 18, 2021
1 parent 953c8b8 commit 1fc20c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/gulp-eslint/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ exports.createIgnoreResult = file => {
messages: [{
fatal: false,
severity: 1,
message: filePath.includes('node_modules/') ?
message: (file.path.includes('node_modules/') || file.path.includes('node_modules\\')) ?
'File ignored because it has a node_modules/** path' :
'File ignored because of .eslintignore file'
}],
Expand Down
12 changes: 6 additions & 6 deletions test/gulp-eslint/formatting.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ describe('gulp-eslint format', () => {
const result = fs.readFileSync(logFile, 'utf8');

expect(result.match(/<\?xml version="1.0" encoding="utf-8"\?>/g).length).to.equal(1);
expect(result).to.have.string('test/fixtures/use-strict.js');
expect(result).to.have.string('test/fixtures/undeclared.js');
expect(result).to.have.string('test/fixtures/passing.js');
expect(result).to.have.string('use-strict.js');
expect(result).to.have.string('undeclared.js');
expect(result).to.have.string('passing.js');

done();
});
Expand Down Expand Up @@ -294,9 +294,9 @@ describe('gulp-eslint formatEach', () => {
const results = fs.readFileSync(logFile, 'utf8');

expect(results.match(/<\?xml version="1.0" encoding="utf-8"\?>/g).length).to.equal(3);
expect(results).to.have.string('test/fixtures/use-strict.js');
expect(results).to.have.string('test/fixtures/undeclared.js');
expect(results).to.have.string('test/fixtures/passing.js');
expect(results).to.have.string('use-strict.js');
expect(results).to.have.string('undeclared.js');
expect(results).to.have.string('passing.js');

done();
});
Expand Down
12 changes: 6 additions & 6 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ describe('fp-eslint', function () {
() => {
expect(lintReports).to.have.lengthOf(1);
expect(lintReports[0]).to.have.string('<?xml version="1.0" encoding="utf-8"?>');
expect(lintReports[0]).to.have.string('test/source/_scripts/src-error/script-error-1.js');
expect(lintReports[0]).to.have.string('test/source/_scripts/src-error/script-error.js');
expect(lintReports[0]).to.have.string('script-error-1.js');
expect(lintReports[0]).to.have.string('script-error.js');
done();
}
);
Expand All @@ -207,11 +207,11 @@ describe('fp-eslint', function () {
() => {
expect(lintReports).to.have.lengthOf(2);
expect(lintReports[0]).to.have.string('<?xml version="1.0" encoding="utf-8"?>');
expect(lintReports[0]).to.have.string('test/source/_scripts/src-error/script-error-1.js');
expect(lintReports[0]).to.not.have.string('test/source/_scripts/src-error/script-error.js');
expect(lintReports[0]).to.have.string('script-error-1.js');
expect(lintReports[0]).to.not.have.string('script-error.js');
expect(lintReports[1]).to.have.string('<?xml version="1.0" encoding="utf-8"?>');
expect(lintReports[1]).to.not.have.string('test/source/_scripts/src-error/script-error-1.js');
expect(lintReports[1]).to.have.string('test/source/_scripts/src-error/script-error.js');
expect(lintReports[1]).to.not.have.string('script-error-1.js');
expect(lintReports[1]).to.have.string('script-error.js');
done();
}
);
Expand Down

0 comments on commit 1fc20c3

Please sign in to comment.