Skip to content

Commit df2e3ed

Browse files
committed
Remove more eslint-specific code
1 parent 9f2a3d7 commit df2e3ed

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Diff for: lib/glob_util.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ function processPath(options) {
6868
};
6969
}
7070

71-
//------------------------------------------------------------------------------
72-
// Public Interface
73-
//------------------------------------------------------------------------------
74-
7571
/**
7672
* Resolves any directory patterns into glob-based patterns for easier handling.
7773
* @param {string[]} patterns File patterns (such as passed on the command line).
@@ -88,19 +84,13 @@ function resolveFileGlobPatterns(patterns, options) {
8884
* Ignored files are excluded from the results, as are duplicates.
8985
*
9086
* @param {string[]} globPatterns Glob patterns.
91-
* @param {Object} [options] An options object.
92-
* @param {string} [options.cwd] CWD (considered for relative filenames)
93-
* @param {boolean} [options.ignore] False disables use of .eslintignore.
94-
* @param {string} [options.ignorePath] The ignore file to use instead of .eslintignore.
95-
* @param {string} [options.ignorePattern] A pattern of files to ignore.
9687
* @returns {string[]} Resolved absolute filenames.
9788
*/
98-
function listFilesToProcess(globPatterns, options) {
99-
options = options || { ignore: true };
89+
function listFilesToProcess(globPatterns) {
10090
var files = [],
10191
added = Object.create(null);
10292

103-
var cwd = (options && options.cwd) || process.cwd();
93+
var cwd = process.cwd();
10494

10595
/**
10696
* Executes the linter on a file defined by the `filename`. Skips

Diff for: lib/input/dependency.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function dependencyStream(indexes, options, callback) {
3333
return !!options.external || moduleFilters.internalOnly(id);
3434
},
3535
extensions: [].concat(options.extension || [])
36-
.concat(['js', 'es6', 'jsx', 'json'])
36+
.concat(['js', 'es6', 'jsx'])
3737
.map(function (ext) {
3838
return '.' + ext;
3939
}),

Diff for: test/bin-readme.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ test('readme command', function (group) {
100100
});
101101
});
102102

103-
group.test('errors if specified readme section is missing', function (t) {
104-
documentation(['readme index.js -s DUMMY'], {cwd: d}, function (err, stdout, stderr) {
103+
var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input.js');
104+
group.test('errors on invalid syntax', function (t) {
105+
documentation(['readme ' + badFixturePath + ' -s API'], {cwd: d}, function (err, stdout, stderr) {
105106
t.ok(err);
106107
t.ok(err.code !== 0, 'exit nonzero');
107108
t.end();

Diff for: test/lib/input/shallow.js

+9
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ test('shallow deps not found', function (t) {
4545
t.end();
4646
});
4747

48+
test('throws on non-string or object input', function (t) {
49+
t.throws(function () {
50+
shallow([
51+
true
52+
], {});
53+
}, 'indexes should be either strings or objects');
54+
t.end();
55+
});
56+
4857
test('shallow deps literal', function (t) {
4958
var obj = {
5059
file: 'foo.js',

0 commit comments

Comments
 (0)