sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to setup the typescript-styled-plugin

predragnikolic opened this issue · comments

This is a guide on how to setup the typescript-styled-plugin.

The best is to follow the installation instructions on https://github.com/microsoft/typescript-styled-plugin.


  1. In terminal run:
npm install --save-dev typescript-styled-plugin typescript
npm install --save styled-components  
npm i --save-dev @types/styled-components
  1. The tsconfig.json file should include this plugin:
{
  "compilerOptions": {
    "plugins": [
      {
        "name": "typescript-styled-plugin",
        "tags": [
          "styled",
          "mytag"
        ]
      }
    ]
  }
}
  1. Optionally configure the tags array.

Create a index.ts file:

import styled from 'styled-components'

styled.button`
    color: blue;
    background: red; 
`

And that is it.
2022-09-04-134230_1920x1200_scrot

example.zip

I wonder if we should enable and put it in Wiki or Discussions.