{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24666","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24666/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24666/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24666/events","html_url":"https://github.com/Microsoft/TypeScript/issues/24666","id":329213854,"node_id":"MDU6SXNzdWUzMjkyMTM4NTQ=","number":24666,"title":"Declarations and \"Exported variable 'XXX' has or is using name 'YYY' from external module \"ZZZ\" but cannot be named.\"","user":{"login":"jamiewinder","id":4442179,"node_id":"MDQ6VXNlcjQ0NDIxNzk=","avatar_url":"https://avatars3.githubusercontent.com/u/4442179?v=4","gravatar_id":"","url":"https://api.github.com/users/jamiewinder","html_url":"https://github.com/jamiewinder","followers_url":"https://api.github.com/users/jamiewinder/followers","following_url":"https://api.github.com/users/jamiewinder/following{/other_user}","gists_url":"https://api.github.com/users/jamiewinder/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiewinder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiewinder/subscriptions","organizations_url":"https://api.github.com/users/jamiewinder/orgs","repos_url":"https://api.github.com/users/jamiewinder/repos","events_url":"https://api.github.com/users/jamiewinder/events{/privacy}","received_events_url":"https://api.github.com/users/jamiewinder/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"node_id":"MDU6TGFiZWwxMTM5NzAzNjY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":670961382,"node_id":"MDU6TGFiZWw2NzA5NjEzODI=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Domain:%20Declaration%20Emit","name":"Domain: Declaration Emit","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":{"login":"weswigham","id":2932786,"node_id":"MDQ6VXNlcjI5MzI3ODY=","avatar_url":"https://avatars3.githubusercontent.com/u/2932786?v=4","gravatar_id":"","url":"https://api.github.com/users/weswigham","html_url":"https://github.com/weswigham","followers_url":"https://api.github.com/users/weswigham/followers","following_url":"https://api.github.com/users/weswigham/following{/other_user}","gists_url":"https://api.github.com/users/weswigham/gists{/gist_id}","starred_url":"https://api.github.com/users/weswigham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weswigham/subscriptions","organizations_url":"https://api.github.com/users/weswigham/orgs","repos_url":"https://api.github.com/users/weswigham/repos","events_url":"https://api.github.com/users/weswigham/events{/privacy}","received_events_url":"https://api.github.com/users/weswigham/received_events","type":"User","site_admin":false},"assignees":[{"login":"weswigham","id":2932786,"node_id":"MDQ6VXNlcjI5MzI3ODY=","avatar_url":"https://avatars3.githubusercontent.com/u/2932786?v=4","gravatar_id":"","url":"https://api.github.com/users/weswigham","html_url":"https://github.com/weswigham","followers_url":"https://api.github.com/users/weswigham/followers","following_url":"https://api.github.com/users/weswigham/following{/other_user}","gists_url":"https://api.github.com/users/weswigham/gists{/gist_id}","starred_url":"https://api.github.com/users/weswigham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weswigham/subscriptions","organizations_url":"https://api.github.com/users/weswigham/orgs","repos_url":"https://api.github.com/users/weswigham/repos","events_url":"https://api.github.com/users/weswigham/events{/privacy}","received_events_url":"https://api.github.com/users/weswigham/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/74","html_url":"https://github.com/Microsoft/TypeScript/milestone/74","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/74/labels","id":3468190,"node_id":"MDk6TWlsZXN0b25lMzQ2ODE5MA==","number":74,"title":"TypeScript 3.1","description":"","creator":{"login":"mhegazy","id":8000722,"node_id":"MDQ6VXNlcjgwMDA3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":122,"closed_issues":1,"state":"open","created_at":"2018-07-02T19:25:46Z","updated_at":"2018-07-05T23:00:08Z","due_on":"2018-09-17T07:00:00Z","closed_at":null},"comments":5,"created_at":"2018-06-04T20:56:43Z","updated_at":"2018-07-05T23:00:08Z","closed_at":"2018-07-05T23:00:08Z","author_association":"NONE","body":"I was pleased to see #9944 had been closed with what looked like a feature of 2.9 'fixing' the issue. However, it still doesn't seem to be working as I'd expect. Take this example:\r\n\r\n```typescript\r\nimport styled from \"styled-components\";\r\n\r\nexport const Container = styled.div`\r\n    background: red;\r\n`;\r\n```\r\nWith a normal TypeScript project, using the tsconfig default except enabling `declarations`. I get three errors:\r\n```\r\nsrc/styles.ts(3,14): error TS4023: Exported variable 'Container' has or is using name 'React.ClassAttributes' from external module \"/node_modules/@types/react/index\" but cannot be named.\r\nsrc/styles.ts(3,14): error TS4023: Exported variable 'Container' has or is using name 'React.HTMLAttributes' from external module \"/node_modules/@types/react/index\" but cannot be named.\r\nsrc/styles.ts(3,14): error TS4023: Exported variable 'Container' has or is using name 'StyledComponentClass' from external module \"/node_modules/styled-components/typings/styled-components\" but cannot be named.\r\n```\r\nThe obvious solution seems to be importing the types involved:\r\n```typescript\r\nimport styled, { StyledComponentClass } from \"styled-components\";\r\nimport * as React from \"react\";\r\n\r\nexport const Container = styled.div`\r\n    background: red;\r\n`;\r\n```\r\nWhich *would* be fine, I suppose (though I don't see why it is necessary..?) but this doesn't work with `noUnusedLocals` as you get more errors:\r\n```\r\nsrc/styles.ts(1,18): error TS6133: 'StyledComponentClass' is declared but its value is never read.\r\nsrc/styles.ts(2,13): error TS6133: 'React' is declared but its value is never read.\r\n```\r\n\r\n... However you can work around *that* by explicitly using the types, but even with this basic example it gets absurdly verbose:\r\n```typescript\r\nimport styled, { StyledComponentClass } from \"styled-components\";\r\nimport * as React from 'react';\r\n\r\nexport const Container: StyledComponentClass<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, any, React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>> = styled.div`\r\n    background: red;\r\n`;\r\n```\r\nWhat is the recommended solution / workaround to this? "}}
{"actor":{"display_login":"weswigham"}}