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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

typescript tslint rules config

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

轉載于:https://juejin.im/post/5c0f36926fb9a04a03790f11

總結

以上是生活随笔為你收集整理的typescript tslint rules config的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。