🐶
blog.terrier.dev

posted: 2018/08/13

VSCode + styled-components + typescriptでうまく補完が効かないと思ったら


なんだか上記の組み合わせで補完がうまくいってないと思ったら、どうやらworkspaceのtypescriptを利用する場合、下記を入れる必要があるっぽい
https://github.com/Microsoft/typescript-styled-plugin
(ということがUsageをよく読んだら書いてた)
これ自体はVSCodeのプラグインと言うよりtypescriptのプラグインにあたるらしい
ということでnpmでインストール
npm install --save-dev typescript-styled-plugin typescript
そしてtsconfig.jsonに下記を追記する
{
  "compilerOptions": {
    "plugins": [
      {
        "name": "typescript-styled-plugin"
      }
    ]
  }
}

Edit on Github
@terrierscript