{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5848","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5848/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5848/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5848/events","html_url":"https://github.com/eslint/eslint/issues/5848","id":148224505,"number":5848,"title":"Use .gitignore by default if no .eslintignore is found","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/breaking","name":"breaking","color":"e11d21"},{"url":"https://api.github.com/repos/eslint/eslint/labels/core","name":"core","color":"c7def8"},{"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/eslint/eslint/labels/evaluating","name":"evaluating","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-14T01:19:08Z","updated_at":"2016-04-14T20:54:02Z","closed_at":null,"body":"This is a proposal intended to reduce the friction for the adoption of eslint into a project.  Most times, files which are not version controlled are also not linted (`node_modules` being a common example, but also compiled code and dynamically generated files as well).  Currently, every project must either create an `.eslintignore` file to specify those files, or if they are using a `.gitignore`, they can add a command line flag like `--ignore-pattern .gitignore`.  But in both cases they must take an action to prevent non-controlled files from being linted.\r\n\r\nIn the [Gitter chat room earlier today](https://gitter.im/eslint/eslint?at=570e58d25cd40114649ae8b5), @gabmontes suggested that we could default to using a `.gitignore` file if no `.eslintignore` file is found (and of course no `--ignore-path` or `--ignore-pattern` was provided).  \r\n\r\nI believe this is a sane default.  It is easily overridden, but will be sufficient for the vast majority of users.  It will help avoid config file clutter, and lower the learning curve for getting started with ESLint.  \r\n\r\nI'd be willing to implement this if it is accepted, although I'm guessing this could be seen as a breaking change and may need be held until a major version bump."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/210144897","html_url":"https://github.com/eslint/eslint/issues/5848#issuecomment-210144897","issue_url":"https://api.github.com/repos/eslint/eslint/issues/5848","id":210144897,"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-04-14T20:54:02Z","updated_at":"2016-04-14T20:54:02Z","body":"I'm not sure this is a good idea. In general, I think it's a bad practice to unexpectedly use files that aren't earmarked for ESLint use. In this case specifically, we can't anticipate the problems if we start reading `.gitignore` by default when `.eslintignore` isn't there. To me, it violates the principle of least surprise (\"why would a change to .gitignore affect ESLint???\").\r\n\r\nYou can already pass `.gitignore` on the command line using `--ignore-path`, so I don't see a clear win as compared to the considerable confusion this would seem to introduce."}}