{"action":"created","issue":{"url":"https://api.github.com/repos/mradionov/eslint-plugin-disable/issues/7","repository_url":"https://api.github.com/repos/mradionov/eslint-plugin-disable","labels_url":"https://api.github.com/repos/mradionov/eslint-plugin-disable/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/mradionov/eslint-plugin-disable/issues/7/comments","events_url":"https://api.github.com/repos/mradionov/eslint-plugin-disable/issues/7/events","html_url":"https://github.com/mradionov/eslint-plugin-disable/issues/7","id":170292837,"number":7,"title":"Feature request: disable only specific rules instead of entire plugin","user":{"login":"nwalters512","id":1476544,"avatar_url":"https://avatars.githubusercontent.com/u/1476544?v=3","gravatar_id":"","url":"https://api.github.com/users/nwalters512","html_url":"https://github.com/nwalters512","followers_url":"https://api.github.com/users/nwalters512/followers","following_url":"https://api.github.com/users/nwalters512/following{/other_user}","gists_url":"https://api.github.com/users/nwalters512/gists{/gist_id}","starred_url":"https://api.github.com/users/nwalters512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwalters512/subscriptions","organizations_url":"https://api.github.com/users/nwalters512/orgs","repos_url":"https://api.github.com/users/nwalters512/repos","events_url":"https://api.github.com/users/nwalters512/events{/privacy}","received_events_url":"https://api.github.com/users/nwalters512/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-09T23:12:39Z","updated_at":"2016-08-25T18:58:16Z","closed_at":null,"body":"I'm not sure if this fits within your larger vision of your plugin, but I'd like the ability to only disable specific rules, not entire plugins, in certain directories.\r\n\r\nMy use case: I have a project that uses ESLint for linting and Jest for unit tests. My tests all live inside directories called `__tests__` that are adjacent to the modules they test. I use `eslint-plugin-import` to lint my import statements. In general, I want to utilize the `import/no-extraneous-dependencies` rule to prevent importing dev dependencies in my application code. However, I do want to be able to import dev dependencies from within my unit tests without the linter complaining. Ideally, I'd be able to do something like the following:\r\n\r\n```json\r\n{\r\n  \"settings\": {\r\n    \"eslint-plugin-disable\": {\r\n      \"paths\": {\r\n        \"import/no-extraneous-dependencies\": [\"**/__tests__/**/*.js\"]\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nThat way, other rules from `import` would still run in my `__tests__` directories, and all `import` rules would run for all non-test files.\r\n\r\nI'd be willing to do some of the implementation work myself and submit a PR, I just wanted to see if this would be a desired addition to `eslint-plugin-disable` before I put in the work."},"comment":{"url":"https://api.github.com/repos/mradionov/eslint-plugin-disable/issues/comments/242500881","html_url":"https://github.com/mradionov/eslint-plugin-disable/issues/7#issuecomment-242500881","issue_url":"https://api.github.com/repos/mradionov/eslint-plugin-disable/issues/7","id":242500881,"user":{"login":"mradionov","id":2007370,"avatar_url":"https://avatars.githubusercontent.com/u/2007370?v=3","gravatar_id":"","url":"https://api.github.com/users/mradionov","html_url":"https://github.com/mradionov","followers_url":"https://api.github.com/users/mradionov/followers","following_url":"https://api.github.com/users/mradionov/following{/other_user}","gists_url":"https://api.github.com/users/mradionov/gists{/gist_id}","starred_url":"https://api.github.com/users/mradionov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mradionov/subscriptions","organizations_url":"https://api.github.com/users/mradionov/orgs","repos_url":"https://api.github.com/users/mradionov/repos","events_url":"https://api.github.com/users/mradionov/events{/privacy}","received_events_url":"https://api.github.com/users/mradionov/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T18:58:16Z","updated_at":"2016-08-25T18:58:16Z","body":"It is possible to achieve using nested config files - [see section in docs](http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy)\r\n\r\nBasically, you have your root ESLint config file, where `import/no-extraneous-dependencies` is enabled. \r\nIn your tests directory you should create one more ESLint config, where this rule will be disabled. ESLint won't raise warning for this rule for files in tests directory.\r\n\r\n```\r\n.\r\n|-- src\r\n    |-- file1.js\r\n    |-- file2.js\r\n|-- test\r\n    |-- file1.test.js\r\n    |-- file2.test.js\r\n    |-- .eslintrc             <-- nested, rule disabled only for tests\r\n|-- .eslintrc                 <-- root, rule enabled for all code\r\n```\r\n\r\nAs it is possible to do using ESLint itself, it is well supported and documented, I believe it's better to use official API."}}
{"actor":{"display_login":"mradionov"}}