TS CONFIG

Run Settings
LanguageJavaScript
Language Version
Run Command
// tsc app.ts : make changes then run this command then it will generate .js file for the same and at last give output now issue with this is we need // to run this command every time. And if we don't want to do that then we can simply use -w at last of command tsc app.ts -w now compiler with watch // any changes happening in app.ts and will run automatically. // tsc --init :: so this will create tsconfig.json where we can manage all the config of typescript // exclude : [] => in this array you can pass all the files name that we don't won't to compile just need to write down the name of file. // like exclude : ["analytics.ts"] also you can do like this ['*.dev.js'] now compiler won't compile all files that starts with .dev // There is also option files : [] where you can only specify the name of files. // target : where you can specify the target in each version .ts files going to get compile. options like ES6 ES5 // lib : See we are writting code in typescript now how ts will know that we have let const or some button methods or map any of this so that because of // lib option in this by default if we don't set any config then we have few default once . ["map","dom","scripthost",dom.iterable] these are the // defaults option we have. BUT IN SHORT BECAUSE OF LIBS OPTION ONLY TS CAN UNDERSTAND THAT BUTTON HAS THIS METHODS AND LET AND CONST EVERYTHING. // if you remove comment from this option and just leave blank array and then try to run program it will fail. // allowjs (true) : if you want to compile js. files also // checkjs (true) : if you don't want to compile check.js but just wanted to check possibles error then make this as true // sourceMap : ONE OF THE MOST IMPORTANT PROPERTIES THAT CAN BE VERY USEFULL. IN NORMAL CASE IF YOU TRY TO DEBUG CODE IN CROME FILE IT WILL SHOW // CODE IN JS BUT WHAT IF WE WANTED TO DUBUG TS CODE AND FOR THAT WE CAN SET sourceMap TO TRUE AND THEN IT WILL GENERATE THE .map FILE AT THE // TIME OF COMPILATION WHICH WILL UNDERSTANDANLE BY MORDEN BROWSER AND THEN IN BROWSER WE WILL BE ABLE TO SEE .TS FILES ALSO. // outdir : where yo want to place your .js out put files. // rootdir : If you want to compile only specific folder then we can simply specifiy the path of that folder here. // SO IN SIMPLE WORD BOTH OF ABOVE PROPERTIES ARE USEFUL IN CASE WHERE YOU WANT TO SPECIFY THE OUTPUT OR INPUT. // removeComments : to remove comments at the time of compilation fo in js file we don't have any comments. // noEmmitOnError : This is usefull when you don't want to generate the .js files if we get any error in .ts file at the time of compilation // strict : No much understanding but always put it as true because if this single one is true then all the below strict properties will be true // Additional Check regarding code checks : So there are few properties that you can use for code check like if there are some unusedVariables then // ts will warn you if there are some unused params then ts will warn you and at last if there are is function that return only on specific codition // then also we will get warning. MAKE SURE YOU DON'T GET ERROR YOU GET WARNING. // WRITE DONE ALL ES6 FEATURES THAT ARE SUPPORTED IN TS // CONST AND LET (GOOD UNDERSTANDING) // ARROW FUNCTION GOOD UNDERSTANDING) // DEFAULT PARAMETERS : (GOOD UNDERSTANING) // SPREAD OPERATETRS : [...arr] (For array you have to use like this) {...obj} (for object you have to use like this) // Object spread oprater are mainly use use to copy the objects // Array spread operater i mainly used to concat the multiple arrays. // SIMPLE EXAMPLE OF DEFAULT PARAMTERS : // function add (n1 : number=10){ // if(n1) return n1 // } // add() // this will work fine even if we don't pass the value because we already have default values in parameters. // REST PARAMETERS : THIS IS VERY SIMPLE BUT IN TIME OF INTERVIEW I ALWAYS FORGET NAME OF THIS AND THIS IS USEFUL WHEN // WE DON'T HAVE IDEA OF HOW MANY ARGUMENT WE GONE HAVE IN METHOD AT THAT TIME IN PARAMETERS WE CAN USE REST OPERATORS. // EXAMPLE OF REST OPERATORS : // function params (...params : number[]){ // params.map(item => console.log(item)) // } // params(10,13,12,18,199,921) // Array and Object destrucuring (Good Understanind)
Editor Settings
Theme
Key bindings
Full width
Lines