Package file ignores common node runtime files.

This patch adds common files used by a node runtime environment
to the eslint ignore list.

Change-Id: Idc8dcce68947d3965ddd128180a5260dc5d6e36f
This commit is contained in:
Michael Krotscheck
2016-05-23 11:00:15 -07:00
parent 976c53299c
commit 5c4ae1b51a
2 changed files with 20 additions and 0 deletions

View File

@@ -72,6 +72,15 @@
pkgBuilder.fromJSON(fs.read(packagePath));
}
// Add files that should be ignored overall.
projectBuilder.ignoreFile('node_modules');
// NPM execution failures.
projectBuilder.ignoreFile('npm-debug.log');
// If you unzip something generated by npm pack, this is the directory it ends up in.
projectBuilder.ignoreFile('package');
// Local .npm cache
projectBuilder.ignoreFile('.npm');
return generator;
}

View File

@@ -44,6 +44,17 @@
var output = JSON.parse(pkgBuilder.toJSON());
expect(output.name).toBe('foo');
});
it('should add several files to the ignore list.',
function () {
pkg.init(mockGenerator);
var ignoredFiles = projectBuilder.getIgnoredFiles();
expect(ignoredFiles.indexOf('node_modules')).not.toBe(-1);
expect(ignoredFiles.indexOf('npm-debug.log')).not.toBe(-1);
expect(ignoredFiles.indexOf('package')).not.toBe(-1);
expect(ignoredFiles.indexOf('.npm')).not.toBe(-1);
});
});
describe('prompt()', function () {