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

check-pipe totally broken #365

Closed
Martin-Luft opened this issue Jul 4, 2017 · 17 comments · Fixed by #405
Closed

check-pipe totally broken #365

Martin-Luft opened this issue Jul 4, 2017 · 17 comments · Fixed by #405
Assignees
Labels

Comments

@Martin-Luft
Copy link
Contributor

Since 3.1.2 check-pipe is totally broken.

<div *ngIf="countingPoints$ | async as countingPoints; else countingPoinsAreLoading">
  {{countingPoints}}
</div>
<ng-template #countingPoinsAreLoading>loading</ng-template>

ERROR: XXX.component.html[2, 13]: The pipe operator should be surrounded by one space on each side, i.e. " | ".

@mgechev
Copy link
Owner

mgechev commented Jul 4, 2017

Thanks for reporting the issue. There are two issues in this case:

  • The warning is reported for code having a valid style.
  • The warning is reported on incorrect location.

I'll push a fix in upcoming releases.

@willgm
Copy link

willgm commented Jul 5, 2017

Similar error here:

ERROR: /home/willgm/proj/jexia-webapp/src/app/project/project-features/project-features.component.html[1, 25]: The property "async" that you're trying to access does not exist in the class declaration.

For this line:

<div *ngIf="(currentProject | async).ui.features as features">

@mgechev
Copy link
Owner

mgechev commented Jul 5, 2017

@willgm not a related issue. Please, take a look at the search and also #264.

@willgm
Copy link

willgm commented Jul 5, 2017

@mgechev, sorry, but I can't see how this error is related to this issue. Can you explain?

I searched a little more, looks like there are other issues more likely to math the errors above: #190 and angular/angular-cli/issues/6554

This issue appeared after I updated from 3.0.1 to 3.1.0 or 3.0.2:

~/proj/jexia-webapp [work ~2 *] » npm i -D codelyzer@3.1.0                              willgm@localhost
+ codelyzer@3.1.0
updated 1 package in 4.362s
---------------------------------------------------------------------
~/proj/jexia-webapp [work ~2 *] » npm run lint                                          willgm@localhost

> web-app@0.0.3-alpha lint /home/willgm/proj/jexia-webapp
> ng lint --type-check


ERROR: /home/willgm/proj/jexia-webapp/src/app/project/project-features/project-features.component.html[1, 2]: The property "async" that you're trying to access does not exist in the class declaration.
ERROR: /home/willgm/proj/jexia-webapp/src/app/project/project-features/project-features.component.html[55, 34]: The property "async" that you're trying to access does not exist in the class declaration.

Lint errors found in the listed files.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! web-app@0.0.3-alpha lint: `ng lint --type-check`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the web-app@0.0.3-alpha lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/willgm/.npm/_logs/2017-07-05T18_17_21_680Z-debug.log
---------------------------------------------------------------------
~/proj/jexia-webapp [work ~2 *] » npm i -D codelyzer@3.0.1                              willgm@localhost
+ codelyzer@3.0.1
updated 1 package in 4.294s
---------------------------------------------------------------------
~/proj/jexia-webapp [work ~2 *] » npm run lint                                          willgm@localhost

> web-app@0.0.3-alpha lint /home/willgm/proj/jexia-webapp
> ng lint --type-check



All files pass linting.

@wKoza
Copy link
Collaborator

wKoza commented Jul 5, 2017

@willgm Perharps, you should simply drop rule no-access-missing-member ?

@willgm
Copy link

willgm commented Jul 5, 2017

@wKoza, now I got it, thanks! 🎉

@brian428
Copy link

Does anyone know if there's a way to disable this rule just for the templates that have the problem? I'd like to avoid just turning off the whole rule, since it only seems to fail in some limited situations (async pipe, inherited properties, etc.).

@mgechev
Copy link
Owner

mgechev commented Jul 12, 2017

You can disable the rule for the entire file by /* tslint:disable:rule1 rule2 rule3... */. In case the warning is in an external template, place the comment in the component file which references it.

@brian428
Copy link

Thanks, I was thinking it needed to go in the actual HTML somehow. I'll try it on the component itself.

@BorntraegerMarc
Copy link

Same thing in an HTML. This works:

<paper-item class="menu-item mi-new-task komed-menu-item" (click)="addNewTask()">{{ 'task.addTask' | translate }}</paper-item>

this generates an error:

<paper-item class="menu-item mi-new-task komed-menu-item" (click)="addNewTask()">
    {{ 'task.addTask' | translate }}
</paper-item>

this is the error: The pipe operator should be surrounded by one space on each side, i.e. " | ".
do you know when you can release a fix for this? My CI is broken because of this...

@mgechev
Copy link
Owner

mgechev commented Jul 25, 2017

You can disable the rule for now until we fix the issue.

@BorntraegerMarc
Copy link

How do I disable it?

@wKoza
Copy link
Collaborator

wKoza commented Jul 26, 2017

you should simply drop option check-pipe in your tslint file

@BorntraegerMarc
Copy link

@mgechev could you publish an update with this guy so we can get a clean CI build again? :)

@mgechev
Copy link
Owner

mgechev commented Sep 8, 2017

Yes, I'll do over the weekend. Will also do some dogfooding to verify that everything is fine.

@BorntraegerMarc
Copy link

BorntraegerMarc commented Sep 15, 2017

@mgechev the issue seems not to be resolved for me:

D:\projects\komed-health-web>ng lint
ERROR: src/app/chat/chat.component.html[22, 43]: The pipe operator should be surrounded by one space on each side, i.e. " | ".

D:\projects\komed-health-web>ng --version
@angular/cli: 1.4.2

this is the HTML code:

<paper-item>
    {{ 'chat.switchToDe' | translate }}
</paper-item>

from package.json:

"codelyzer": "3.2.0",

@wKoza
Copy link
Collaborator

wKoza commented Sep 16, 2017

Closed and reported to #416

Repository owner locked and limited conversation to collaborators Sep 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants