簡體   English   中英

嘗試使用最新版本的 ant 設計時出現 TSLint 錯誤

[英]TSLint errors when trying to use newest version of ant design

在我的 Power BI 自定義視覺對象中嘗試使用 ant 設計的 4.21.7 版時,我收到以下打字稿/tslint 錯誤:

ERROR in /node_modules/antd/lib/input/Input.d.ts
[tsl] ERROR in /node_modules/antd/lib/input/Input.d.ts(17,11)
      TS1110: Type expected.

ERROR in /node_modules/antd/lib/input/Input.d.ts
[tsl] ERROR in /node_modules/antd/lib/input/Input.d.ts(17,27)
      TS1005: ';' expected.

ERROR in /node_modules/antd/lib/input/Input.d.ts
[tsl] ERROR in /node_modules/antd/lib/input/Input.d.ts(17,28)
      TS1128: Declaration or statement expected.

ERROR in /node_modules/antd/lib/input/Input.d.ts
[tsl] ERROR in /node_modules/antd/lib/input/Input.d.ts(18,1)
      TS1128: Declaration or statement expected.

它引用的代碼如下,第 17 行是 ([key: data-${string} ]: string;):

export interface InputProps extends Omit<RcInputProps, 'wrapperClassName' | 'groupClassName' | 'inputClassName' | 'affixWrapperClassName'> {
    size?: SizeType;
    disabled?: boolean;
    status?: InputStatus;
    bordered?: boolean;
    [key: `data-${string}`]: string;
}

我的 tslint.json 看起來像這樣,我錯過了什么?

{
    "extends": "tslint-microsoft-contrib/recommended",
    "rulesDirectory": [
        "node_modules/tslint-microsoft-contrib"
    ],
    "rules": {
        "no-relative-imports": false
    }
}

我遇到了類似的問題,我將我的 package 中的 typescript 升級到 4.7.4(最新版本)並且它工作

"typescript": "^4.7.4"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM