{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5175","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5175/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5175/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5175/events","html_url":"https://github.com/eslint/eslint/issues/5175","id":131936189,"number":5175,"title":"New config file plugin/extends resolution not working with node.js API and `configFile` option","user":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/accepted","name":"accepted","color":"0052cc"},{"url":"https://api.github.com/repos/eslint/eslint/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/eslint/eslint/labels/core","name":"core","color":"c7def8"},{"url":"https://api.github.com/repos/eslint/eslint/labels/priority","name":"priority","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"milestone":null,"comments":11,"created_at":"2016-02-07T05:13:02Z","updated_at":"2016-03-30T15:19:06Z","closed_at":null,"body":"The file resolution for the `plugin` and `extends` options works differently in eslint 2.0.0.\r\n\r\n`standard` 6.0.0 is using `eslint` 2.0.0-rc.0 and the `configFile` option to the node.js API. [The code](https://github.com/feross/standard/blob/39a54d33f95ca564d976ea2cb97f4c3a45ed0c09/options.js) looks roughly like this:\r\n\r\n```js\r\nvar CLIEngine = require(\"eslint\").CLIEngine\r\nvar cli = new CLIEngine({ configFile: path.join(__dirname, 'rc', '.eslintrc') })\r\n```\r\n\r\nThis `.eslintrc` file contains:\r\n\r\n```json\r\n{\r\n  \"extends\": [\"standard\", \"standard-jsx\"]\r\n}\r\n```\r\n\r\nThe `eslint-config-standard` and `eslint-config-standard-jsx` packages are dependencies of the `standard` package, of course. \r\n\r\nThe problem is that when users install `standard` as a dependency of their own project and run it, they get the following error:\r\n\r\n```\r\nError: Cannot find module 'eslint-config-standard-jsx' from '/home/travis/build/matjaz/stdin2'\r\nReferenced from: /home/travis/build/matjaz/stdin2/node_modules/standard/rc/.eslintrc\r\n    at Function.module.exports [as sync] (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/node_modules/resolve/lib/sync.js:33:11)\r\n    at resolve (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/config/config-file.js:393:38)\r\n    at load (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/config/config-file.js:412:24)\r\n    at /home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/config/config-file.js:331:36\r\n    at Array.reduceRight (native)\r\n    at applyExtends (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/config/config-file.js:314:28)\r\n    at Object.load (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/config/config-file.js:436:22)\r\n    at loadConfig (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/config.js:67:33)\r\n    at new Config (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/config.js:192:38)\r\n    at CLIEngine.executeOnFiles (/home/travis/build/matjaz/stdin2/node_modules/standard/node_modules/eslint/lib/cli-engine.js:492:28)\r\n```\r\n\r\nIt seems that the `process.cwd()` is being used as starting point for the search, instead of the config file's folder.\r\n\r\nPerhaps the `relativeTo` argument is not being passed to the `resolve` function [in this code](https://github.com/eslint/eslint/blob/11435afd76278a1291566c92af985bf8fad0731f/lib/config/config-file.js#L389-L394)?\r\n\r\nIn any case, this affected `standard` [recently](https://github.com/feross/standard/issues/406) and required [this hack](https://github.com/feross/standard/compare/v6.0.1...v6.0.3) to workaround. Hoping we can figure out a real fix to this."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/203484809","html_url":"https://github.com/eslint/eslint/issues/5175#issuecomment-203484809","issue_url":"https://api.github.com/repos/eslint/eslint/issues/5175","id":203484809,"user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T15:19:06Z","updated_at":"2016-03-30T15:19:06Z","body":"Ping @feross I'd really like your feedback on this before we merge. Can you please give the branch mentioned above a try?"}}