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

Linting issue blocking compile #11

Closed
retallicka opened this issue May 23, 2018 · 3 comments
Closed

Linting issue blocking compile #11

retallicka opened this issue May 23, 2018 · 3 comments

Comments

@retallicka
Copy link

retallicka commented May 23, 2018

I am using

  • cookie consent 3.0.6
  • ngx-cookie-consent 1.0.1
  • angular 5
  • angular-cli 1.7.4
  • typescript 2.6.2
  • tried tslint 3.7.0 and 3.80
    and couldn't seem to get this to compile.

I get this error on build that blocks compile. Any ideas?

ERROR in node_modules/ngx-cookieconsent/model/common-interfaces.d.ts(35,5): error TS2411: Property 'allow' of type '"allow" | undefined' is not assignable to string index type '"allow" | "deny" | "dismiss"'. node_modules/ngx-cookieconsent/model/common-interfaces.d.ts(36,5): error TS2411: Property 'deny' of type '"deny" | undefined' is not assignable to string index type '"allow" | "deny" | "dismiss"'. node_modules/ngx-cookieconsent/model/common-interfaces.d.ts(37,5): error TS2411: Property 'dismiss' of type '"dismiss" | undefined' is not assignable to string index type '"allow" | "deny" | "dismiss"'.

@Nolanus
Copy link
Contributor

Nolanus commented May 27, 2018

You shouldn't lint your node_modules directory, so this is a problem with your project setup.

@tinesoft
Copy link
Owner

tinesoft commented Jun 3, 2018

Hi @retallicka ,
Still having the issue? if yes, please post your tslint.json files and any other relevant angular cli project files that you modified (.angular-cli.json, ...). If you could add the link to your project, thad'd be even better.

@nicoraffin
Copy link

nicoraffin commented Dec 19, 2018

In common-interfaces.d.ts. I think that "undefined" is missing :

[key: string]: 'deny' | 'allow' | 'dismiss' | undefined;

/**
 * Interface representing the cookie consent status.
 */
export interface NgcCookieConsentStatus {
    [key: string]: 'deny' | 'allow' | 'dismiss' | undefined;
    allow?: 'allow';
    deny?: 'deny';
    dismiss?: 'dismiss';
}

Or

export interface NgcCookieConsentStatus {
    [key: string]: 'deny' | 'allow' | 'dismiss';
    allow: 'allow';
    deny: 'deny';
    dismiss: 'dismiss';
}

nicoraffin added a commit to nicoraffin/ngx-cookieconsent that referenced this issue Dec 21, 2018
See issue tinesoft#11.
Optional interface elements are blocking TypeScript compilation, string or undefined is not assignable to string index type string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants