microsoft / PowerBI-visuals-tools

Contains tools for building/packaging Power BI visuals
https://www.powerbi.com
MIT License
330 stars 149 forks source link

Getting TSLint Error when working with antdesign@4.22.3 #427

Closed lucmax94 closed 2 years ago

lucmax94 commented 2 years ago

Hi, within our visual we are currently updated the verison of antdesign to 4.22.3 so we can use the newest components. This causes the build to fail with the following errors:

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

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

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

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

The code in the Inputs.d.ts is the following, line 17 is the second last:

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

It looks like the typescript version within the visuals tools is not compatible with the needed one for the antdesign project. Is there a way to ignore these erros in the webpack build?

zBritva commented 2 years ago

You can use webpack without tools. See repository with plugin sources, where you can find instructions.

lucmax94 commented 2 years ago

Too bad I can't just go the pbi tools route, but it works now when I use webpack directly as you described, thanks