{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/grunt-eslint/issues/109","repository_url":"https://api.github.com/repos/sindresorhus/grunt-eslint","labels_url":"https://api.github.com/repos/sindresorhus/grunt-eslint/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/grunt-eslint/issues/109/comments","events_url":"https://api.github.com/repos/sindresorhus/grunt-eslint/issues/109/events","html_url":"https://github.com/sindresorhus/grunt-eslint/issues/109","id":135775086,"number":109,"title":"`format` option not working after upgrade to eslint 2.2.0","user":{"login":"cowchimp","id":1131004,"avatar_url":"https://avatars.githubusercontent.com/u/1131004?v=3","gravatar_id":"","url":"https://api.github.com/users/cowchimp","html_url":"https://github.com/cowchimp","followers_url":"https://api.github.com/users/cowchimp/followers","following_url":"https://api.github.com/users/cowchimp/following{/other_user}","gists_url":"https://api.github.com/users/cowchimp/gists{/gist_id}","starred_url":"https://api.github.com/users/cowchimp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowchimp/subscriptions","organizations_url":"https://api.github.com/users/cowchimp/orgs","repos_url":"https://api.github.com/users/cowchimp/repos","events_url":"https://api.github.com/users/cowchimp/events{/privacy}","received_events_url":"https://api.github.com/users/cowchimp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-23T15:47:07Z","updated_at":"2016-02-23T16:09:08Z","closed_at":"2016-02-23T16:09:08Z","body":"Hi.\r\nThanks for this great grunt plugin.\r\n\r\nPassing the `format` option to the eslint task results in error\r\n`Warning: Cannot read property 'cwd' of undefined Use --force to continue.`\r\n(it worked fine with eslint 1.10.3 and grunt-eslint 17.3.1)\r\n\r\nI'm pretty sure this is related to a change eslint made here recently eslint/eslint#4472.\r\nBut I'm not sure if this is an issue with `eslint` itself or `grunt-eslint` calling `eslint` in a bad way.\r\n\r\nThe value I'm passing to the `format` option is a string which describes the path of the formatter I want to use.\r\nAs you can see what grunt-eslint does with this is pass it to [`eslint.CLIEngine.getFormatter(opts.format)`](https://github.com/sindresorhus/grunt-eslint/blob/850ebc19c325b550e576207ff37ffbe99faa3d02/tasks/eslint.js#L27)\r\nBecause `CLIEngine` is never instantiated it throws an error, because it references `this.options` within and `this.options` is undefined (`options` is set with `defaultOptions` in the constructor).\r\nI'm referring to this line [`formatterPath = path.resolve(this.options.cwd, format)`](https://github.com/eslint/eslint/blob/2bd57b6bbd11b23fdec65dc11c691f74c6a8db75/lib/cli-engine.js#L407)\r\n(in previous version of eslint it didn't reference `this.options.cwd` but rather `process.cwd()` and that's why it was not an issue beforehand)\r\n\r\nWDYT?\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/sindresorhus/grunt-eslint/issues/comments/187767009","html_url":"https://github.com/sindresorhus/grunt-eslint/issues/109#issuecomment-187767009","issue_url":"https://api.github.com/repos/sindresorhus/grunt-eslint/issues/109","id":187767009,"user":{"login":"cowchimp","id":1131004,"avatar_url":"https://avatars.githubusercontent.com/u/1131004?v=3","gravatar_id":"","url":"https://api.github.com/users/cowchimp","html_url":"https://github.com/cowchimp","followers_url":"https://api.github.com/users/cowchimp/followers","following_url":"https://api.github.com/users/cowchimp/following{/other_user}","gists_url":"https://api.github.com/users/cowchimp/gists{/gist_id}","starred_url":"https://api.github.com/users/cowchimp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowchimp/subscriptions","organizations_url":"https://api.github.com/users/cowchimp/orgs","repos_url":"https://api.github.com/users/cowchimp/repos","events_url":"https://api.github.com/users/cowchimp/events{/privacy}","received_events_url":"https://api.github.com/users/cowchimp/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T16:09:08Z","updated_at":"2016-02-23T16:09:08Z","body":"@sindresorhus looks like you got them to expose it as static :-) eslint/eslint#3239"}}