{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/2380","labels_url":"https://api.github.com/repos/eslint/eslint/issues/2380/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/2380/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/2380/events","html_url":"https://github.com/eslint/eslint/issues/2380","id":70964930,"number":2380,"title":"Node.js API modifies global defaults","user":{"login":"also","id":15624,"avatar_url":"https://avatars.githubusercontent.com/u/15624?v=3","gravatar_id":"","url":"https://api.github.com/users/also","html_url":"https://github.com/also","followers_url":"https://api.github.com/users/also/followers","following_url":"https://api.github.com/users/also/following{/other_user}","gists_url":"https://api.github.com/users/also/gists{/gist_id}","starred_url":"https://api.github.com/users/also/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/also/subscriptions","organizations_url":"https://api.github.com/users/also/orgs","repos_url":"https://api.github.com/users/also/repos","events_url":"https://api.github.com/users/also/events{/privacy}","received_events_url":"https://api.github.com/users/also/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"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-25T20:41:06Z","updated_at":"2015-05-08T19:21:28Z","closed_at":null,"body":"In ESlint v0.20.0, using `CLIEngine` modifies the `linter.defaults()` object or the passed-in `baseConfig` option directly before it is cloned.\r\n\r\n```javascript\r\nvar eslint = require('eslint');\r\nvar CLIEngine = eslint.CLIEngine;\r\nvar linter = eslint.linter;\r\n \r\nvar baseConfig = {format: 'stylish'};\r\n \r\nconsole.log(baseConfig.format);\r\nnew CLIEngine({baseConfig: baseConfig}).getConfigForFile('.');\r\nconsole.log(baseConfig.format);\r\n \r\nconsole.log();\r\n \r\nconsole.log(linter.defaults().format);\r\nnew CLIEngine({format: 'compact'}).getConfigForFile('.');\r\nconsole.log(linter.defaults().format);\r\n```\r\n\r\nThe `getConfigForFile` call causes `format` to be reset. This logs\r\n\r\n```\r\nstylish\r\nundefined\r\n\r\nundefined\r\ncompact\r\n```\r\n\r\nThis line from the current master appears to be responsible: https://github.com/eslint/eslint/blob/88b5ffa14fe11b0cc55ca60bf42d508a32d5c231/lib/config.js#L268"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/100332676","html_url":"https://github.com/eslint/eslint/issues/2380#issuecomment-100332676","issue_url":"https://api.github.com/repos/eslint/eslint/issues/2380","id":100332676,"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":"2015-05-08T19:21:28Z","updated_at":"2015-05-08T19:21:28Z","body":"Working on this."}}