{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/6459","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/6459/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/6459/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/6459/events","html_url":"https://github.com/eslint/eslint/issues/6459","id":161003848,"number":6459,"title":"Cache is deleted when linting text","user":{"login":"IanVS","id":4616705,"avatar_url":"https://avatars.githubusercontent.com/u/4616705?v=3","gravatar_id":"","url":"https://api.github.com/users/IanVS","html_url":"https://github.com/IanVS","followers_url":"https://api.github.com/users/IanVS/followers","following_url":"https://api.github.com/users/IanVS/following{/other_user}","gists_url":"https://api.github.com/users/IanVS/gists{/gist_id}","starred_url":"https://api.github.com/users/IanVS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanVS/subscriptions","organizations_url":"https://api.github.com/users/IanVS/orgs","repos_url":"https://api.github.com/users/IanVS/repos","events_url":"https://api.github.com/users/IanVS/events{/privacy}","received_events_url":"https://api.github.com/users/IanVS/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/cli","name":"cli","color":"eb6420"},{"url":"https://api.github.com/repos/eslint/eslint/labels/core","name":"core","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-18T03:09:31Z","updated_at":"2016-06-25T04:47:16Z","closed_at":null,"body":"<!--\r\nThis template is for bug reports. If you are reporting a bug, please continue on. If you are here for another reason, please see below:\r\n\r\n1. To propose a new rule: http://eslint.org/docs/developer-guide/contributing/new-rules\r\n2. To request a change: http://eslint.org/docs/developer-guide/contributing/changes\r\n3. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint\r\n\r\nNote that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue.\r\n-->\r\n\r\n**What version of ESLint are you using?**\r\nMaster\r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?**\r\ndefault\r\n\r\n**Please show your full configuration:**\r\nN/A\r\n\r\n**What did you do? Please include the actual source code causing the issue.**\r\n\r\nGiven a directory with a file and an `.eslintcache`:\r\n```\r\n> tree -a\r\n.\r\n├── .eslintcache\r\n└── foo.js\r\n```\r\n\r\nRunning eslint on text with `--stdin` causes the `.eslintcache` file to be deleted:\r\n\r\n```\r\n> echo \"var foo=42;\" | eslint --stdin\r\n> tree -a\r\n.\r\n└── foo.js\r\n```\r\n\r\n**What did you expect to happen?**\r\n\r\nSince the cache is only used when executing on files, I would not expect the `.eslintcache` file to be deleted.  This causes problems when using eslint in a text editor like Atom, because it means as soon as a file is opened (and therefore linted), the cache file is deleted (see https://github.com/AtomLinter/linter-eslint/issues/587).  \r\n\r\nI believe this is because the code which deletes the cache is too high in the CLIEngine execution [right after instantiation](https://github.com/eslint/eslint/blob/master/lib/cli-engine.js#L460).  It could likely be moved into `executeOnFiles` as an `else` to [this check](https://github.com/eslint/eslint/blob/master/lib/cli-engine.js#L641)."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/228511985","html_url":"https://github.com/eslint/eslint/issues/6459#issuecomment-228511985","issue_url":"https://api.github.com/repos/eslint/eslint/issues/6459","id":228511985,"user":{"login":"platinumazure","id":284282,"avatar_url":"https://avatars.githubusercontent.com/u/284282?v=3","gravatar_id":"","url":"https://api.github.com/users/platinumazure","html_url":"https://github.com/platinumazure","followers_url":"https://api.github.com/users/platinumazure/followers","following_url":"https://api.github.com/users/platinumazure/following{/other_user}","gists_url":"https://api.github.com/users/platinumazure/gists{/gist_id}","starred_url":"https://api.github.com/users/platinumazure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/platinumazure/subscriptions","organizations_url":"https://api.github.com/users/platinumazure/orgs","repos_url":"https://api.github.com/users/platinumazure/repos","events_url":"https://api.github.com/users/platinumazure/events{/privacy}","received_events_url":"https://api.github.com/users/platinumazure/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T04:47:16Z","updated_at":"2016-06-25T04:47:16Z","body":"Since the cache only has meaning when ESLint is run on files, maybe there's no need to wipe the cache when `--stdin` option is passed to CLI. At least, that's my take on it."}}
{"actor":{"display_login":"platinumazure"}}