{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/create-react-app/issues/5677","repository_url":"https://api.github.com/repos/facebook/create-react-app","labels_url":"https://api.github.com/repos/facebook/create-react-app/issues/5677/labels{/name}","comments_url":"https://api.github.com/repos/facebook/create-react-app/issues/5677/comments","events_url":"https://api.github.com/repos/facebook/create-react-app/issues/5677/events","html_url":"https://github.com/facebook/create-react-app/issues/5677","id":376601260,"node_id":"MDU6SXNzdWUzNzY2MDEyNjA=","number":5677,"title":"CSS Modules with TypeScript: css-modules-typescript-loader","user":{"login":"jedmao","id":1058243,"node_id":"MDQ6VXNlcjEwNTgyNDM=","avatar_url":"https://avatars2.githubusercontent.com/u/1058243?v=4","gravatar_id":"","url":"https://api.github.com/users/jedmao","html_url":"https://github.com/jedmao","followers_url":"https://api.github.com/users/jedmao/followers","following_url":"https://api.github.com/users/jedmao/following{/other_user}","gists_url":"https://api.github.com/users/jedmao/gists{/gist_id}","starred_url":"https://api.github.com/users/jedmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedmao/subscriptions","organizations_url":"https://api.github.com/users/jedmao/orgs","repos_url":"https://api.github.com/users/jedmao/repos","events_url":"https://api.github.com/users/jedmao/events{/privacy}","received_events_url":"https://api.github.com/users/jedmao/received_events","type":"User","site_admin":false},"labels":[{"id":411265157,"node_id":"MDU6TGFiZWw0MTEyNjUxNTc=","url":"https://api.github.com/repos/facebook/create-react-app/labels/issue:%20proposal","name":"issue: proposal","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/facebook/create-react-app/milestones/58","html_url":"https://github.com/facebook/create-react-app/milestone/58","labels_url":"https://api.github.com/repos/facebook/create-react-app/milestones/58/labels","id":3778574,"node_id":"MDk6TWlsZXN0b25lMzc3ODU3NA==","number":58,"title":"3.0","description":"","creator":{"login":"Timer","id":616428,"node_id":"MDQ6VXNlcjYxNjQyOA==","avatar_url":"https://avatars1.githubusercontent.com/u/616428?v=4","gravatar_id":"","url":"https://api.github.com/users/Timer","html_url":"https://github.com/Timer","followers_url":"https://api.github.com/users/Timer/followers","following_url":"https://api.github.com/users/Timer/following{/other_user}","gists_url":"https://api.github.com/users/Timer/gists{/gist_id}","starred_url":"https://api.github.com/users/Timer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timer/subscriptions","organizations_url":"https://api.github.com/users/Timer/orgs","repos_url":"https://api.github.com/users/Timer/repos","events_url":"https://api.github.com/users/Timer/events{/privacy}","received_events_url":"https://api.github.com/users/Timer/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":2,"state":"open","created_at":"2018-10-29T19:21:25Z","updated_at":"2018-11-17T17:05:38Z","due_on":null,"closed_at":null},"comments":35,"created_at":"2018-11-01T22:51:45Z","updated_at":"2018-11-21T16:22:49Z","closed_at":null,"author_association":"NONE","body":"TypeScript users are flying blind when they import a CSS module. For example, if they type `styles.foo` they have no idea if `.foo` actually exists in the CSS module without manually checking the file.\r\n\r\n_**This is not a great TypeScript experience.**_\r\n\r\nI propose adding the [`css-modules-typescript-loader`](https://www.npmjs.com/package/css-modules-typescript-loader) (or something similar) to emit type declarations for CSS modules on the fly.\r\n\r\nIt could be as simple as this:\r\n\r\n```js\r\n  const loaders = [\r\n    require.resolve('style-loader'),\r\n    ...(useTypeScript && cssOptions.modules\r\n      ? require.resolve('css-modules-typescript-loader')\r\n      : []\r\n    ),\r\n```\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/facebook/create-react-app/issues/comments/440726069","html_url":"https://github.com/facebook/create-react-app/issues/5677#issuecomment-440726069","issue_url":"https://api.github.com/repos/facebook/create-react-app/issues/5677","id":440726069,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDcyNjA2OQ==","user":{"login":"jedmao","id":1058243,"node_id":"MDQ6VXNlcjEwNTgyNDM=","avatar_url":"https://avatars2.githubusercontent.com/u/1058243?v=4","gravatar_id":"","url":"https://api.github.com/users/jedmao","html_url":"https://github.com/jedmao","followers_url":"https://api.github.com/users/jedmao/followers","following_url":"https://api.github.com/users/jedmao/following{/other_user}","gists_url":"https://api.github.com/users/jedmao/gists{/gist_id}","starred_url":"https://api.github.com/users/jedmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedmao/subscriptions","organizations_url":"https://api.github.com/users/jedmao/orgs","repos_url":"https://api.github.com/users/jedmao/repos","events_url":"https://api.github.com/users/jedmao/events{/privacy}","received_events_url":"https://api.github.com/users/jedmao/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T16:22:49Z","updated_at":"2018-11-21T16:22:49Z","author_association":"NONE","body":"@mrmckeb I'm not sure it has to be available at root, so long as it's listed in `react-scripts/package.json` and then in webpack.config.js. See how [the `style-loader` is imported here](https://github.com/facebook/create-react-app/blob/fb465a39e576bde26aab5e91824a1fde78daeb10/packages/react-scripts/config/webpack.config.js#L81).\r\n\r\nI'm afraid I can't help more than that. I'm not that intimately familiar w/ this project."}}
{"actor":{"display_login":"jedmao"}}