简体   繁体   English

尝试使用最新版本的 ant 设计时出现 TSLint 错误

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

I am getting the following typescrit/tslint erros when trying to use version 4.21.7 of ant design within my Power BI custom visual:在我的 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.

The code it is referencing to is the following, line 17 is ([key: data-${string} ]: string;):它引用的代码如下,第 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;
}

My tslint.json looks like this, what am I missing?我的 tslint.json 看起来像这样,我错过了什么?

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

I faced similar issue and I upgraded the typescript in my package to 4.7.4 (latest version) and it worked我遇到了类似的问题,我将我的 package 中的 typescript 升级到 4.7.4(最新版本)并且它工作

"typescript": "^4.7.4"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM