Skip to content

Commit 519ad1b

Browse files
committed
cleanup #147
1 parent 85c6094 commit 519ad1b

5 files changed

Lines changed: 16 additions & 11 deletions

File tree

options-manager.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,20 @@ function groupConfigs(paths, baseOptions, overrides) {
217217

218218
function getIgnores(opts) {
219219
opts.ignores = DEFAULT_IGNORE.concat(opts.ignores || []);
220-
const gitignores = globby.sync('**/.gitignore', {ignore: opts.ignores, cwd: opts.cwd || process.cwd()});
220+
221+
const gitignores = globby.sync('**/.gitignore', {
222+
ignore: opts.ignores,
223+
cwd: opts.cwd || process.cwd()
224+
});
225+
221226
const ignores = gitignores
222-
.map(pathToGitignore => {
223-
const patterns = parseGitignore(pathToGitignore);
224-
const base = path.dirname(pathToGitignore);
227+
.map(pathToGitignore => {
228+
const patterns = parseGitignore(pathToGitignore);
229+
const base = path.dirname(pathToGitignore);
225230

226-
return patterns.map(file => path.join(base, file));
227-
})
228-
.reduce((a, b) => a.concat(b), []);
231+
return patterns.map(file => path.join(base, file));
232+
})
233+
.reduce((a, b) => a.concat(b), []);
229234

230235
opts.ignores = opts.ignores.concat(ignores);
231236

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Additional global variables your code accesses during execution.
161161

162162
Type: `Array`
163163

164-
Some [paths](https://github.com/sindresorhus/xo/blob/master/options-manager.js) are ignored by default, including paths in .gitignore. Additional ignores can be added here.
164+
Some [paths](https://github.com/sindresorhus/xo/blob/master/options-manager.js) are ignored by default, including paths in `.gitignore`. Additional ignores can be added here.
165165

166166
### space
167167

test/bar/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
foo.js
1+
foo.js

test/bar/foobar/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bar.js
1+
bar.js
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
foo.js
1+
foo.js

0 commit comments

Comments
 (0)