{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/xo/issues/32","labels_url":"https://api.github.com/repos/sindresorhus/xo/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/xo/issues/32/comments","events_url":"https://api.github.com/repos/sindresorhus/xo/issues/32/events","html_url":"https://github.com/sindresorhus/xo/pull/32","id":108440553,"number":32,"title":"Prefer locally installed version, fall back to global.","user":{"login":"jamestalmage","id":4082216,"avatar_url":"https://avatars.githubusercontent.com/u/4082216?v=3","gravatar_id":"","url":"https://api.github.com/users/jamestalmage","html_url":"https://github.com/jamestalmage","followers_url":"https://api.github.com/users/jamestalmage/followers","following_url":"https://api.github.com/users/jamestalmage/following{/other_user}","gists_url":"https://api.github.com/users/jamestalmage/gists{/gist_id}","starred_url":"https://api.github.com/users/jamestalmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamestalmage/subscriptions","organizations_url":"https://api.github.com/users/jamestalmage/orgs","repos_url":"https://api.github.com/users/jamestalmage/repos","events_url":"https://api.github.com/users/jamestalmage/events{/privacy}","received_events_url":"https://api.github.com/users/jamestalmage/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-09-26T04:57:00Z","updated_at":"2015-11-09T08:07:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sindresorhus/xo/pulls/32","html_url":"https://github.com/sindresorhus/xo/pull/32","diff_url":"https://github.com/sindresorhus/xo/pull/32.diff","patch_url":"https://github.com/sindresorhus/xo/pull/32.patch"},"body":"Use whatever version of `xo` is installed locally in `node_modules`, before using the globally installed version.\r\n\r\nFairly naive implementation, but it works and is backward compatible as far back as I checked (0.7.x).\r\n\r\nI disable `update-notifier` if a local version is found. That could maybe be improved upon by still notifying if local is out of date. `update-notifier` seems to always recommend installation with the `-g` flag though."},"comment":{"url":"https://api.github.com/repos/sindresorhus/xo/issues/comments/154992639","html_url":"https://github.com/sindresorhus/xo/pull/32#issuecomment-154992639","issue_url":"https://api.github.com/repos/sindresorhus/xo/issues/32","id":154992639,"user":{"login":"jamestalmage","id":4082216,"avatar_url":"https://avatars.githubusercontent.com/u/4082216?v=3","gravatar_id":"","url":"https://api.github.com/users/jamestalmage","html_url":"https://github.com/jamestalmage","followers_url":"https://api.github.com/users/jamestalmage/followers","following_url":"https://api.github.com/users/jamestalmage/following{/other_user}","gists_url":"https://api.github.com/users/jamestalmage/gists{/gist_id}","starred_url":"https://api.github.com/users/jamestalmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamestalmage/subscriptions","organizations_url":"https://api.github.com/users/jamestalmage/orgs","repos_url":"https://api.github.com/users/jamestalmage/repos","events_url":"https://api.github.com/users/jamestalmage/events{/privacy}","received_events_url":"https://api.github.com/users/jamestalmage/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T08:07:30Z","updated_at":"2015-11-09T08:07:30Z","body":"Ok, so we change `package.json` to this\r\n\r\n```json\r\n\"bin\": {\r\n  \"xo\": \"cli-shim.js\",\r\n  \"_xo\": \"cli.js\"\r\n}\r\n```\r\n\r\nAnd then you can just `_xo` to grab the global one.\r\n\r\nAlternatively we could add a `--force-global` hook (totally easy to do).\r\n\r\nOr... What if I can detect that it is globally linked and automagically ignore the local version? Not sure if it's possible, but I think it probably is. Might be hard. But if that's what it takes I'll try it.\r\n"}}