{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/11183","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/11183/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/11183/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/11183/events","html_url":"https://github.com/eslint/eslint/issues/11183","id":389471718,"node_id":"MDU6SXNzdWUzODk0NzE3MTg=","number":11183,"title":"'React' is defined but never used  no-unused-vars","user":{"login":"VanessaChu","id":11250498,"node_id":"MDQ6VXNlcjExMjUwNDk4","avatar_url":"https://avatars3.githubusercontent.com/u/11250498?v=4","gravatar_id":"","url":"https://api.github.com/users/VanessaChu","html_url":"https://github.com/VanessaChu","followers_url":"https://api.github.com/users/VanessaChu/followers","following_url":"https://api.github.com/users/VanessaChu/following{/other_user}","gists_url":"https://api.github.com/users/VanessaChu/gists{/gist_id}","starred_url":"https://api.github.com/users/VanessaChu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VanessaChu/subscriptions","organizations_url":"https://api.github.com/users/VanessaChu/orgs","repos_url":"https://api.github.com/users/VanessaChu/repos","events_url":"https://api.github.com/users/VanessaChu/events{/privacy}","received_events_url":"https://api.github.com/users/VanessaChu/received_events","type":"User","site_admin":false},"labels":[{"id":246711855,"node_id":"MDU6TGFiZWwyNDY3MTE4NTU=","url":"https://api.github.com/repos/eslint/eslint/labels/question","name":"question","color":"d4c5f9","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-12-10T20:24:18Z","updated_at":"2018-12-12T23:22:30Z","closed_at":null,"author_association":"NONE","body":"When i run eslint on my code, I get the error:\r\n`'React' is defined but never used  no-unused-vars`\r\nwhen I remove import 'React' from 'react' I get the error \r\n`'React' must be in scope when using JSX`\r\n\r\nI tried enabling the rules below but still receive the error. \r\n    \"react/jsx-uses-react\": 1,\r\n    \"react/jsx-uses-vars\": 1,\r\n    \"react/react-in-jsx-scope\": 1\r\n\r\nCan someone help me check if my configurations are correct, if I'm not overriding anything?\r\n\r\n```\r\n{\r\n  \"parser\": \"babel-eslint\",\r\n  \"extends\": [\r\n    \"eslint:recommended\",\r\n    \"airbnb\",\r\n    \"plugin:flowtype/recommended\"\r\n  ],\r\n  \"plugins\": [\r\n    \"babel\",\r\n    \"react\",\r\n    \"flowtype\"\r\n  ],\r\n  \"rules\": {\r\n    \"react/jsx-uses-react\": 1,\r\n    \"react/jsx-uses-vars\": 1,\r\n    \"react/react-in-jsx-scope\": 1,\r\n  \r\n    // Indent with 4 spaces\r\n    \"indent\": [\r\n      \"error\",\r\n      4\r\n    ],\r\n    // Indent JSX with 4 spaces\r\n    \"react/jsx-indent\": [\r\n      \"error\",\r\n      4\r\n    ],\r\n    // Indent props with 4 spaces\r\n    \"react/jsx-indent-props\": [\r\n      \"error\",\r\n      4\r\n    ],\r\n    // TODO: Remove all of these exceptions\r\n    // We have code that violates each one of these rules.\r\n    // We should fix the style then remove the rules when we can.\r\n    \"consistent-return\": \"off\",\r\n    \"flowtype/no-types-missing-file-annotation\": \"off\",\r\n    \"import/extensions\": \"off\",\r\n    \"import/no-unresolved\": \"off\",\r\n    \"import/no-named-as-default\": \"off\",\r\n    \"import/no-named-as-default-member\": \"off\",\r\n    \"import/prefer-default-export\": \"off\",\r\n    \"react/default-props-match-prop-types\": \"off\",\r\n    \"react/forbid-prop-types\": \"off\",\r\n    \"react/jsx-closing-tag-location\": \"off\",\r\n    \"react/jsx-filename-extension\": \"off\",\r\n    \"react/no-string-refs\": \"off\",\r\n    \"react/no-unused-prop-types\": \"off\",\r\n    \"react/no-unused-state\": \"off\",\r\n    \"react/prefer-stateless-function\": \"off\",\r\n    \"react/prop-types\": \"off\",\r\n    \"react/require-default-props\": \"off\",\r\n    \"react/sort-comp\": \"off\",\r\n    \"max-len\": \"off\",\r\n    \"no-case-declarations\": \"off\",\r\n    \"no-console\": \"off\",\r\n    \"no-mixed-operators\": \"off\",\r\n    \"no-nested-ternary\": \"off\",\r\n    \"no-shadow\": \"off\",\r\n    \"no-use-before-define\": \"off\",\r\n    \"no-underscore-dangle\": \"off\",\r\n    \"no-unused-expressions\": \"off\",\r\n    \"prefer-promise-reject-errors\": \"off\"\r\n  },\r\n  \"env\": {\r\n    \"jest\": true\r\n  },\r\n  \"globals\": {\r\n    \"fetch\": false,\r\n    \"Response\": false,\r\n    \"React\": true\r\n  }\r\n}\r\n\r\n```\r\n\r\nI am using these versions in package.json:\r\ndevDependencies\r\n```\r\n      \"eslint-config-airbnb\": \"16.1.0\",\r\n      \"eslint-plugin-babel\": \"^5.1.0\",\r\n      \"eslint-plugin-flowtype\": \"^2.46.1\",\r\n      \"eslint-plugin-react\": \"^7.9.1\",\r\n```\r\ndependencies\r\n\r\n>       \"react\": \"16.0.0\",\r\n>       \"react-native\": \"0.50.4\",\r\n"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/446782004","html_url":"https://github.com/eslint/eslint/issues/11183#issuecomment-446782004","issue_url":"https://api.github.com/repos/eslint/eslint/issues/11183","id":446782004,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njc4MjAwNA==","user":{"login":"platinumazure","id":284282,"node_id":"MDQ6VXNlcjI4NDI4Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/284282?v=4","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":"2018-12-12T23:22:30Z","updated_at":"2018-12-12T23:22:30Z","author_association":"MEMBER","body":"My apologies, I didn't realize you were running an npm script. Adding just `--debug` to an npm script results in npm's debug logs being visible, rather than ESLint's.\r\n\r\nCould you try running the script with `-- --debug` on the end? This ensures the `--debug` parameter is passed to ESLint rather than consumed by npm. Thanks!"}}
{"actor":{"display_login":"platinumazure"}}