Skip to content

Commit

Permalink
add a temp fix for #71 and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 5, 2016
1 parent 133642e commit a8d09c0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
19 changes: 18 additions & 1 deletion options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ var deepAssign = require('deep-assign');
var objectAssign = require('object-assign');
var homeOrTmp = require('home-or-tmp');
var multimatch = require('multimatch');
var resolveFrom = require('resolve-from');
var pathExists = require('path-exists');

var DEFAULT_IGNORE = [
'**/node_modules/**',
Expand Down Expand Up @@ -98,7 +100,22 @@ function buildConfig(opts) {
}

if (opts.extends && opts.extends.length > 0) {
config.baseConfig.extends = config.baseConfig.extends.concat(opts.extends);
// TODO: this logic needs to be improved, preferably use the same code as ESLint
// user's configs must be resolved to their absolute paths
var configs = opts.extends.map(function (name) {
// don't do anything if it's a filepath
if (pathExists.sync(name)) {
return name;
}

if (name.indexOf('eslint-config-') === -1) {
name = 'eslint-config-' + name;
}

return resolveFrom(opts.cwd, name);
});

config.baseConfig.extends = config.baseConfig.extends.concat(configs);
}

return config;
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,26 @@
],
"dependencies": {
"arrify": "^1.0.0",
"babel-eslint": "^5.0.0",
"babel-eslint": "^6.0.0-beta.1",
"debug": "^2.2.0",
"deep-assign": "^1.0.0",
"eslint": "^2.0.0",
"eslint-config-xo": "^0.10.1",
"eslint-plugin-babel": "^3.0.0",
"eslint": "^2.3.0",
"eslint-config-xo": "^0.12.0",
"eslint-plugin-babel": "^3.1.0",
"eslint-plugin-no-empty-blocks": "0.0.2",
"eslint-plugin-no-use-extend-native": "^0.3.2",
"estraverse-fb": "^1.3.1",
"get-stdin": "^5.0.0",
"globby": "^4.0.0",
"has-flag": "^1.0.0",
"home-or-tmp": "^2.0.0",
"meow": "^3.4.2",
"multimatch": "^2.1.0",
"object-assign": "^4.0.1",
"path-exists": "^2.1.0",
"pkg-conf": "^1.0.1",
"resolve-cwd": "^1.0.0",
"resolve-from": "^2.0.0",
"update-notifier": "^0.6.0",
"xo-init": "^0.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.skip('ignores fixture', async t => {
t.throws(execa('../../../cli.js', ['--no-local'], {cwd}));
});

test('supports shareable config', async () => {
test('supports being extended with a shareable config', async () => {
const cwd = path.join(__dirname, 'fixtures/project');
await execa('../../../cli.js', ['--no-local'], {cwd});
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a8d09c0

Please sign in to comment.