jQWidgets Forums

jQuery UI Widgets Forums Angular Using compiler option –noImplicitAny

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Ivo Zhulev 8 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Using compiler option –noImplicitAny #89892

    Alexander Lanz
    Participant

    Hello,

    I’m not able to use JQWidgets, using the mentioned compiler switch:
    “–noImplicitAny” is a recommended TypeScript compiler option. It makes sure that all variables are declared with a specific type, and no implicit any declarations are allowed. Therefore an error is thrown by the compiler if it occurs in the TypeScript source.

    Unfortunately the TypeScript part of JQWidgets contains lots of implicit any’s which results in “type-unsafe” code.
    For example when importing jqxButtonComponent:

    import { jqxButtonComponent } from "jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons";

    I get following errors:

    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(12,4): error TS7008: Member 'attrDelay' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(13,4): error TS7008: Member 'attrDisabled' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(14,4): error TS7008: Member 'attrImgSrc' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(15,4): error TS7008: Member 'attrImgWidth' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(16,4): error TS7008: Member 'attrImgHeight' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(17,4): error TS7008: Member 'attrImgPosition' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(18,4): error TS7008: Member 'attrRoundedCorners' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(19,4): error TS7008: Member 'attrRtl' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(20,4): error TS7008: Member 'attrTextPosition' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(21,4): error TS7008: Member 'attrTextImageRelation' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(22,4): error TS7008: Member 'attrTheme' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(23,4): error TS7008: Member 'attrTemplate' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(24,4): error TS7008: Member 'attrToggled' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(25,4): error TS7008: Member 'attrValue' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(26,4): error TS7008: Member 'attrWidth' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(27,4): error TS7008: Member 'attrHeight' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(30,4): error TS7008: Member 'host' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(38,16): error TS7006: Parameter 'changes' implicitly has an 'any' type.
    [0] node_modules/jqwidgets-framework/jqwidgets-ts/angular_jqxbuttons.ts(266,30): error TS7006: Parameter 'eventData' implicitly has an 'any' type.

    Is there a recommendation how to use JQWidgets in a surrounding where type-safety with “–noImplicitAny” is to be maintained?

    Do you plan to release a type-safe version of JQWidgets? Or at least one with explicit ‘any’?

    regards,
    Alexander

    Using compiler option –noImplicitAny #89956

    Ivo Zhulev
    Participant

    Hi Alexander Lanz,

    As said in the Angular2 TypeScript config the noImplicitAny flag is arbitrarily:

    “TypeScript developers disagree about whether the noImplicitAny flag should be true or false.
    There is no correct answer and you can change the flag later.”

    But we will consider making jQWidgets fully type-safe.
    Thanks for the feedback.

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.