microsoft / vsts-extension-samples

Sample extensions for Visual Studio Team Services
https://docs.microsoft.com/vsts/extend/
MIT License
298 stars 292 forks source link

Samples error during build #77

Open tasadar2 opened 6 years ago

tasadar2 commented 6 years ago

Many of the typescript samples error during build. The project typescript files appear to output correctly, but the error will cause issues with most build pipelines. Is there a way around these errors? Is there an issue with the vss-web-extension-sdk?

Steps to reproduce

git clone https://github.com/Microsoft/vsts-extension-samples
cd vsts-extension-samples/build-inspector
npm install
npm run build

Error output

> build-inspector@1.0.0 build C:\Temp\vsts-extension-samples\build-inspector
> tsc -p .

node_modules/@types/react/index.d.ts(165,11): error TS2559: Type 'Component<P, S>' has no properties in common with type 'ComponentLifecycle<P, S>'.
node_modules/vss-web-extension-sdk/typings/vss.d.ts(3463,14): error TS2559: Type 'TemplateViewModel' has no properties in common with type 'EnhancementOptions'.
node_modules/vss-web-extension-sdk/typings/vss.d.ts(9965,14): error TS2415: Class 'ComboDateBehavior' incorrectly extends base class 'BaseComboBehavior'.
  Types of property 'getValue' are incompatible.
    Type '() => Date' is not assignable to type '<TValue>() => TValue'.
      Type 'Date' is not assignable to type 'TValue'.
node_modules/vss-web-extension-sdk/typings/vss.d.ts(10050,14): error TS2415: Class 'ComboMultiValueBehavior' incorrectly extends base class 'ComboListBehavior'.
  Types of property 'getValue' are incompatible.
    Type '() => string[]' is not assignable to type '<TValue>() => TValue'.
      Type 'string[]' is not assignable to type 'TValue'.
node_modules/vss-web-extension-sdk/typings/vss.d.ts(10224,14): error TS2417: Class static side 'typeof DialogO' incorrectly extends base class static side 'typeof AjaxPanelO'.
  Types of property 'create' are incompatible.
    Type '<T extends Dialog>(dialogType: new (options: any) => T, options?: any) => T' is not assignable to type '<TControl extends Control<any>, TOptions>(controlType: new (options: TOptions) => TContr
ol, conta...'.
      Types of parameters 'dialogType' and 'controlType' are incompatible.
        Type 'new (options: TOptions) => TControl' is not assignable to type 'new (options: any) => Dialog'.
          Type 'TControl' is not assignable to type 'Dialog'.
            Type 'Control<any>' is not assignable to type 'Dialog'.
              Property '_specifiedMaxWidth' is missing in type 'Control<any>'.
src/inspector/associatedItems.ts(40,149): error TS2345: Argument of type '(build: Build) => Promise<any[]>' is not assignable to parameter of type '(value: Build) => void | [Build, Change[], WorkItem[]]
'.
  Type 'Promise<any[]>' is not assignable to type 'void | [Build, Change[], WorkItem[]]'.
    Type 'Promise<any[]>' is not assignable to type '[Build, Change[], WorkItem[]]'.
      Property '0' is missing in type 'Promise<any[]>'.
pabrams commented 6 years ago

I'm having a similar experience with the calendar-public-events extension. Setting typescript to 2.3.0 makes the problem go away: https://github.com/Microsoft/vss-web-extension-sdk/issues/50

ooten commented 6 years ago

I am having the same issues, and it isn't resolved with setting Typescript to 2.3.0.