Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in pagination typescript description when strictNullChecks set to true #4848

Closed
sherlock1982 opened this issue Nov 27, 2018 · 8 comments

Comments

@sherlock1982
Copy link
Contributor

Bug description or feature request:

3.1.2 can not be compiled.

ERROR in node_modules/ngx-bootstrap/pagination/models/index.d.ts(2,5): error TS2411: Property 'align' of type 'boolean | undefined' is not assignable to string index type 'string | number
| boolean'.

align? should be boolean or index should allow boolean?

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 3.1.2

Angular: 7.0.4
Bootstrap: 3.3.7

Build system: Angular CLI, System.js, webpack, starter seed:

AngularClass

@jmwierzbicki
Copy link

how this could even pass tests?

@Domainv
Copy link
Contributor

Domainv commented Nov 28, 2018

@sherlock1982 Please provide some small repo of reproduction

@sherlock1982
Copy link
Contributor Author

Sorry, for now I don't have enough time to make a repo. I will do a bit later but here are the contents of node_modules/ngx-bootstrap/pagination/models/index.d.ts right after I install 3.1.2:

export interface ConfigModel {
    align?: boolean;
    boundaryLinks: boolean;
    directionLinks: boolean;
    firstText: string;
    itemsPerPage: number;
    lastText: string;
    maxSize: number;
    nextText: string;
    pageBtnClass: string;
    previousText: string;
    rotate: boolean;
    [key: string]: string | number | boolean;
}

align? can't be used together with [key: string]: string | number | boolean;. This is quite clear to typescript compiler 3.1.6

@sherlock1982
Copy link
Contributor Author

Ok here it is:

https://github.com/sherlock1982/ngx-bootstrap-ts

Fails when strictNullChecks set to true

@Domainv
Copy link
Contributor

Domainv commented Nov 28, 2018

@sherlock1982 Thanks a lot, will be updated to support the option.

@Domainv Domainv changed the title Error in pagination typescript description Error in pagination typescript description when strictNullChecks set to true Nov 28, 2018
@sherlock1982
Copy link
Contributor Author

I suggest to simply do everything with strict: true if it's possible.

@Domainv
Copy link
Contributor

Domainv commented Nov 28, 2018

@sherlock1982 I agree

@valorkin
Copy link
Member

I thought I enabled this flag when Angular added support for it, hm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants