Cov txheej txheem:

Kuv ntaus TypeScript hauv Visual Studio code li cas?
Kuv ntaus TypeScript hauv Visual Studio code li cas?

Video: Kuv ntaus TypeScript hauv Visual Studio code li cas?

Video: Kuv ntaus TypeScript hauv Visual Studio code li cas?
Video: Kuv ntaus niam tais vim nws cob kuv poj niam 6/5/2022 2024, Hlis ntuj nqeg
Anonim

Hloov TypeScript rau hauv JavaScript

  1. Kauj ruam 1: Tsim ib daim ntawv TS yooj yim. Qhib VS Code ntawm ib daim nplaub tshev khoob thiab tsim lub helloworld.
  2. Kauj ruam 2: Khiav lub TypeScript tsim. Khiav Tsim Ua Haujlwm (Ctrl + Ua haujlwm + B) los ntawm lub ntiaj teb Terminal ntawv qhia zaub mov.
  3. Kauj ruam 3: Ua tus TypeScript Tsim lub neej ntawd.
  4. Kauj Ruam 4: Tshawb xyuas cov teeb meem tsim.

Ib yam li ntawd, koj tuaj yeem nug, koj yuav hloov kho TypeScript li cas hauv Visual Studio code?

Hloov lub zos TypeScript version

  1. Qhib qhov project hauv VS Code.
  2. Nruab qhov xav tau TypeScript version hauv zos, piv txwv li npm nruab --save-dev [email tiv thaiv]
  3. Qhib VS Code Workspace Chaw (F1> Qhib Chaw Ua Haujlwm Chaw)
  4. Hloov tshiab/Insert "typescript.tsdk": "./node_modules/typescript/lib"

Ib sab saum toj no, Kuv yuav teeb tsa TypeScript li cas? Thawj rau cov kauj ruam yog tib yam hauv peb txoj hauv kev, yog li cia peb pib!

  1. Kauj ruam 1: Nruab Node. js/npm.
  2. Kauj ruam 2: Nruab Visual Studio Code los yog lwm yam editor.
  3. Kauj ruam 3: Teeb pob.
  4. Kauj ruam 4: Nruab Typescript.
  5. Kauj ruam 5: Nruab React lossis Preact.
  6. Kauj Ruam 6: Sau qee qhov React code.

Ib sab ntawm no, kuv yuav ua li cas rau nruab TypeScript hauv Visual Studio?

Teem TypeScript versions hauv Visual Studio 2017 version 15.3

  1. Txoj nyem rau ntawm qhov project node hauv Solution Explorer.
  2. Nyem Properties.
  3. Mus rau TypeScript Tsim tab.
  4. Hloov TypeScript version mus rau qhov xav tau version lossis "siv qhov muaj tam sim no" kom ib txwm ua raws li qhov tshiab tshaj plaws.

ESLint siv rau dab tsi?

ESLint yog qhov qhib JavaScript linting utility thawj zaug tsim los ntawm Nicholas C. Zakas thaum Lub Rau Hli 2013. Code linting yog ib hom kev tshuaj xyuas zoo li qub uas nquag siv txhawm rau nrhiav cov qauv teeb meem lossis cov cai uas tsis ua raws li qee qhov kev cai style.

Pom zoo: