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

Why is the pipe-naming rule deprecated? #519

Closed
yannickglt opened this issue Feb 19, 2018 · 7 comments
Closed

Why is the pipe-naming rule deprecated? #519

yannickglt opened this issue Feb 19, 2018 · 7 comments

Comments

@yannickglt
Copy link

Hey!
Sorry to create an issue to ask such a question but I could not find any answer on the repo or in the doc.
I saw that the pipe-naming rule was deprecated in the Readme. Could you tell me what's the reason and if it was replaced with another rule?
Thanks

@mgechev
Copy link
Owner

mgechev commented Feb 19, 2018

You can name your pipes only camel case if you try to use snake-case then your application will not compile. This is a compile-time error, not a linting one. The alternative is to use AoT.

If there are a lot of people who want to keep this rule, we can. We haven't had issues with it recently and it doesn't cost us anything to not drop it.

@yannickglt
Copy link
Author

Thanks for your quick answer!

Good to learn that there's a compile error now.

I mainly wanted to know if the practices about prefixing pipes have changed. If it is not a good practice anymore then I guess the rule is not useful anymore.

@mgechev
Copy link
Owner

mgechev commented Feb 22, 2018

It's still considered a good practice. Prefixing will not be caught by the compiler thought.

@yannickglt
Copy link
Author

Great. Thank you!

@emilio-martinez
Copy link

@mgechev is there a replacement for checking that the Pipe names are prefixed accordingly?

"pipe-naming": [true, "camelCase", "app"]
                                     ^

hlovdal added a commit to hlovdal/nativescript-angular that referenced this issue Jun 21, 2020
hlovdal added a commit to hlovdal/nativescript-angular that referenced this issue Jun 21, 2020
A couple of rules were deleted in pull request 2179, but they were
actually just renamed and not depricated.

Some details:
mgechev/codelyzer#519
mgechev/codelyzer#791
hlovdal added a commit to hlovdal/nativescript-angular that referenced this issue Jun 21, 2020
A couple of rules were deleted in pull request 2179, but they were
actually just renamed and not deprecated.

Some details:
mgechev/codelyzer#519
mgechev/codelyzer#791
@georgms
Copy link

georgms commented Jan 11, 2021

Sorry for resurrecting this but I can still do:

@Pipe({ name: 'underscore_name' })
export class UnderscoreNamePipe implements PipeTransform {}

But according to the Angular style guide pipe name strings should use lowerCamelCase, ie. @Pipe({ name: 'underscoreName' }).

How can I enforce lowerCamelCase for pipe names?

@mgechev
Copy link
Owner

mgechev commented Jan 18, 2021

I'd recommend opening an issue in angular-eslint. Codelyzer is now deprecated.

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