Skip to content

Commit

Permalink
New: WIP add eslintIgnore support to package.json (fixes eslint#8458)
Browse files Browse the repository at this point in the history
More tests required
  • Loading branch information
VictorHom committed Jun 6, 2017
1 parent 54449a4 commit e136502
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/ignored-paths.js
Expand Up @@ -183,9 +183,10 @@ class IgnoredPaths {
const configOptions = config.load(packageJSONPath, configContext);

if (configOptions.eslintIgnore) {
const filesToIgnore = configOptions.eslintIgnore;

debug(filesToIgnore);
configOptions.eslintIgnore.forEach( pattern => {
addPattern(this.ig.custom, pattern);
addPattern(this.ig.default, pattern);
});
}
}
} catch (e) {
Expand Down
5 changes: 4 additions & 1 deletion tests/lib/ignored-paths.js
Expand Up @@ -165,9 +165,12 @@ describe("IgnoredPaths", () => {
);
});

it("shoud load package.json's array of files to ignore in eslintIgnore", () => {
it("should load package.json's array of files to ignore in eslintIgnore", () => {
const expectedIgnoreFile = getFixturePath("package-json-ignore/package.json");
const ignoredPaths = new IgnoredPaths({ ignore: true, cwd: getFixturePath("package-json-ignore") });

assert.isTrue(ignoredPaths.contains("hello.js"));
assert.isTrue(ignoredPaths.contains("world.js"));
});
});

Expand Down

0 comments on commit e136502

Please sign in to comment.