日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

typescript tslint rules config

發(fā)布時(shí)間:2024/4/17 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 typescript tslint rules config 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
{//ts專用adjacent-overload-signatures : true, // Enforces function overloads to be consecutive.ban-comma-operator:true, //禁止逗號(hào)運(yùn)算符。ban-type: [true, ["object","User {} instead."],["string"]] //禁止類型member-access: [true , "no-public"||"check-accessor"|| "check-constructor" || "check-parameter-property" ] , //類成員必須聲明 private public ....member-order: [true, {order:....}], //類聲明排序no-any: true,//不需使用any類型no-empty-interface:true //禁止空接口 {}no-import-side-effect: [true, {"ignore-module": "(\\.html|\\.css)$"}], //禁止導(dǎo)入帶有副作用的語(yǔ)句no-inferrable-types:[true, "ignore-params", "ignore-properties"], //不允許將變量或參數(shù)初始化為數(shù)字,字符串或布爾值的顯式類型聲明。no-internal-module:true, //不允許內(nèi)部模塊no-magic-numbers: [true,1,2,3], //不允許在變量賦值之外使用常量數(shù)值。當(dāng)沒(méi)有指定允許值列表時(shí),默認(rèn)允許-1,0和1no-namespace: [ true,"allpw-declarations"], //不允許使用內(nèi)部modules和命名空間no-non-null-assertion: true , //不允許使用!后綴操作符的非空斷言。no-parameter-reassignment: true, //不允許重新分配參數(shù)no-reference: true, // 禁止使用/// <reference path=> 導(dǎo)入 ,使用import代替no-unnecessary-type-assertion: true, //如果類型斷言沒(méi)有改變表達(dá)式的類型就發(fā)出警告no-var-requires: true, //不允許使用var module = require("module"),用 import foo = require('foo')導(dǎo)入only-arrow-functions:[true"allow-declarations""allow-named-functions"], //允許箭頭表達(dá)式,不需要傳統(tǒng)表達(dá)式 ; 允許獨(dú)立的函數(shù)聲明 ;允許表達(dá),function foo() {}但不是function() {}prefer-for-of:true, //建議使用for(..of)promise-function-async: true, 要求異步函數(shù)返回promisetypedef: [true, "call-signature", "parameter", "member-variable-declaration"], //需要定義的類型存在typedef-whitespace: true, //類型聲明的冒號(hào)之前是否需要空格unified-signatures: true, //重載可以被統(tǒng)一聯(lián)合成一個(gè)//function 專用await-promise: true, //警告不是一個(gè)promise的awaitban: [true,"eval",{"name": "$", "message": "please don't"},["describe", "only"],{"name": ["it", "only"], "message": "don't focus tests"},{"name": ["chai", "assert", "equal"],"message": "Use 'strictEqual' instead."},{"name": ["*", "forEach"], "message": "Use a regular for loop instead."}],curly: true, //for if do while 要有括號(hào)forin:true, //用for in 必須用if進(jìn)行過(guò)濾import-blacklist:true, //允許使用import require導(dǎo)入具體的模塊label-postion: true, //允許在do/for/while/swith中使用labelno-arg:true, //不允許使用 argument.calleeno-bitwise:true, //不允許使用按位運(yùn)算符no-conditional-assignmen: true, //不允許在do-while/for/if/while判斷語(yǔ)句中使用賦值語(yǔ)句no-console:true, //不能使用consoleno-construct: true, //不允許使用 String/Number/Boolean的構(gòu)造函數(shù)no-debugger: true, //不允許使用debuggerno-duplicate-super: true, //構(gòu)造函數(shù)兩次用super會(huì)發(fā)出警告no-empty:true, //不允許空的塊no-eval: true, //不允許使用evalno-floating-promises: true, //必須正確處理promise的返回函數(shù)no-for-in-array: true, //不允許使用for in 遍歷數(shù)組no-implicit-dependencies: true, //不允許在項(xiàng)目的package.json中導(dǎo)入未列為依賴項(xiàng)的模塊no-inferred-empty-object-type: true, //不允許在函數(shù)和構(gòu)造函數(shù)中使用{}的類型推斷no-invalid-template-strings: true, //警告在非模板字符中使用${no-invalid-this:true, //不允許在非class中使用 this關(guān)鍵字no-misused-new: true, //禁止定義構(gòu)造函數(shù)或new classno-null-keyword: true, //不允許使用null關(guān)鍵字no-object-literal-type-assertion:true, //禁止objext出現(xiàn)在類型斷言表達(dá)式中no-return-await:true, //不允許return awaitarrow-parens: true, //箭頭函數(shù)定義的參數(shù)需要括號(hào)} 復(fù)制代碼

轉(zhuǎn)載于:https://juejin.im/post/5c0f36926fb9a04a03790f11

總結(jié)

以上是生活随笔為你收集整理的typescript tslint rules config的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。