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

Codelyzer hanging for "styles" attribute in Angular component #446

Closed
bthharper opened this issue Oct 25, 2017 · 5 comments
Closed

Codelyzer hanging for "styles" attribute in Angular component #446

bthharper opened this issue Oct 25, 2017 · 5 comments

Comments

@bthharper
Copy link

bthharper commented Oct 25, 2017

I am developing an application using @angular/cli 1.4.9 and @angular 4.4.x , but have encountered an issue running ng lint on the code recently. I've diagnosed this using tslint -c tslint.json .\src\some.component.ts which never returns.

I have traced this down to the following code snipet:

@Component({
  selector: 'div[some-component]',
template: `<ng-content></ng-content>`,
  styles: [
  `:host {
    display:        flex;
    flex:           1 100%;
    margin:         20px;"
  }`
  ],
  changeDetection: ChangeDetectionStrategy.OnPush
})

Specifically the styles options, if I remove this the above command succeeds.

I have played with different options in the tslint.json file, but find that many of them cause this not a specific one.

Is there anyway I can get diagnostic logging out to assist in this?

@bthharper
Copy link
Author

Okay, my mistake and I've worked out what was wrong with my code ... but it would be good if this was reported rather than causing the tool to hang.

I'd accidentally put a quote (") after the 20px;.

`:host {
    display:        flex;
    flex:           1 100%;
    margin:         20px;"
  }`

The typescript / angular compilers don't report this, but tslint fails.

@mgechev
Copy link
Owner

mgechev commented Oct 25, 2017

We can update the CSS parser that we use. Let's keep that open for now.

@mgechev mgechev added this to the 4.1.0 - Peter Naur milestone Nov 1, 2017
@listepo-alterpost
Copy link

Hi, any news?

@mgechev mgechev modified the milestones: 4.0.2 - Peter Naur, 4.0.3 - Manuel Blum Dec 21, 2017
@mgechev
Copy link
Owner

mgechev commented Dec 21, 2017

@HideDev I'll fix this as part of the next minor release.

@listepo-alterpost
Copy link

@mgechev thanks

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

3 participants