Difference in the 'lib' property in tsconfig.json between es6 and es2017?

后端 未结 1 1689
耶瑟儿~
耶瑟儿~ 2021-02-13 21:55

I\'ve been researching what the possible values of the lib property mean in the compilerOptions found within the tsconfig.json file. I fou

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-13 22:45

    After some digging and comparing through the lib folder on the Typescript GitHub I have found that, using es6 in the lib property in the compilerOptions corresponds to the code found in these references:

    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    

    so to answer my question, to correctly cover all the contents of es6 with es2017 that section of the tsconfig.json should look like this:

    {
      ...
      "compilerOptions": {
        ...
        "lib": ["es2017", "dom", "dom.iterable", "scripthost"]
      },
      ...
      }
    }
    

    0 讨论(0)
提交回复
热议问题