[Typescript] Step 3. Turn on "noImplicitAny" and even more strict mode

Step 3: Turn on "noImplicitAny"

From prevIoUs steps, we allow implicit any: https://www.cnblogs.com/Answer1215/p/16634618.html

 

Now, we need to turn on "noImplicitAny" mode.

tsconfig.json

"noImplicitAny": true,

 

Example commit: https://github.com/zhentian-wan/professional-ts/commit/ebc235ebe63a5ce78e526d6d8f0ad75f50a61f02

 

Step 3.1: Turn on "strict: true"

tsconfig.json

"strict": true /* Enable all strict type-checking options. */,

You can try to run tsc command, to see whether there is any build error, if it is then fix it, if not, then continue

 

Step 3.2: Turn on other "strict" settings

tsconfig.json

    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "stripInternal": true,
    "forceConsistentCasingInFileNames": true

 

相关文章

AJAX是一种基于JavaScript和XML的技术,能够使网页实现异步交...
在网页开发中,我们常常需要通过Ajax从后端获取数据并在页面...
在前端开发中,经常需要循环JSON对象数组进行数据操作。使用...
AJAX(Asynchronous JavaScript and XML)是一种用于创建 We...
AJAX技术被广泛应用于现代Web开发,它可以在无需重新加载页面...
Ajax是一种通过JavaScript和HTTP请求交互的技术,可以实现无...