<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Barin Britva</title>
    <description>The latest articles on DEV Community by Barin Britva (@barinbritva).</description>
    <link>https://dev.to/barinbritva</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F424418%2F65b7123c-20b5-48b6-95d8-b602c6ab5f6c.jpg</url>
      <title>DEV Community: Barin Britva</title>
      <link>https://dev.to/barinbritva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/barinbritva"/>
    <language>en</language>
    <item>
      <title>TypeScript: Sorting out tsconfig. Part 2</title>
      <dc:creator>Barin Britva</dc:creator>
      <pubDate>Thu, 12 Aug 2021 11:07:03 +0000</pubDate>
      <link>https://dev.to/barinbritva/typescript-sorting-out-tsconfig-part-2-5hm0</link>
      <guid>https://dev.to/barinbritva/typescript-sorting-out-tsconfig-part-2-5hm0</guid>
      <description>&lt;h1&gt;
  
  
  TypeScript: Sorting out &lt;code&gt;tsconfig&lt;/code&gt;. Part 2
&lt;/h1&gt;

&lt;p&gt;In &lt;a href="https://dev.to/barinbritva/typescript-spelling-out-tsconfig-part-1-3nak"&gt;the previous article&lt;/a&gt;, I covered a number of quirks in TypeScript’s general settings. This one is about the so-called “strictness flags.”&lt;/p&gt;

&lt;p&gt;Out of the box, TypeScript is not very different from JavaScript. Unless you tune the project config from the start, most of the language’s advantages never come into play. There is some point in using TypeScript that way, but not much.&lt;/p&gt;

&lt;p&gt;If I had to reduce this entire article to one sentence, it would be this: open &lt;code&gt;tsconfig.json&lt;/code&gt; and set &lt;code&gt;strict&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; under &lt;code&gt;compilerOptions&lt;/code&gt;. Without strict mode, TypeScript is almost a waste of time. Still, neither the previous article nor this one is meant to tell you the one “right” way to do things. The goal is to clarify the finer points of configuration. So let’s get into it.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://www.typescriptlang.org/tsconfig" rel="noopener noreferrer"&gt;official &lt;code&gt;tsconfig.json&lt;/code&gt; reference&lt;/a&gt;, its many options are split into sections. Two of them, &lt;code&gt;Strict Checks&lt;/code&gt; and &lt;code&gt;Linter Checks&lt;/code&gt;, contain only strictness flags. A few more flags relevant today are tucked away in the largest option group: &lt;code&gt;Advanced&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;Strict Checks&lt;/code&gt; group
&lt;/h2&gt;

&lt;p&gt;These are probably the most important flags of the lot: &lt;code&gt;strict&lt;/code&gt;, &lt;code&gt;alwaysStrict&lt;/code&gt;, &lt;code&gt;noImplicitAny&lt;/code&gt;, &lt;code&gt;strictNullChecks&lt;/code&gt;, &lt;code&gt;strictFunctionTypes&lt;/code&gt;, &lt;code&gt;strictPropertyInitialization&lt;/code&gt;, &lt;code&gt;noImplicitThis&lt;/code&gt;, and &lt;code&gt;strictBindCallApply&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Every flag above defaults to &lt;code&gt;false&lt;/code&gt;. To make things strict, set it to the opposite value: &lt;code&gt;true&lt;/code&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Looking at the list, the similarly named &lt;code&gt;strict&lt;/code&gt; and &lt;code&gt;alwaysStrict&lt;/code&gt; flags can be confusing. In reality, they do completely different jobs.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;alwaysStrict&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: easy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alwaysStrict&lt;/code&gt; adds the &lt;code&gt;"use strict"&lt;/code&gt; directive to every compiled file. In other words, it enables &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode" rel="noopener noreferrer"&gt;JavaScript strict mode&lt;/a&gt;. It has nothing to do with TypeScript type checking.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;strict&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: hard / can be replaced by a set of other flags.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;strict&lt;/code&gt; is directly related to type checking. Enabling it automatically turns on every flag in &lt;code&gt;Strict Checks&lt;/code&gt;, including &lt;code&gt;alwaysStrict&lt;/code&gt;. That is exactly what I was talking about at the beginning.&lt;/p&gt;

&lt;p&gt;This approach has at least one downside: it is opaque. When you set &lt;code&gt;strict: true&lt;/code&gt;, you cannot immediately see exactly which checks are enabled or which options exist at all. For projects written in TypeScript from day one, this matters less than it does for projects being migrated gradually from JavaScript.&lt;/p&gt;

&lt;p&gt;When migrating an existing application, you cannot switch on every check at once. You have to enable them one by one, step by step. Sometimes problems even force you to roll previously enabled flags back to &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There is one small detail about &lt;code&gt;strict&lt;/code&gt;: its controlled list of flags can grow as new TypeScript versions are released. That does not happen often, and it is always covered in the release notes, assuming that you read them before updating.&lt;/p&gt;

&lt;p&gt;Personally, I prefer to list the flags explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"alwaysStrict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitAny"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictNullChecks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictPropertyInitialization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictFunctionTypes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitThis"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictBindCallApply"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s look at what each flag does, and discuss which ones to enable first if turning them all on at once is not an option.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noImplicitAny&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: medium.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the first flag you should enable when starting a TypeScript project.&lt;/p&gt;

&lt;p&gt;First, a word about &lt;a href="https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any" rel="noopener noreferrer"&gt;&lt;code&gt;any&lt;/code&gt;&lt;/a&gt;. It is a special type assigned to every variable whose type was not stated explicitly and cannot be inferred automatically by the compiler. It exists for JavaScript compatibility. From TypeScript’s point of view, every JavaScript variable is &lt;code&gt;any&lt;/code&gt;, because JavaScript has no type system.&lt;/p&gt;

&lt;p&gt;To the compiler, &lt;code&gt;any&lt;/code&gt; means: “This can be anything. I am handing control and responsibility to the developer.” Because it does not know the variable’s type, you can do absolutely anything with such a variable. This is where TypeScript loses all of its power:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// type stated explicitly&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="c1"&gt;// type inferred&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="c1"&gt;// type is not stated and cannot be inferred&lt;/span&gt;
&lt;span class="c1"&gt;// value will be implicitly declared as any&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// so the error on this line goes unnoticed&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subtr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put differently, if a variable’s type is unknown, it is &lt;code&gt;any&lt;/code&gt;. If it is &lt;code&gt;any&lt;/code&gt;, this is JavaScript rather than TypeScript code. So the number of unspecified types in a codebase is a real measure of the ratio between its TypeScript and JavaScript. &lt;code&gt;noImplicitAny&lt;/code&gt; highlights every such spot so the developer does not forget to state types.&lt;/p&gt;

&lt;p&gt;That does not mean you can no longer use &lt;code&gt;any&lt;/code&gt; at all. It only means that in such cases the developer must write &lt;code&gt;any&lt;/code&gt; explicitly if, for some reason, the variable cannot be typed correctly, or if typing it causes errors elsewhere in the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// explicitly mark code as potentially unsafe with any&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subtr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An explicit &lt;code&gt;any&lt;/code&gt; reminds the developer that this code is unfinished and that these places need improvement over time. That is the point of &lt;code&gt;noImplicitAny&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can reinforce this with ESLint’s &lt;a href="https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md" rel="noopener noreferrer"&gt;&lt;code&gt;no-explicit-any&lt;/code&gt;&lt;/a&gt; rule. It marks uses of &lt;code&gt;any&lt;/code&gt; as warnings, drawing a developer’s attention to them every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;strictNullChecks&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: medium.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag enables one of TypeScript’s most powerful features. I recommend turning it on immediately after &lt;code&gt;noImplicitAny&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;JavaScript has two bottom values, &lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt;, and TypeScript has types with the same names. In the type hierarchy, every other type is considered to derive from them. By inheritance, a value of &lt;code&gt;undefined&lt;/code&gt; or &lt;code&gt;null&lt;/code&gt; can be passed in place of a variable of any type: &lt;code&gt;string&lt;/code&gt;, &lt;code&gt;boolean&lt;/code&gt;, &lt;code&gt;number&lt;/code&gt;, and so on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// may produce an unexpected result if value is undefined or null&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// this is allowed by default&lt;/span&gt;
&lt;span class="nf"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// and so is this&lt;/span&gt;
&lt;span class="nf"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This behavior is true of most, if not all, programming languages. In practice, it can be inconvenient because it requires extra &lt;code&gt;null&lt;/code&gt;/&lt;code&gt;undefined&lt;/code&gt; checks. The much bigger problem is remembering that your code needs those checks. Java developers, with their &lt;a href="https://careerkarma.com/blog/java-null-pointer-exception/" rel="noopener noreferrer"&gt;NullPointerException&lt;/a&gt;, understand this better than anyone.&lt;/p&gt;

&lt;p&gt;Enabling &lt;code&gt;strictNullChecks&lt;/code&gt; changes the rules of the game. With it on, the compiler no longer lets you pass &lt;code&gt;undefined&lt;/code&gt; or &lt;code&gt;null&lt;/code&gt; where another type is expected unless you explicitly allow it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// value will always be a number&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// the following function calls are not allowed&lt;/span&gt;
&lt;span class="nf"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means you do not have to handle &lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt; in code where those values cannot occur. Where they can occur, the compiler will not let you forget the checks. This is a powerful mechanism whose value is hard to overstate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// “?” permits undefined, and “| null” permits null&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is only one potentially dangerous point. Everything works perfectly in our statically typed code. But applications often work with dynamically received data, such as data from a server, whose declared types may not match reality at all. In other words, the types say a value cannot be &lt;code&gt;null&lt;/code&gt;, but the server sends it anyway. You can avoid this by making validation of server responses standard practice, for example with &lt;a href="https://github.com/sideway/joi" rel="noopener noreferrer"&gt;JSON Schema validators&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;External libraries can be a little more treacherous. In particular, libraries originally written in JavaScript whose typings are maintained separately from the code. In those cases, mismatches between the real code and its types can produce exactly the situation described above.&lt;/p&gt;

