{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/2446","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/2446/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/2446/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/2446/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/2446","id":265332792,"node_id":"MDU6SXNzdWUyNjUzMzI3OTI=","number":2446,"title":"Custom ESLint rules","user":{"login":"monsieurnebo","id":2378274,"node_id":"MDQ6VXNlcjIzNzgyNzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2378274?v=4","gravatar_id":"","url":"https://api.github.com/users/monsieurnebo","html_url":"https://github.com/monsieurnebo","followers_url":"https://api.github.com/users/monsieurnebo/followers","following_url":"https://api.github.com/users/monsieurnebo/following{/other_user}","gists_url":"https://api.github.com/users/monsieurnebo/gists{/gist_id}","starred_url":"https://api.github.com/users/monsieurnebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monsieurnebo/subscriptions","organizations_url":"https://api.github.com/users/monsieurnebo/orgs","repos_url":"https://api.github.com/users/monsieurnebo/repos","events_url":"https://api.github.com/users/monsieurnebo/events{/privacy}","received_events_url":"https://api.github.com/users/monsieurnebo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-10-13T15:39:21Z","updated_at":"2018-09-20T22:41:40Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"# Environment\r\n\r\nProduct | Version\r\n--- | ---\r\nGatsby version | 1.9.55\r\nNodeJS | 8.5.0\r\nmacOS | 10.11.6\r\n\r\n\r\n# The problem\r\n## Context\r\nHi folks,\r\n\r\nI got a generic ESLint configuration for `ReactJS` based projects that I'm using on a Gatsby-based project.\r\n\r\n**ESLint** has no clue about Gatsby's webpack existence and fires some false-positives because of three main issues:\r\n- No extension resolving (e.g. `.jsx`)  causing `import/no-unresolved` errors\r\n- No alias  resolving (e.g. `/helpers/`) causing `import/no-unresolved` errors\r\n- Loading `gatsby-plugin-...` version of plugins (e.g. `styled-components`), but importing `original-plugin` in the project causing `no-extraneous-dependencies` errors\r\n\r\n\r\n## gatsby-node.js\r\n```js\r\nconst path = require(\"path\");\r\nconst pathRoot = (...args) => path.resolve(__dirname, ...args);\r\n\r\nexports.modifyWebpackConfig = ({ config, stage }) => {\r\n\r\n  config.merge({\r\n    resolve: {\r\n      extensions  : [\".js\", \".jsx\"],\r\n      alias       : {\r\n        config  : pathRoot(\"config\"),\r\n        helpers : pathRoot(\"src\", \"helpers\"),\r\n        shared  : pathRoot(\"src\", \"shared\")\r\n      }\r\n    }\r\n  });\r\n\r\n  return config;\r\n\r\n};\r\n```\r\n\r\n## Ugly fix\r\nWe can fix the third issue by declaring `core-modules` like that (not so clean & difficult to maintain):\r\n```js\r\n\"import/core-modules\": [\r\n      \"react\",\r\n      \"prop-types\",\r\n      \"react-helmet\",\r\n      \"styled-components\"\r\n    ],\r\n```\r\n\r\nThe two other rules are temporary (?) disabled...\r\n\r\n**--> Is there any clean solution (other than [this](https://github.com/gatsbyjs/gatsby/issues/362#issuecomment-321570571)) ?**\r\n\r\n---\r\n# Related to\r\ngatsbyjs/gatsby#463\r\ngatsbyjs/gatsby#1990\r\ngatsbyjs/gatsby#362"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/423357529","html_url":"https://github.com/gatsbyjs/gatsby/issues/2446#issuecomment-423357529","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/2446","id":423357529,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzM1NzUyOQ==","user":{"login":"brandonkal","id":4714862,"node_id":"MDQ6VXNlcjQ3MTQ4NjI=","avatar_url":"https://avatars3.githubusercontent.com/u/4714862?v=4","gravatar_id":"","url":"https://api.github.com/users/brandonkal","html_url":"https://github.com/brandonkal","followers_url":"https://api.github.com/users/brandonkal/followers","following_url":"https://api.github.com/users/brandonkal/following{/other_user}","gists_url":"https://api.github.com/users/brandonkal/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonkal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonkal/subscriptions","organizations_url":"https://api.github.com/users/brandonkal/orgs","repos_url":"https://api.github.com/users/brandonkal/repos","events_url":"https://api.github.com/users/brandonkal/events{/privacy}","received_events_url":"https://api.github.com/users/brandonkal/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T22:41:40Z","updated_at":"2018-09-20T22:41:40Z","author_association":"NONE","body":"For what it is worth, I created this for linting my own projects: https://www.npmjs.com/package/eslint-config-gatsby-standard"}}
{"actor":{"display_login":"brandonkal"}}