&lt;p&gt;Here is a compatibility table for types with &lt;code&gt;strictNullChecks&lt;/code&gt; on and off: &lt;a href="https://www.typescriptlang.org/docs/handbook/type-compatibility.html#any-unknown-object-void-undefined-null-and-never-assignability" rel="noopener noreferrer"&gt;&lt;code&gt;Any&lt;/code&gt;, &lt;code&gt;unknown&lt;/code&gt;, &lt;code&gt;object&lt;/code&gt;, &lt;code&gt;void&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;null&lt;/code&gt; and &lt;code&gt;never&lt;/code&gt; assignability&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;strictPropertyInitialization&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: easy / related to &lt;code&gt;strictNullChecks&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;strictPropertyInitialization&lt;/code&gt; ensures that declared class properties are always initialized:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="c1"&gt;// email is initialized neither here nor in the constructor&lt;/span&gt;
  &lt;span class="c1"&gt;// the compiler will tell us that a value must be set&lt;/span&gt;
  &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="nf"&gt;constructor &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;This option is a kind of companion to &lt;code&gt;strictNullChecks&lt;/code&gt;, so it works only when that flag is also enabled.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;strictFunctionTypes&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: easy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Setting &lt;code&gt;strictFunctionTypes: true&lt;/code&gt; enables stricter checking of function signatures. Overall, this option looks like an obvious must-have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;StringOrNumberFunc&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// the signatures do not match&lt;/span&gt;
&lt;span class="c1"&gt;// string | number is not equivalent to string&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;func&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;StringOrNumberFunc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;someFunction&lt;/span&gt;
&lt;span class="nf"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;10&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;noImplicitThis&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: easy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you use &lt;code&gt;this&lt;/code&gt;, this flag checks that the execution context is known. Consider this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeClass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;multiplier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
  &lt;span class="nf"&gt;createSomeFunction &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// context is lost: this is NOT a SomeClass instance here&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;multiplier&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;this&lt;/code&gt; object is unknown because &lt;code&gt;function&lt;/code&gt; does not pass the context through automatically. Here you can fix it by replacing &lt;code&gt;function&lt;/code&gt; with an arrow function.&lt;/p&gt;

&lt;p&gt;Consider a standalone function that, for some reason, must use an external &lt;code&gt;this&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sayHello&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;helloWord&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, too, &lt;code&gt;this&lt;/code&gt; is unknown. You can run a function with an external &lt;code&gt;this&lt;/code&gt; using &lt;code&gt;bind&lt;/code&gt;, &lt;code&gt;call&lt;/code&gt;, or &lt;code&gt;apply&lt;/code&gt;. You can teach the function about its context like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// state the this type as the first “argument”&lt;/span&gt;
&lt;span class="c1"&gt;// in practice, it is not counted as a function argument&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sayHello&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HelloStyle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;helloWord&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// declare greeting variants&lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;HelloStyle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;helloWord&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HawaiiStyle&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;HelloStyle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;helloWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Aloha&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RussianStyle&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;HelloStyle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;helloWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Привет,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// now call it&lt;/span&gt;
&lt;span class="nx"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HawaiiStyle&lt;/span&gt;&lt;span class="p"&gt;())(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RussianStyle&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RussianStyle&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In every case, the context type is known, and even editor type hints work as they should.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;strictBindCallApply&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: medium.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;strictBindCallApply&lt;/code&gt; enables stricter signature checks for the corresponding methods: &lt;code&gt;bind&lt;/code&gt;, &lt;code&gt;call&lt;/code&gt;, and &lt;code&gt;apply&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;10&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// yes, cases like this need a separate flag&lt;/span&gt;
&lt;span class="nx"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apart from a few specialized cases, this flag does not cause problems. If a difficult case does arise, I recommend disabling the check at the problem location with &lt;code&gt;// @ts-ignore&lt;/code&gt; rather than turning the rule off entirely.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Strict Checks&lt;/code&gt;: summary
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Every flag here really is useful. Together they let TypeScript reach its potential and deliver the most value.&lt;/li&gt;
&lt;li&gt;You can enable them all with &lt;code&gt;strict: true&lt;/code&gt;, or enable each one separately. The latter is ideal for mixed codebases where some code has not yet been converted to TypeScript.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alwaysStrict&lt;/code&gt; is not about TypeScript strict mode. It is about JavaScript strict mode, that is, &lt;code&gt;"use strict"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The top priorities are &lt;code&gt;noImplicitAny&lt;/code&gt; and &lt;code&gt;strictNullChecks&lt;/code&gt; together with &lt;code&gt;strictPropertyInitialization&lt;/code&gt;. Next come &lt;code&gt;strictFunctionTypes&lt;/code&gt; and &lt;code&gt;noImplicitThis&lt;/code&gt;. &lt;code&gt;strictBindCallApply&lt;/code&gt; comes last.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;Linter Checks&lt;/code&gt; group
&lt;/h2&gt;

&lt;p&gt;The name speaks for itself: these flags are meant to check code quality rather than type compatibility. They are rules of the same kind as ESLint’s. Some &lt;code&gt;Linter Checks&lt;/code&gt; rules can indeed be replaced with their ESLint equivalents. The full list is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noPropertyAccessFromIndexSignature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUncheckedIndexedAccess"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitReturns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noFallthroughCasesInSwitch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUnusedLocals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUnusedParameters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Every flag above defaults to &lt;code&gt;false&lt;/code&gt;. To make things strict, set it to the opposite value: &lt;code&gt;true&lt;/code&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I deliberately separated &lt;code&gt;noPropertyAccessFromIndexSignature&lt;/code&gt; and &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; from the other flags with a blank line. They are here only because conceptually they cannot live in &lt;code&gt;Strict Checks&lt;/code&gt;. That section is intended for flags controlled by &lt;code&gt;strict&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But these flags are too specific to enable by default. That is more or less what the announcements for &lt;a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-2-beta/#nopropertyaccessfromindexsignature" rel="noopener noreferrer"&gt;&lt;code&gt;noPropertyAccessFromIndexSignature&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-rc/#no-unchecked-indexed-access" rel="noopener noreferrer"&gt;&lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt;&lt;/a&gt; say. Still, that does not make them lint rules. They check types and really belong to &lt;code&gt;Strict Checks&lt;/code&gt;, but they are not enabled automatically by &lt;code&gt;strict&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The remaining flags are full citizens of this section and have analogous ESLint rules. There are a few temporary limitations, since not every rule has been moved from TSLint to ESLint yet. You can see the rule mappings in the &lt;a href="https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md" rel="noopener noreferrer"&gt;TSLint Migration Guide&lt;/a&gt; and the &lt;a href="https://github.com/buzinas/tslint-eslint-rules" rel="noopener noreferrer"&gt;ESLint rules for TSLint&lt;/a&gt; repository.&lt;/p&gt;

&lt;p&gt;Let’s look at each flag.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noPropertyAccessFromIndexSignature&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: easy / one caveat / cannot be replaced by a linter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;noPropertyAccessFromIndexSignature&lt;/code&gt; forbids accessing an object property with a dot, also known as &lt;a href="https://techstacker.com/what-is-dot-notation-javascript/" rel="noopener noreferrer"&gt;dot notation&lt;/a&gt;, when the property is not declared explicitly but through arbitrarily named properties (index signatures).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// explicitly declared properties&lt;/span&gt;
  &lt;span class="nl"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="c1"&gt;// arbitrary properties&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// with noPropertyAccessFromIndexSignature: true&lt;/span&gt;
&lt;span class="c1"&gt;// this line produces an error&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;
&lt;span class="c1"&gt;// but this access is still allowed&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;username2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of dot notation, we use &lt;a href="https://derekknox.com/articles/js-bracket-notation-practical-examples/" rel="noopener noreferrer"&gt;bracket notation&lt;/a&gt;. The idea is much the same as with &lt;code&gt;noImplicitAny&lt;/code&gt;: draw attention to potentially troublesome places.&lt;/p&gt;

&lt;p&gt;The only reason not to use this option is that you end up with two syntaxes for property access. In my view, that is not a problem. While the syntaxes differ, each has its purpose. Always use dot notation. If an exception comes up, switch to bracket notation. The result is safer code, so I recommend this flag.&lt;/p&gt;

&lt;p&gt;There is one more reason, but &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; addresses it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: case by case / difficulty: medium / serious caveat / related to &lt;code&gt;strictNullChecks&lt;/code&gt; / cannot be replaced by a linter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s look at the previous example again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// explicitly declared properties&lt;/span&gt;
  &lt;span class="nl"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="c1"&gt;// arbitrary properties&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// the username variable has type string&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see, &lt;code&gt;username&lt;/code&gt; has type &lt;code&gt;string&lt;/code&gt;. That is not quite right, since we can access any property, even one that does not exist. You could declare arbitrary fields as &lt;code&gt;[key: string]: string | undefined&lt;/code&gt;. That solves the problem, but creates manual work. Plus, people will occasionally forget to add &lt;code&gt;undefined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; does that work for us. The compiler will no longer let you use a variable obtained this way without checking it first.&lt;/p&gt;

&lt;p&gt;Here is another example, this time with an array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;// here, number will have type string&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Obviously, the variable is &lt;code&gt;undefined&lt;/code&gt; here. With &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; enabled, its type in cases like this becomes &lt;code&gt;string | undefined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It seems perfect: bracket notation marks the object’s “magic” properties. We can use them only after checking for &lt;code&gt;undefined&lt;/code&gt;. Everything is safe. What could go wrong?&lt;/p&gt;

&lt;p&gt;In short:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;// here too, number will have type string | undefined&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;upperCaseAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// this causes a compilation error&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In other words, with this configuration you gain safety, but in some cases pay for it with checks that make no sense, solely to tame a stubborn compiler. It feels very much like a workaround.&lt;/p&gt;

&lt;p&gt;Code with &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; is definitely much safer, and that is TypeScript’s main purpose. But the trade-off can be substantial, so I cannot recommend the flag to everyone.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This flag is a kind of companion to &lt;code&gt;strictNullChecks&lt;/code&gt;, so it works only when that flag is also enabled.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noImplicitReturns&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always / difficulty: easy / ESLint rule: &lt;code&gt;consistent-return&lt;/code&gt;, not implemented yet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag ensures every branch of a function returns a value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;lookupHeadphonesManufacturer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;black&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;beats&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// forgot return&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is analogous to ESLint’s &lt;a href="https://eslint.org/docs/rules/consistent-return" rel="noopener noreferrer"&gt;&lt;code&gt;consistent-return&lt;/code&gt;&lt;/a&gt;, which at the time was not yet implemented for TypeScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noFallthroughCasesInSwitch&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: if you do not use ESLint / difficulty: easy / ESLint rule: &lt;code&gt;no-fallthrough&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag checks for &lt;code&gt;break&lt;/code&gt; in a &lt;code&gt;switch/case&lt;/code&gt; statement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;switch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;even&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;// forgot break&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;odd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;break&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It can be replaced by &lt;a href="https://eslint.org/docs/rules/no-fallthrough" rel="noopener noreferrer"&gt;&lt;code&gt;no-fallthrough&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noUnusedLocals&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: for production if you do not use ESLint / difficulty: easy / ESLint rule: &lt;code&gt;no-unused-vars&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code is checked for unused variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createKeyboard&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;modelID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// an unused variable is declared&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;defaultModelID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;keyboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;modelID&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This rule is extremely inconvenient during development. While you are writing code, it may be in pieces, and unused variables will cause compilation errors.&lt;/p&gt;

&lt;p&gt;You can override the flag for a &lt;code&gt;development&lt;/code&gt; environment or use ESLint’s &lt;a href="https://eslint.org/docs/rules/no-unused-vars" rel="noopener noreferrer"&gt;&lt;code&gt;no-unused-vars&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noUnusedParameters&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: for production if you do not use ESLint / difficulty: easy / ESLint rule: &lt;code&gt;no-unused-vars&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code is checked for unused function and method arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createDefaultKeyboard&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;modelID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;defaultModelID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;keyboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;modelID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;defaultModelID&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Like &lt;code&gt;noUnusedParameters&lt;/code&gt;, this rule gets in the way of a comfortable development process. You can override it for &lt;code&gt;development&lt;/code&gt;, or add arguments settings to ESLint’s &lt;a href="https://eslint.org/docs/rules/no-unused-vars#args" rel="noopener noreferrer"&gt;&lt;code&gt;no-unused-vars&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Linter Checks&lt;/code&gt;: summary
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;There is no single flag that turns on every option in the section.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;noPropertyAccessFromIndexSignature&lt;/code&gt; and &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; are really &lt;code&gt;Strict Checks&lt;/code&gt;. They are just not automatically enabled by the main &lt;code&gt;strict&lt;/code&gt; flag.&lt;/li&gt;
&lt;li&gt;The other flags, &lt;code&gt;noFallthroughCasesInSwitch&lt;/code&gt;, &lt;code&gt;noUnusedLocals&lt;/code&gt;, and &lt;code&gt;noUnusedParameters&lt;/code&gt;, can be replaced by linter rules. The rule for &lt;code&gt;noImplicitReturns&lt;/code&gt; was only temporarily unsupported.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;Advanced&lt;/code&gt; group
&lt;/h2&gt;

&lt;p&gt;This is the largest section. It looks as though every option that did not fit a separate group was put here. Some of its options concern compiler strictness:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowUnreachableCode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowUnusedLabels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitUseStrict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"suppressExcessPropertyErrors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"suppressImplicitAnyIndexErrors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noStrictGenericChecks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;allowUnreachableCode&lt;/code&gt; and &lt;code&gt;allowUnusedLabels&lt;/code&gt; are separated by a blank line for a reason: they escaped from &lt;code&gt;Linter Checks&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Surprisingly, these flags default to &lt;code&gt;true&lt;/code&gt;, while strictness requires &lt;code&gt;false&lt;/code&gt;. That is the exact opposite.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is easy enough to remember. Earlier options of this kind used the &lt;code&gt;no&lt;/code&gt; prefix: “forbid the allowance.” These use &lt;code&gt;allow&lt;/code&gt;: “permit the allowance.” For consistency, they ought to be renamed &lt;code&gt;noUnreachableCode&lt;/code&gt; and &lt;code&gt;noUnusedLabels&lt;/code&gt; and sent to the appropriate group.&lt;/p&gt;

&lt;p&gt;The remaining flags, &lt;code&gt;noImplicitUseStrict&lt;/code&gt;, &lt;code&gt;noStrictGenericChecks&lt;/code&gt;, &lt;code&gt;suppressExcessPropertyErrors&lt;/code&gt;, and &lt;code&gt;suppressImplicitAnyIndexErrors&lt;/code&gt;, could form a new group called &lt;code&gt;Base Strict Checks&lt;/code&gt;. Here is why:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;These flags default to &lt;code&gt;false&lt;/code&gt; and should remain &lt;code&gt;false&lt;/code&gt; for strictness!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So we have found the options enabled by default that make up TypeScript’s out-of-the-box type safety.&lt;/p&gt;

&lt;p&gt;In essence, the options above (except &lt;code&gt;noImplicitUseStrict&lt;/code&gt;) permit explicit violations of typing. That can sometimes serve as a temporary measure while migrating difficult JavaScript code.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In 99.9% of cases, you will never need to override any of these four flags.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, a few words about this pseudo-group.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;allowUnreachableCode&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: always for production / difficulty: easy / ESLint rule: &lt;code&gt;no-unreachable&lt;/code&gt;, not implemented yet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag forbids unreachable code: code written after &lt;code&gt;return&lt;/code&gt;, &lt;code&gt;throw&lt;/code&gt;, &lt;code&gt;break&lt;/code&gt;, or &lt;code&gt;continue&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// unreachable code&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is convenient to disable this flag during &lt;code&gt;development&lt;/code&gt;. It is analogous to ESLint’s &lt;a href="https://eslint.org/docs/rules/no-unreachable" rel="noopener noreferrer"&gt;&lt;code&gt;no-unreachable&lt;/code&gt;&lt;/a&gt;, which at the time was not implemented for TypeScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;allowUnusedLabels&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Recommended: for production if you do not use ESLint / difficulty: easy / ESLint rule: &lt;code&gt;no-unused-labels&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This option forbids unused &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label" rel="noopener noreferrer"&gt;labels&lt;/a&gt;. I do not think you will find this construct in the wild nowadays, but still:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;verifyAge&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// that very unused label&lt;/span&gt;
    &lt;span class="nl"&gt;verified&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace it with ESLint’s &lt;a href="https://eslint.org/docs/rules/no-unused-labels" rel="noopener noreferrer"&gt;&lt;code&gt;no-unused-labels&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noImplicitUseStrict&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Configured by default. Do not change it / related to &lt;code&gt;alwaysStrict&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag automatically adds &lt;code&gt;"use strict"&lt;/code&gt; when &lt;code&gt;target&lt;/code&gt; is lower than &lt;code&gt;ES6&lt;/code&gt;. &lt;code&gt;alwaysStrict&lt;/code&gt; does the same for every &lt;code&gt;target&lt;/code&gt;. It is hard to imagine ever needing to override this flag.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If both &lt;code&gt;noImplicitUseStrict&lt;/code&gt; and &lt;code&gt;alwaysStrict&lt;/code&gt; are set to &lt;code&gt;true&lt;/code&gt;, compilation fails because the settings conflict.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;suppressExcessPropertyErrors&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Configured by default. Do not change it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag ensures an object cannot contain properties that were not described in its structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Point&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;
  &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Point&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// property z is not declared in the Point interface&lt;/span&gt;
  &lt;span class="na"&gt;z&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can temporarily switch this setting off while migrating a JavaScript codebase if it has many such cases. But restore the original value afterward. For one-off cases, &lt;code&gt;// @ts-ignore&lt;/code&gt; is better.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;suppressImplicitAnyIndexErrors&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Configured by default. Do not change it / related to &lt;code&gt;noImplicitAny&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag checks that bracket notation cannot access object properties which are not declared explicitly or through arbitrary properties. Recall the &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; example and remove its arbitrary properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// explicitly declared properties&lt;/span&gt;
  &lt;span class="nl"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="c1"&gt;// comment out the arbitrary properties&lt;/span&gt;
  &lt;span class="c1"&gt;// [key: string]: string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;login&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// name can no longer be accessed&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It might seem that no other behavior is possible. But, as I said, the final four flags can sometimes permit a type-system violation for edge cases. For example, this flag is often inverted when people do not know how to extend TypeScript’s built-in typings or third-party typings. That is bad practice. The right tool is &lt;a href="https://www.typescriptlang.org/docs/handbook/declaration-merging.html" rel="noopener noreferrer"&gt;&lt;code&gt;declaration merging&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For example, suppose we load Google Maps through a &lt;code&gt;script&lt;/code&gt; tag and try to create a &lt;code&gt;Pin&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Pin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;59.9386&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;30.3141&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Naturally, this errors because the built-in typings know nothing about &lt;code&gt;google&lt;/code&gt;. &lt;code&gt;// @ts-ignore&lt;/code&gt; is awkward because you would need it on almost every line. So you will often see this solution: set &lt;code&gt;suppressImplicitAnyIndexErrors: true&lt;/code&gt; (allow the escape hatch) and write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;google&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;maps&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Pin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="mf"&gt;59.9386&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;30.3141&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That can exist in projects halfway through a migration. Still, I would not recommend it even there. Declaration merging solves the problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// an arbitrary merging.d.ts file&lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Pin&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// declaration&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;PinConstructor&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;lng&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;Pin&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Window&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;google&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;maps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Pin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PinConstructor&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// usage in code&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Pin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;59.9386&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;30.3141&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same practice applies to external libraries, for example when extending Express’s &lt;code&gt;req&lt;/code&gt; and &lt;code&gt;res&lt;/code&gt; objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;noStrictGenericChecks&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Configured by default. Do not change it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Overriding this flag can make the compiler more “lenient” with generics:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;A&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;U&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;U&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;U&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;B&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;A&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;B&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// OK&lt;/span&gt;
  &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;
  &lt;span class="c1"&gt;// this should be an error, but the compiler ignores it&lt;/span&gt;
  &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;Advanced&lt;/code&gt;: summary
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The section contains many unrelated flags. Some concern compiler strictness and could be moved to thematic sections.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;allowUnreachableCode&lt;/code&gt; and &lt;code&gt;allowUnusedLabels&lt;/code&gt; are linting flags and could move to &lt;code&gt;Linter Checks&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;noImplicitUseStrict&lt;/code&gt;, &lt;code&gt;noStrictGenericChecks&lt;/code&gt;, &lt;code&gt;suppressExcessPropertyErrors&lt;/code&gt;, and &lt;code&gt;suppressImplicitAnyIndexErrors&lt;/code&gt; are the defaults that provide TypeScript’s built-in type safety.&lt;/li&gt;
&lt;li&gt;You can forget about the other four flags.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;noImplicitUseStrict&lt;/code&gt; is a variation of &lt;code&gt;alwaysStrict&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;noStrictGenericChecks&lt;/code&gt;, &lt;code&gt;suppressExcessPropertyErrors&lt;/code&gt;, and &lt;code&gt;suppressImplicitAnyIndexErrors&lt;/code&gt; turn off some basic syntax checks to make difficult JavaScript-to-TypeScript migrations easier.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To finish, here is a cheat sheet of every flag mentioned above for maximum strictness and clarity.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tsconfig-checks.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Strict&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Checks&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"alwaysStrict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitAny"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictNullChecks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictPropertyInitialization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictFunctionTypes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitThis"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strictBindCallApply"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noPropertyAccessFromIndexSignature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUncheckedIndexedAccess"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Linter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Checks&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitReturns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;https://eslint.org/docs/rules/consistent-return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;🛑&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noFallthroughCasesInSwitch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;https://eslint.org/docs/rules/no-fallthrough&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUnusedLocals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;https://eslint.org/docs/rules/no-unused-vars&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUnusedParameters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;https://eslint.org/docs/rules/no-unused-vars#args&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowUnreachableCode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;https://eslint.org/docs/rules/no-unreachable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;🛑&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowUnusedLabels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;https://eslint.org/docs/rules/no-unused-labels&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Base&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Strict&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Checks&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noImplicitUseStrict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"suppressExcessPropertyErrors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"suppressImplicitAnyIndexErrors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noStrictGenericChecks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why &lt;code&gt;tsconfig-checks.json&lt;/code&gt;? In &lt;a href="https://dev.to/barinbritva/typescript-spelling-out-tsconfig-part-1-3nak"&gt;part one&lt;/a&gt;, we discussed using config inheritance so strictness settings do not get mixed with other options. That is exactly what we will do.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tsconfig.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;strictness&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;settings&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./tsconfig-checks.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;other&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;settings&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And for a smoother development experience, so unreachable code and unused variables do not break compilation, you can do this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tsconfig-dev.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./tsconfig.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;disable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;some&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;linting&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;so&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;compilation&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;does&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;break&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUnusedLocals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"noUnusedParameters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowUnreachableCode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowUnusedLabels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is all for now. Next, I plan to dig into optimization and performance options and will be sure to share what I find. See you next time!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article is based on &lt;a href="https://twitter.com/jsunderhood/status/1376857418890670081" rel="noopener noreferrer"&gt;my thread&lt;/a&gt; on the collective &lt;a href="https://twitter.com/jsunderhood" rel="noopener noreferrer"&gt;@jsunderhood&lt;/a&gt; account.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. I also sometimes write about TypeScript and development on &lt;a href="https://twitter.com/barinbritva" rel="noopener noreferrer"&gt;@barinbritva&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>tsconfig</category>
      <category>guide</category>
    </item>
    <item>
      <title>TypeScript: Sorting out tsconfig. Part 1</title>
      <dc:creator>Barin Britva</dc:creator>
      <pubDate>Mon, 12 Apr 2021 10:22:42 +0000</pubDate>
      <link>https://dev.to/barinbritva/typescript-spelling-out-tsconfig-part-1-3nak</link>
      <guid>https://dev.to/barinbritva/typescript-spelling-out-tsconfig-part-1-3nak</guid>
      <description>&lt;p&gt;I’m a big fan of TypeScript. Each new project I prefer to write on TS rather than native JavaScript. In this article, I will not discuss the reasons for choosing TypeScript or its advantages and disadvantages. I’d like this article to be a guide for those who want to learn how to set up &lt;code&gt;tsconfig&lt;/code&gt;, to sort out its numerous flags and learn some useful tricks.&lt;/p&gt;

&lt;p&gt;So, in this article I want to provide a revised and streamlined documentation summary, which I believe will be useful to those who are standing at the begging of their path to TypeScript or for those who didn't find time or energy to sort out the details and want to fill this gap.&lt;/p&gt;

&lt;p&gt;When you’re opening official reference &lt;code&gt;tsconfig&lt;/code&gt; you’ll see a full list of settings divided into groups. However, it doesn't allow you to understand what you should start with and which of these options are required and what can be skipped (for some time). Plus, some options are grouped by technical meaning, not logical. For example, some verification flags could be found in &lt;code&gt;Strict Checks&lt;/code&gt; group, some in &lt;code&gt;Linter Checks&lt;/code&gt; and others in &lt;code&gt;Advanced&lt;/code&gt; group. It’s not always easy to understand.&lt;/p&gt;

&lt;p&gt;All the options, just like the article itself, I divided into two groups – basic and “checks”. In the first part we'll talk about basic settings and in the second – different checks, i.e. tuning compiler strictness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tsconfig structure
&lt;/h2&gt;

&lt;p&gt;Let’s have a look at the structure and some features of the config.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tsconfig.json&lt;/code&gt; has 2 parts. Some options must be specified in &lt;code&gt;root&lt;/code&gt; and some of them in &lt;code&gt;compilerOptions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tsconfig.json&lt;/code&gt; supports comments. Such IDE like WebStorm or Visual Studio understand this and do not highlight comments as a syntax error&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tsconfig.json&lt;/code&gt; supports inheritance. Options can be divided according to some principle, described in different files and merged with the special directive&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a blank of &lt;code&gt;tsconfig.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;extends&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;you&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;enrich&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;options&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;other&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;options&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;specified&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;file&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;we'll&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;tsconfig-checks.json&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;next&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;article&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./tsconfig-checks.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;project-specific&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;options&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;based&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;config&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;root&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;compiler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;related&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;setting&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;will&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;be&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;placed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;here&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;root&lt;/code&gt; options are: &lt;code&gt;extends&lt;/code&gt;, &lt;code&gt;files&lt;/code&gt;, &lt;code&gt;include&lt;/code&gt;, &lt;code&gt;exclude&lt;/code&gt;, &lt;code&gt;references&lt;/code&gt;, &lt;code&gt;typeAcquisition&lt;/code&gt;. Of these, we will consider the first 4. Other options are based in &lt;code&gt;compilerOptions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes some options like &lt;code&gt;compileOnSave&lt;/code&gt; and &lt;code&gt;ts-node&lt;/code&gt; can be placed in &lt;code&gt;root&lt;/code&gt; section. These options are not official and can be used by IDE for its needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Root section
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;extends&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string | false, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Specifies the path to the file from which to inherit options. For the most part it serves as an organizing tool. Options can be divided according to some logic so that they don’t mix. For example, move config strict settings to separate file the way it’s shown in the config draft. However, given the support of comments in &lt;code&gt;tsconfig.json&lt;/code&gt; this can be done much easier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;basic&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;settings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;block&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;strict&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;settings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;block&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s have a look at another use-case where comments can’t be a solution. If we need to create production and development configs. This is how &lt;code&gt;tsconfig-dev.json&lt;/code&gt; version can look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./tsconfig.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;redefining&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;setting&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;needed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;dev&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;env&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;only&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"sourceMap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In general, I recommend using &lt;code&gt;extends&lt;/code&gt;. But don't break setting too much. This can become confusing. Due to the fact that multiple inheritance is not supported.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In case of using this option to see the final merged config version use command &lt;code&gt;tsc --showConfig&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;files&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string[] | false, default: false, related to &lt;code&gt;include&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can specify a list of specific files for compilation using this option.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"files"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"core.ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"app.ts"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;This option will be useful for only small projects with several files.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;include&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type string[], default: depends on &lt;code&gt;files&lt;/code&gt;, related to &lt;code&gt;exclude&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If option &lt;code&gt;files&lt;/code&gt; is not set up TypeScript will use this directive to search for files to compile. If &lt;code&gt;include&lt;/code&gt; is not declared too then its value will be set up as &lt;code&gt;["**/*"]&lt;/code&gt; by default. This means that the search for files will be carried out in all folders and their subfolders. This behavior is not optimal, so for performance reasons it’s best to always specify paths. There can be paths to specific files or path patterns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"include"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"src/**/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"tests/**/*"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If patterns don’t include specific extensions TypeScript will look for &lt;code&gt;.ts&lt;/code&gt;, &lt;code&gt;.tsx&lt;/code&gt; and &lt;code&gt;.d.ts&lt;/code&gt; files. And if &lt;code&gt;allowJs&lt;/code&gt; flag is enabled - then &lt;code&gt;.js&lt;/code&gt; and &lt;code&gt;.jsx&lt;/code&gt; files also.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;These formats are doing the same &lt;code&gt;src&lt;/code&gt;, &lt;code&gt;./src&lt;/code&gt;, &lt;code&gt;src/**/*&lt;/code&gt;. I prefer &lt;code&gt;./src&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Technically using &lt;code&gt;include&lt;/code&gt; and &lt;code&gt;exclude&lt;/code&gt; options TypeScript will create a list of all matched files and place it to &lt;code&gt;files&lt;/code&gt;. You can check it by running &lt;code&gt;tsc --showConfig&lt;/code&gt; command.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;exclude&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string[], default: ["node_modules", "bower_components", "jspm_packages"].&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This directive can be used to exclude unnecessary paths of files that was added by &lt;code&gt;include&lt;/code&gt; directive. By default, the option is set to the paths of the &lt;code&gt;npm&lt;/code&gt;, &lt;code&gt;bower&lt;/code&gt; and &lt;code&gt;jspm&lt;/code&gt; package managers, since the modules are already built in them. Besides TypeScript will ignore this folder from &lt;code&gt;outDir&lt;/code&gt; option if it was added. This is the folder where the collected built artifacts are placed. It is logical for them to be excluded. To add your values to this option it’s necessary to restore the defaults. Because user’s values are not merging with default values. In other words, you need to manually specify the root of your package manager modules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"exclude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"node_modules"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"./src/**/*.spec.ts"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;code&gt;exclude&lt;/code&gt; option can’t exclude files added by using &lt;code&gt;files&lt;/code&gt; option.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;code&gt;exclude&lt;/code&gt; option can’t exclude files that imported in other files which are not excluded.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  compilerOptions section
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;target&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string, default: &lt;code&gt;ES3&lt;/code&gt;, affects options &lt;code&gt;lib&lt;/code&gt;, &lt;code&gt;module&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The version of ECMAScript standard in which code will be compiled. Has a lot of choices: &lt;code&gt;ES3&lt;/code&gt;, &lt;code&gt;ES5&lt;/code&gt;, &lt;code&gt;ES6&lt;/code&gt; (same as &lt;code&gt;ES2015&lt;/code&gt;), &lt;code&gt;ES2016&lt;/code&gt;, &lt;code&gt;ES2017&lt;/code&gt;, &lt;code&gt;ES2018&lt;/code&gt;, &lt;code&gt;ES2019&lt;/code&gt;, &lt;code&gt;ES2020&lt;/code&gt;, &lt;code&gt;ESNext&lt;/code&gt;. For backend apps/packages &lt;code&gt;ES6&lt;/code&gt; is okay if you’re using only modern versions of &lt;code&gt;Node.js&lt;/code&gt; and &lt;code&gt;ES5&lt;/code&gt;, to support the older versions. &lt;code&gt;ES6&lt;/code&gt; is supported by &lt;a href="https://caniuse.com/es6"&gt;97.29% browsers&lt;/a&gt; at the moment. So, the situation for frontend apps is the same.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;module&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string, default: depends on &lt;code&gt;target&lt;/code&gt;, affects the option &lt;code&gt;moduleResolution&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A modular system that your compiled application will use. You can choose: &lt;code&gt;None&lt;/code&gt;, &lt;code&gt;CommonJS&lt;/code&gt;, &lt;code&gt;AMD&lt;/code&gt;, &lt;code&gt;System&lt;/code&gt;, &lt;code&gt;UMD&lt;/code&gt;, &lt;code&gt;ES6&lt;/code&gt;, &lt;code&gt;ES2015&lt;/code&gt;, &lt;code&gt;ES2020&lt;/code&gt; or &lt;code&gt;ESNext&lt;/code&gt;. For backend apps/packages &lt;code&gt;ES6&lt;/code&gt; or &lt;code&gt;CommonJS&lt;/code&gt; is suitable depending on &lt;code&gt;Node.js&lt;/code&gt; version you want to support. For frontend apps &lt;code&gt;ES6&lt;/code&gt; is also suitable. And for support of older browsers and isomorphic applications, &lt;a href="https://github.com/umdjs/umd"&gt;&lt;code&gt;UMD&lt;/code&gt;&lt;/a&gt; is definitely worth choosing.&lt;/p&gt;

&lt;p&gt;If your situation is not so easy or you want to know all the intricacies of modular systems, then you need to learn the &lt;a href="https://www.typescriptlang.org/docs/handbook/modules.html"&gt;full documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;moduleResolution&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string, default: depends on &lt;code&gt;module&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A strategy will be used for modules import. Includes only two options: &lt;code&gt;node&lt;/code&gt; and &lt;code&gt;classic&lt;/code&gt;. But &lt;code&gt;classic&lt;/code&gt; won't be using in 99% of cases cause it’s legacy. However, I specifically mentioned this flag as it changes depending on the previous flag. Changing value of &lt;code&gt;module&lt;/code&gt; option &lt;code&gt;moduleResolution&lt;/code&gt; mode can be switched to &lt;code&gt;classic&lt;/code&gt; and the console will start to display error messages on the lines with imports.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;To avoid this situation, I recommend that you always explicitly specify the &lt;code&gt;node&lt;/code&gt; value for this  flag.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;lib&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string[], default: depends on &lt;code&gt;target&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TypeScript includes typings (&lt;code&gt;*.d.ts-files&lt;/code&gt;) to support the corresponding specifications depending on which &lt;code&gt;target&lt;/code&gt; is set in the config. For example, if your &lt;code&gt;target&lt;/code&gt; is set up to &lt;code&gt;ES6&lt;/code&gt; TypeScript will include support of &lt;code&gt;array.find&lt;/code&gt; and other options that are in this standard. But when &lt;code&gt;target&lt;/code&gt; is set up to &lt;code&gt;ES5&lt;/code&gt; &lt;code&gt;find&lt;/code&gt; method can’t be used because it’s not available in this JavaScript version. Polyfills can be added. However, in order for TypeScript to understand that this functionality can now be used, it is necessary to include the related typings in the &lt;code&gt;lib&lt;/code&gt; section. Also, you can connect the entire &lt;code&gt;ES2015&lt;/code&gt; standard or its part &lt;code&gt;ES2015.Core&lt;/code&gt; (only &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;findIndex&lt;/code&gt; etc. methods).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sure it’s better to include typings only for the functionality for which polyfills were previously installed.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;For --target ES5 will be lined up: DOM, ES5, ScriptHost
For --target ES6: DOM, ES6, DOM.Iterable, ScriptHost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;The defaults are reset at the time you’re adding anything to &lt;code&gt;lib&lt;/code&gt;. It’s necessary to manually add what you need, for example &lt;code&gt;DOM&lt;/code&gt;:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ES5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"lib"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"DOM"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"ES2015.Core"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;outDir&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string, default: equals a root directory.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The final folder where the collected artifacts will be placed. There are: &lt;code&gt;.js&lt;/code&gt;, &lt;code&gt;.d.ts&lt;/code&gt;, and &lt;code&gt;.js.map&lt;/code&gt; files. If no value was set for this option, then all the above files will be copying the structure of the source files at the root of your project. In this case it’ll create difficulties with deleting previous builds and describing &lt;code&gt;.gitignore&lt;/code&gt; files. As a result, the code base will look like a dump. My advice is to put all artifacts in one folder which may be easily deleted or ignored by the version control system.&lt;/p&gt;

&lt;p&gt;If you leave &lt;code&gt;outDir&lt;/code&gt; option empty:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── module
│   └── core.js
│   └── core.ts
├── index.js
└── index.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you specify &lt;code&gt;outDir&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── dist
│   └── module
│   |   └── core.js
│   └── index.js
├── module
│   └── core.ts
└── index.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;outFile&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string, default: none.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;According to the description this option allows to unite all files into one. It seems that bundlers like &lt;code&gt;webpack&lt;/code&gt; are no longer needed... However, this option works only if &lt;code&gt;None&lt;/code&gt;, &lt;code&gt;System&lt;/code&gt;, or &lt;code&gt;AMD&lt;/code&gt; value set up for &lt;code&gt;module&lt;/code&gt;. Much to our regret, the option won't work with &lt;code&gt;CommonJS&lt;/code&gt; or &lt;code&gt;ES6&lt;/code&gt; modules. Therefore, you probably won't need to use &lt;code&gt;outFile&lt;/code&gt;. Since the option looks so attractive, but does not work as expected, I decided to warn you about this giant pitfall.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;allowSyntheticDefaultImports&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: depends on &lt;code&gt;module&lt;/code&gt; or &lt;code&gt;esModuleInterop&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If one of the libraries doesn't have &lt;code&gt;default import&lt;/code&gt; such loaders as &lt;code&gt;ts-loader&lt;/code&gt; or &lt;code&gt;babel-loader&lt;/code&gt; will create it automatically. But &lt;code&gt;d.ts-files&lt;/code&gt; files of this library don't know anything about it. This flag allows compiler to write like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// instead of this import&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// you can use this&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's a default option when flag &lt;code&gt;esModuleInterop&lt;/code&gt; is enabled or &lt;code&gt;module&lt;/code&gt; === "system".&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;esModuleInterop&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By adding a boilerplate to the output code, it allows you to import &lt;code&gt;CommonJS&lt;/code&gt; packages as &lt;code&gt;ES6&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// moment library exporting only like CommonJS&lt;/span&gt;
&lt;span class="c1"&gt;// trying to import it as ES6&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Moment&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;moment&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// without esModuleInterop flag the result is undefined&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Moment&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// with esModuleInterop flag result is [object Object]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Moment&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This flag by dependency activates &lt;code&gt;allowSyntheticDefaultImports&lt;/code&gt;. Together they help to get rid of lots of different imports and write it uniformly across the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;alwaysStrict&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: depends on &lt;code&gt;strict&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Compiler will parse the code in &lt;code&gt;strict mode&lt;/code&gt; and add &lt;code&gt;“use strict”&lt;/code&gt; to output files.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;false by default but if flag &lt;code&gt;strict&lt;/code&gt; enabled then true.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;downlevelIteration&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ES6&lt;/code&gt; specification added new syntax for iteration: cycle &lt;code&gt;for / of&lt;/code&gt;, &lt;code&gt;array spread&lt;/code&gt;, &lt;code&gt;arguments spread&lt;/code&gt;. If the project code is compiled to &lt;code&gt;ES5&lt;/code&gt; then construction with cycle &lt;code&gt;for / of&lt;/code&gt; will be converted to common &lt;code&gt;for&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// es6 code&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// es5 code without downlevelIteration&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;_i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;str_1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;_i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;str_1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;_i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;str_1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;_i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But some symbols like &lt;code&gt;emoji&lt;/code&gt; are encoded with two characters. It means that such a transformation will not work as expected in some places. &lt;code&gt;downlevelIteration&lt;/code&gt; flag generates more verbose and more "correct", but less productive code. This code is huge so I won't take up space on the screen. You can find an example here - &lt;a href="https://www.typescriptlang.org/play?#code/MYewdgzgLgBNBOMC8MBEAJApgG2yAhKgNwBQAZiIgBSiSwQwhlxTwCUMA3iTDLRCGyYAdHgDmVCG1IBfIA"&gt;playground&lt;/a&gt; - and choose &lt;code&gt;target -&amp;gt; es5&lt;/code&gt;, &lt;code&gt;downlevelIteration -&amp;gt; true&lt;/code&gt; in settings.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The browser must have an implementation of &lt;code&gt;Symbol.iterator&lt;/code&gt; to make this flag work. Otherwise, you'll need to set up polyfill.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;forceConsistentCasingInFileNames&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enables case-sensitive mode for files import. Thereby even in case-insensitive file systems trying to make &lt;code&gt;import FileManager from './FileManager.ts'&lt;/code&gt; will fail if the file is actually named &lt;code&gt;fileManager.ts&lt;/code&gt;. It doesn't hurt to play it safe. TypeScript is all about strictness.&lt;/p&gt;

&lt;h2&gt;
  
  
  compilerOptions section options which are not needed in every project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;declaration&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By enabling this flag, in addition to JavaScript files, annotation files known as &lt;code&gt;d.ts&lt;/code&gt; files or typings will be generated for them.&lt;br&gt;
Due to typings it becomes possible to define types for already compiled js files. Other words code is compiling to &lt;code&gt;js&lt;/code&gt; and types to &lt;code&gt;d.ts&lt;/code&gt;-files. This can be useful if you're publishing your package to &lt;code&gt;npm&lt;/code&gt;. All developers can use this library whether they're using native JavaScript or TypeScript.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;declarationDir&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string, default: none, related to &lt;code&gt;declaration&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Typings are generated next to &lt;code&gt;js&lt;/code&gt;-files as a default. Using this option you can redirect all &lt;code&gt;d.ts&lt;/code&gt; files to a separate folder.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;emitDeclarationOnly&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false, related to &lt;code&gt;declaration&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If for some reason you only need the &lt;code&gt;d.ts&lt;/code&gt; files, then enabling this flag will prevent the generation of &lt;code&gt;js&lt;/code&gt; files.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;allowJs&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This flag will help you to port your JavaScript project to TypeScript. By enabling &lt;code&gt;allowJs&lt;/code&gt; flag you'll make TypeScript compiler process not only &lt;code&gt;ts&lt;/code&gt; but also &lt;code&gt;js&lt;/code&gt; files. There is no need to migrate the whole project before continuing the development. You can do it file by file changing their extensions and adding types to them. And the new functionality can be written directly in TypeScript.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;checkJs&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false, related to &lt;code&gt;allowJs&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TypeScript will check for errors not in &lt;code&gt;ts&lt;/code&gt; but in &lt;code&gt;js&lt;/code&gt; files also. In addition to the built-in typings for JavaScript language constructs, the TS compiler can also use jsDoc to parse files. I prefer not to use this flag but to put the code in order when I add types to it. However, if your project has good jsDoc code coverage, it's worth giving it a try.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Since version 4.1 when &lt;code&gt;checkJs&lt;/code&gt; is enabled, the &lt;code&gt;allowJs&lt;/code&gt; flag is automatically enabled.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;experimentalDecorators&lt;/code&gt; and &lt;code&gt;emitDecoratorMetadata&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://refactoring.guru/design-patterns/decorator"&gt;&lt;code&gt;Decorator&lt;/code&gt;&lt;/a&gt; – is a common OOP pattern. It’s possible to implement it using classical approach by writing wrappers. But using the flags mentioned above, you can enable experimental decorator syntax. This syntax allows you to decorate classes, their methods and properties, access modifiers and function arguments using simple &lt;a href="https://tc39.es/proposal-decorators/"&gt;&lt;code&gt;“at (@)” syntax&lt;/code&gt;&lt;/a&gt;, which is widespread in many programming languages.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;experimentalDecorators&lt;/code&gt; flag just activates the syntax, and &lt;code&gt;emitDecoratorMetadata&lt;/code&gt; provides decorators with additional metadata at runtime, with which you can significantly expand the scope of this feature.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;To make &lt;code&gt;emitDecoratorMetadata&lt;/code&gt; work you need to add &lt;a href="https://github.com/rbuckton/reflect-metadata"&gt;reflect-metadata&lt;/a&gt; library.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;resolveJsonModule&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: boolean, default: false.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Flag allows to enable ability to import &lt;code&gt;*.json&lt;/code&gt; files. No additional installation is required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// .json extension must be specified&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./config.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;jsx&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Type: string, default: none.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the project uses React, you need to enable &lt;code&gt;jsx&lt;/code&gt; support. In most cases &lt;code&gt;react&lt;/code&gt; or &lt;code&gt;react-native&lt;/code&gt; option will be enough. It is also possible to leave the &lt;code&gt;jsx-code&lt;/code&gt; untouched with the &lt;code&gt;preserve&lt;/code&gt; option or use the custom converters &lt;code&gt;react-jsx&lt;/code&gt; and &lt;code&gt;react-jsxdev&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up the 1st part
&lt;/h2&gt;

&lt;p&gt;In this article I wrote about the most important flags and options that can be useful in the vast majority of projects. In the next part I'll talk about compiler strict settings. I will add a link after publishing.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>tsconfig</category>
      <category>guide</category>
    </item>
    <item>
      <title>Choosing authentication method for a project</title>
      <dc:creator>Barin Britva</dc:creator>
      <pubDate>Wed, 03 Mar 2021 15:08:58 +0000</pubDate>
      <link>https://dev.to/barinbritva/choosing-authentication-method-for-a-project-211n</link>
      <guid>https://dev.to/barinbritva/choosing-authentication-method-for-a-project-211n</guid>
      <description>&lt;p&gt;&lt;em&gt;(From my Medium - Sep 29, 2020)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It’s been a little over a year since I wrote &lt;a href="https://dev.to/barinbritva/from-the-idea-to-the-side-project-4o0k"&gt;my previous post&lt;/a&gt; on how to take the first steps towards a startup. During this time, I managed to implement one project, which could not be launched due to COVID-19. I am soon planning to write a separate post about this project and the technical experiments that I made while working on it. Besides, I was starting another idea, which is now put on hold, and also several other ideas have appeared that one can start to implement. In fact, different ideas often come to my mind — small and not very. Probably, in the near future my main task will be to learn to think more “businesslike”. Because now all my ideas are just some things that are interesting to me either as a potential user or as a developer. That’s not the point, though.&lt;/p&gt;

&lt;p&gt;The main thing that I have realized during all this time is that if there are so many ideas, then one of them can take off. But for that I need to learn to launch project after project very quickly. Sometimes I think: what is the problem, really? I have a lot of experience in the field of development, my own set of frameworks and tools that I feel comfortable working with. And now, in my thoughts, I have already gone full speed and implemented all the ideas that are written in my notebook. I almost got down to work for real, opened the IDE and then … just froze for a few seconds and then all the enthusiasm was gone. Guess what I was thinking? Yes, that’s right — authentication! In 90% of cases, the project requires auth. And it became a stumbling block for me. This routine issue precedes all the fascinating work that attracted me so much when I was thinking about working on a project.&lt;/p&gt;

&lt;p&gt;Of course, you can implement the dev version of auth or even stub, and then write the real implementation. You can pull out the code and the database scheme from the previous project, then adjust it to the current realities and delete all the extra pieces. Which often seems more costly to me than writing from scratch. It is also possible to use third-party services, such as &lt;a href="https://auth0.com/" rel="noopener noreferrer"&gt;Auth0&lt;/a&gt;, which at first glance may seem extremely attractive. There is no need to develop authentication yourself, there is auth by login and password, as well as through social media.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2756%2F1%2A3eFes2P2R0CwV3cC-U9xVQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2756%2F1%2A3eFes2P2R0CwV3cC-U9xVQ.jpeg" alt="A lot of social media connector at Auth0"&gt;&lt;/a&gt;&lt;em&gt;A lot of social media connector at Auth0&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;However, I always have doubts about using external services, especially when it comes to such a critical part of the application as authentication. Auth0 offers 7,000 free users and unlimited logins. It’s great. Perhaps the application will not have so many users and it will be fine for a pilot run. But what if the number of users of the application exceeds this number, but the application still does not bring money. And most likely by that time you’ll be already paying for hosting and other services like mailing lists, monitoring systems, analytics. What if the same abstract Auth0 does not have the support of the social network you need, or you need to add some kind of business logic to the authentication process? In other words, such services can provide a significant speed boost at the start and provide a vendor lock-in in the future.&lt;/p&gt;

&lt;p&gt;To sum it up, I have accumulated a lot of thoughts about different auth methods, their pros and cons. Therefore, I decided to organize all this in the article below and share my experience and advice. So, let’s get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Classic authentication — login + password&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Due to the fact that this is the oldest and most proven method, it is the most common. That’s right — you enter the username and the password — and here you go. Nowadays, you don’t have to think about how to pick a good salt to protect your password with double processing it with the md5 function to get a hash (shoutout to PHP). I believe, any language already has a 100 per cent proven and safe way to do it. There are still some nuances, though.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From the user side:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Users often come up with passwords that they are sure they will certainly not forget. But in the end, they constantly mess around with annoying forms of password recovery. And in case your resource has not proven its need for the user, they can quit this business halfway through.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;So as not to forget passwords, users often have one for all occasions. However, most likely users don’t trust your resource at the initial stage. And the user will think ten times before risking the key to all his doors. With a high degree of probability, such a user will close an untrusted resource.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For obvious reasons resource developers frequently set up password strength rules (we’ll talk about it below). In case the user from paragraph 2 decided to set his password, it so often happens that security rules suggest adding a couple special characters or numbers to this password. In such cases some types of app users will close your app immediately (I was in this group of users too). But if a user decides to upgrade his password with a couple of new symbols, he risks falling into the group of users from paragraph 1.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Ac_-tC5kWAKomzxEiCBkyew.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Ac_-tC5kWAKomzxEiCBkyew.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AdiOBJ53dSXGuvTGxTh9OzA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AdiOBJ53dSXGuvTGxTh9OzA.png" alt="A service takes care about your security by checking your password strength"&gt;&lt;/a&gt;&lt;em&gt;A service takes care about your security by checking your password strength&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A user might not remember if he has registered on this portal before or not. What to choose — registration or authentication? I can’t sign in because I don’t have an account or because of the wrong password? Screw that, I’ll just reset the password. Okay there is no link to reset my password, but … why? Is it because I wasn’t registered, or mail sending is taking too long or there are problems on service side?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A registration form often has custom fields on top of credential fields: name, sex, address etc. Having seen this a user, not being 100% sure they need this particular service, might just run away. Ideally a registration form shouldn’t have any extra fields. Any extra info can be requested when the time comes. For example, in e-commerce store you’d better not ask a customer for their address during the initial registration — he may never make an order — but wait right till checkout instead. For sure, there can be some exceptions. In case you need to show what services are available based on the user’s address. Anyway, if you need to have some extra data, I’d recommend to always do it in the second step. We first create an account that contains only credentials and then fill in the profile with other important info. Thus, we’ll decrease the probability of a user disappearing in step one. If however he’ll runaway in step two, we still have his email. Potentially we can bring such a user back. The main thing is not to be too aggressive or obsessive doing that.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;User can face the biggest internet-spawned evil — captcha. This is a big separate story that we won’t dwell on here. Just try to make a list of your 10 most hateful things (about registration/authentication). I’m sure captcha will rank high on this chart.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;On the dev side it’s simple — one has to do a huge amount of work.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Implementation of login and password input, their processing, output of clear error messages in the program interface. Saving the session in cookies or issuing a JWT token.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cookies for storage is a fairly old mechanism that is gradually becoming a thing of the past and is being replaced by JWT tokens. This is also a large separate topic for discussion. Let me just say that JWT is very good. But it takes more time and effort to implement authentication through tokens, as well as understanding of how access tokens and refresh tokens work, what they are used for and so on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You need to think about security of users and the service itself. Therefore, you’d better integrate (or write your own) solution to check the strength of the created passwords, and also correctly convey this information to the user through the interface. For greater security, perhaps you might notify the user that it is time for him to change the password, say, in 3 months? Or even demand a new password from him immediately after authentication by means of the expired password? Well, no — it’s too much!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To increase security, of course, you should implement captcha. At least display it after several unsuccessful authentication attempts (which in itself is additional work). What should you take? Google reCAPTCHA with its traffic lights and bridges or invisible mode that trusts you simply because you are logged in to Google services. Or curvy, hard-to-read self-made characters, which are considered incorrect even if everything is entered correctly, at the sight of which the user will close the tab or application? You need to think. Perhaps I will leave this question unanswered.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A7k0orrFbjTZFuaixYwcgLw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A7k0orrFbjTZFuaixYwcgLw.jpeg" alt="A user is trying to pass reCAPTCHA"&gt;&lt;/a&gt;&lt;em&gt;A user is trying to pass reCAPTCHA&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The classic form of authentication/registration is rich in various flows. Separation of authentication and registration, functionality “forgot password”, “forgot login”, confirmation of the account by clicking the link received by email. All these things put a load on both interface development and the logic. It is necessary to add letter sending. But what should I put in the letter? A link to the new password form? A ready-made temporary password that will have to be changed in your personal account? I would choose the first option from a developer’s point of view since it is safer. And the second from the user’s point of view — it’s faster this way. Either way, these are the things you have to worry about and ultimately implement.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;One-time password authentication (arrives by email or SMS)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In my opinion, in comparison with the previous method, this option can be called ideal for the user. You enter your login, receive an email or a text with an access code. This solves almost all the difficulties a user encounters when working with classic authentication. And for a developer, in a sense, this method is easier to implement. At least, the developer does not need to think about the complexity of the password and the flow becomes very simple — due to the lack of separation of registration and authentication and the password recovery function. For me, these points are extremely significant and outweigh the concerns that this method adds. However, these conveniences have their own price… So, the cons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From the user side:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If the user is not actively using email, then it is possible that he is not signed in in his email client. And if email does not play a role in his life at all, then there is a possibility that it will be so difficult for the user to remember his mail credential that he will not even try. A simpler case is also possible. For example, a user works with mail only on a computer, and tries to access your service from a phone. There is no computer at hand … Well, you understand. To be honest, I have no idea how both of these options are possible in real life, especially the first one. But all I want to say here is that this method essentially makes your service dependent on another service. Of course, you can prompt the user to log in with a phone number. The phone is more often at hand. However, the user will leave his phone number to an untrusted service only as a last resort. In general, I recommend using phone logins only if it makes sense. For example, you have a courier delivery service, and the courier needs your number for quick communication. Otherwise, both you and your users will suffer. So, offering the choice of either email or phone — yup, but forcing the phone option on them — big no-no.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For some reason, email or SMS may be delayed and, in some cases, delayed significantly, and sometimes not come at all. Of course, if everything works stably on the part of your service and mail providers, there should be no problems.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A44ZlpBMohYojxHXsMnyRsQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A44ZlpBMohYojxHXsMnyRsQ.png" alt="One-time password is sent by email"&gt;&lt;/a&gt;&lt;em&gt;One-time password is sent by email&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;As for the developer:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;To prevent emails with access codes from getting into spam, it is necessary to integrate with trusted message sending providers, such as: &lt;a href="https://mailchimp.com/" rel="noopener noreferrer"&gt;Mailchimp&lt;/a&gt;, &lt;a href="https://www.mailgun.com/" rel="noopener noreferrer"&gt;Mailgun&lt;/a&gt;. If authentication is only done by email, then you have one provider. If authentication is done by email and phone, then you already have two. If you want to insure against a failure, then each of them should have fallback services, that is, there are already 4 integrations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Partial inability to be responsible for the stability of your application due to the dependence of the critical part of the system (in the form of authentication) from third parties. Of course, any service is this way or another not a standalone solution and depends on something. But there are things that cannot be passed on to third parties, such as Internet access or hosting. And there are dependencies that you can avoid and reduce the likelihood of system failure. Especially when it comes to not the secondary functions of the service, but the primary ones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integration and guaranteeing stability are not all of your problems. The main problem here is the price. Whereas everything is more or less obvious with sending emails — there is a mailgun, which will cost $ 0.80 per 1000 messages, it is noticeably worse with sending text messages. With an average price of $ 0.05, you will have to pay $ 50 for the same amount! Which is completely overwhelming for launching a startup that is not yet generating income. If you know cheap or maybe even free services for sending email or SMS, please write in the comments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To save money, you will have to add captcha before sending the message&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Two-factor and mixed authentication&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If the user does not exist, authentication is performed using a one-time password. Further authentications are carried out in the same way. After the user has created a password, entering a one-time code is done as the second step if additional security is needed or this step is omitted if simplicity is required.&lt;/p&gt;

&lt;p&gt;This method can be attractive in some cases, provided that you are absolutely certain that you need to have standard authentication via login and password. Let’s say, your application, logically speaking, cannot function at all without the user creating an account. But it would be illogical to load the user with unnecessary steps and thereby scare him away. You allow him to log in with a one-time password, thus creating a “draft” account — &lt;a href="https://en.wikipedia.org/wiki/Prospect" rel="noopener noreferrer"&gt;prospect&lt;/a&gt; (a marketing term describing a potential customer). By draft, I mean an incomplete account with which you can view resources, but you cannot perform some operations, such as ordering services or goods, posting articles or other materials, etc.&lt;/p&gt;

&lt;p&gt;As soon as the user reaches the step that requires creation of a full-fledged account, the system will ask for a password. Thus, we did not lose potential users ahead of time and delayed the user’s torments as much as possible. As a result, we got a full-fledged, secure account, which is important if the application allows us to carry out financial transactions. If security is not so critical, you can allow the user to enable and disable two-factor authentication.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AQf0f_ho9oqq8MVqZdAIBow.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AQf0f_ho9oqq8MVqZdAIBow.jpeg" alt="Two factor authentication adds extra security to your account"&gt;&lt;/a&gt;&lt;em&gt;Two factor authentication adds extra security to your account&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Since this method contains the functionality of the previous two approaches, it incorporates all the pros and cons of both.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Social media authentication&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;And, of course, authentication using our favorite social media. The method is extremely interesting and attractive. But, unfortunately, with its own serious shortcomings. On the positive side — we completely save the user from almost all the problems listed earlier! If a user has an active account on a social media, he can easily use our resource and any other resources that support authentication through social media. As a bonus, the user gets the opportunity to manage their sessions through a centralized location. Has your phone or computer been stolen? Go to your social media account and close sessions in all related applications — your accounts are under reliable protection. Also, signing through social media eliminates the need to verify the account — social media itself does this. And this approach frees the developer from a huge amount of decision-making and work, which is worth a lot!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F7256%2F1%2AmUFqQ7SuyjzZ_CWvQAJqdQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F7256%2F1%2AmUFqQ7SuyjzZ_CWvQAJqdQ.png" alt="Rich diversity of social connectors allows you to find the exact connector you need"&gt;&lt;/a&gt;&lt;em&gt;Rich diversity of social connectors allows you to find the exact connector you need&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;However, for some reason, applications that only use social media authentication represent tiny minority. It’s time to look at the flaws.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For the user:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;What if the user does not use any social media? Yes, I have met people a couple of times claiming that they are not on any network. I am sure that in the modern world, if a person uses the Internet in principle, then most likely he will have some kind of account. At least a Google or Apple account from his smartphone. Some more people who avoid social media have nevertheless fake accounts for different purposes. But the main idea here is that in a rare case, you can lose a potential user due to the lack of an alternative authentication method.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consider a completely opposite situation. I am an imaginary user who replaced real life with online one on a social media. I have all the social media that your application offers me for authentication. I can’t remember if I logged in to this service earlier or I just don’t remember what I used — Facebook, Instagram, Twitter… I clicked the wrong icon and got an empty account. Also, all applications implement sign in through a different set of networks. I would be happy to use everywhere, say, Twitter. This option is not always available, though. It would be convenient if the authentication method that was last used by the user was highlighted in the application interface. You can store this information in cookies or local storage. However, if you use the service from another device or even a browser, magic won’t work. So, this is only a partial solution to the problem. For me personally, this is the number one reason why, as a user, I rarely make a choice in favor of authentication via social media networks. I have not been able to work out an algorithm on how to choose a social media to sign in. Therefore, I usually just register with the service directly. Moreover, I have &lt;a href="https://1password.com" rel="noopener noreferrer"&gt;1Password&lt;/a&gt;. But more on that at the end of the article.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And what kind of service is it, exactly? Can I trust it to access my imaginary Facebook account? Will the service abuse my trust and use my data for its own hidden purposes? There are several problems with understanding the “rules of the game.” First, a list of data that will be transferred from the social network, appears only after you click on its icon and the authentication window in an external resource has opened. Secondly, a correctly configured scope on the part of developers plays a huge role. Scope is a list of privileges that the application will ask for from a social network. Sometimes applications ask for too many privileges and it is not always clear whether this is really necessary. Maybe the developer just requested the full scope so as not to deal with this, maybe he even wanted to return to the question by the time of the first release but forgot. Or maybe the application has its own plan for user data. In any case, this looks just as suspicious as an application on the phone that requests access to the microphone, while it does not have audio/video recording functions or support for voice commands. Therefore, it seems to me that it would be nice to familiarize the user with what kind of data you intend to use and how. This is especially important if your application contains functionality that the user does not know about. Just one example of the top of my head: we use write permissions not to post ads on your wall, but to save photos from the application to your photo album.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Ajue57t5NeZw55ofYxEnWHQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Ajue57t5NeZw55ofYxEnWHQ.png" alt="App requests the scope"&gt;&lt;/a&gt;&lt;em&gt;App requests the scope&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Another small point about safety, but from a different angle. In the most innocent case, a service can display in the user profile a link to the social network through which he signed in. Which can be undesirable for a number of reasons. From a simple “I don’t want to” to a desire to separate different areas of your life.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, if the user is far from IT, it may not be clear to them what auth is and how it works. I am sure that there are still users who, seeing the offer to enter their email and password when signing in the application, mistakenly believe that it is actually their email account password that they are asked to input right now. And given the fact that users often have one password for all occasions… So, not every user understands that the password is entered on the side of the imaginary Facebook, and not in the application for which authentication is required. Therefore, not everyone wants to risk their only password.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AdjMJTfjdV8m6YnKyLhZSLQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AdjMJTfjdV8m6YnKyLhZSLQ.jpeg" alt="Your app redirects user to the chosen social network to complete the authentication on their side"&gt;&lt;/a&gt;&lt;em&gt;Your app redirects user to the chosen social network to complete the authentication on their side&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For the developer:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You’ll have to create a developer account for each social media to get tokens and API keys. That’s not easy nowadays. For instance, to obtain Twitter API access it’s required to write a detailed explanation how your application intends to use the provided data. All app creation requests will be moderated manually by real people. In case a moderator gets any doubts, you’ll receive an email with extra questions. Each social media may have their own policies and requirements. That’s means to implement authentication through the number of social media you will have to spend time and make some effort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you are not going to use ready solutions like &lt;a href="https://www.passportjs.org" rel="noopener noreferrer"&gt;Passport.js&lt;/a&gt; or there are no similar packages for the platform you use to develop your app, you will have to read a lot of different documentation and integrate all those API’s in manual mode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Different social media provide different user data. For example, some social media won’t give you a user email, which is necessary for your app. That’s why you can’t avoid implementing the second step to collect missing data.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Ugh, well, I am done with all the methods, pros and cons that I have come across in my experience. I told you everything I knew. Finally, of course, I would like to share my opinion on when to choose which method. At the end of the day, all these thoughts came to my mind in the process of thinking about how to quickly do auth in my future projects.&lt;/p&gt;

&lt;p&gt;It seems to me that in the balance between usability and speed/ease of implementation, one-time password authentication wins. If you are developing &lt;a href="https://en.wikipedia.org/wiki/Minimum_viable_product" rel="noopener noreferrer"&gt;MVP&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/Proof_of_concept" rel="noopener noreferrer"&gt;PoC&lt;/a&gt;, you can even postpone integrations with mailing services until you start attracting real users. That is, at the stage of development and testing in a closed circle and demonstrating the application to investors, you can get by sending login codes through a standard function or a function from some third-party libraries, which I am sure exist in every programming language.&lt;/p&gt;

&lt;p&gt;Of course, authentication only through social media can be a great option too. For example, if you know your target audience perfectly. So, Tinder, when it was just launched and for a long time after, had authentication only through Facebook. Even photos could only be uploaded to a profile from Facebook albums. A real startup approach! If you are making an app for developers, it will most likely be sufficient to support the login via GitHub. But if everything is not so obvious, then you will have to implement user authentication sign in via the top 5–7 social media networks. Even at the stage of closed beta testing or showing it to potential partners.&lt;/p&gt;

&lt;p&gt;If you need a wide range of authentication methods at the very start and are not afraid to get a vendor lock-in, then things like &lt;a href="https://auth0.com/" rel="noopener noreferrer"&gt;Auth0&lt;/a&gt; and &lt;a href="https://firebase.google.com/docs/auth/" rel="noopener noreferrer"&gt;Firebase Authentication&lt;/a&gt; are most likely exactly what you need.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F1%2A0lK4tWLqBRNmXzuuFnqITg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F1%2A0lK4tWLqBRNmXzuuFnqITg.jpeg" alt="I can only show you the doors, but you’re the one who decides which one to choose"&gt;&lt;/a&gt;&lt;em&gt;I can only show you the doors, but you’re the one who decides which one to choose&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What do you think about it? What problems do you see when creating auth for a project? Perhaps you know ways to easily solve all these problems, for example, an analogue of oAuth, only open source. With any thoughts on this topic, I am glad to welcome you in the comments.&lt;/p&gt;

&lt;p&gt;P.S.: So, I mentioned &lt;a href="https://1password.com" rel="noopener noreferrer"&gt;1Password&lt;/a&gt;. This is by no means an advertisement. It’s just that I’ve been using it for over a year now and highly recommend it to anyone who wants to end the password confusion while staying safe. I create different passwords using the built-in password generator and 1Password remembers everything for me. All I have to do is show my face for Windows Hello to allow 1Password to fill out the login form. And on a smartphone, I use a fingerprint. It’s incredibly convenient! If you don’t have biometrics on your device, then everything is the same for you — you only need to remember one password, from 1Password itself.&lt;/p&gt;

</description>
      <category>startup</category>
      <category>petproject</category>
      <category>projectmanagement</category>
      <category>experience</category>
    </item>
    <item>
      <title>From the idea to the side project</title>
      <dc:creator>Barin Britva</dc:creator>
      <pubDate>Wed, 03 Mar 2021 14:40:54 +0000</pubDate>
      <link>https://dev.to/barinbritva/from-the-idea-to-the-side-project-4o0k</link>
      <guid>https://dev.to/barinbritva/from-the-idea-to-the-side-project-4o0k</guid>
      <description>&lt;p&gt;&lt;em&gt;(From my Medium - Jul 4, 2019)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A few times in my life I had ideas of projects which didn’t want to leave my head either during at day nor at night. I haven’t finished any of them yet, but I’ve gotten a lot of valuable experience that I’m planning to use in the near future. Here are several things I have noticed.&lt;/p&gt;

&lt;p&gt;I guess it’s not a secret to anybody that any project must start from &lt;a href="https://en.wikipedia.org/wiki/Minimum_viable_product"&gt;MVP&lt;/a&gt;. To do that you should imagine an application of your dream and then move all unnecessary features to the backlog. You can also compose a feature roadmap to specify iterations. Working on one of my projects I almost did it this way, but I ran into over-management — I started the project in Jira, created some releases, stories, sprints, etc. It was a huge mistake. I would recommend using a simple text file for a start. And the main point here is — you mustn’t be seduced to add any new features to your MVP, even if this feature is very small.&lt;/p&gt;

&lt;p&gt;For instance, a simple desire to add nice small avatars for users may become a hard, long story about including third-party libraries, static files storing, validating of uploaded files and after all of that, you have to create crop image functionality. All the things that maybe not done mustn’t be done.&lt;/p&gt;

&lt;p&gt;The second important point is the following: even if you managed to design minimum functionality and created a boilerplate of application it isn’t a victory yet. The situation when your free time for the project is not enough will come soon. You would like to relax sometimes at weekends but allocated two hours on a weekday may be wasted on ridiculous bug searching instead of development. That’s why it makes sense to take a break for a few months and work on your project in full-time mode. By the way, it’s a good possibility to check how powerful your faith in your own idea is. For example, my faith wasn’t strong enough in the last project.&lt;/p&gt;

&lt;p&gt;And another paramount thing — the process can drag for a long time just because you may not know what to do next after the technical part of the product is finished. How to run the project in production, what are the markers of successful and unsuccessful launch, where I can get the investments? To get some orientation in the business part of products and get the basic knowledge about it you can go to a so-called “pre-accelerator”. There you will be able to meet with a curator who will help you with all these questions.&lt;/p&gt;

&lt;p&gt;What’s next? I don’t know yet. But as soon I’ll know I will tell you.&lt;/p&gt;

&lt;p&gt;Good luck with your ideas! 😉&lt;/p&gt;

</description>
      <category>startup</category>
      <category>petproject</category>
      <category>projectmanagement</category>
      <category>experience</category>
    </item>
  </channel>
</rss>
