Codelyzer: Why is the pipe-naming rule deprecated?

Created on 19 Feb 2018  路  7Comments  路  Source: mgechev/codelyzer

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

Most helpful comment

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

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

All 7 comments

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.

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.

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

Great. Thank you!

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

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

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?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

snebjorn picture snebjorn  路  5Comments

marbug picture marbug  路  3Comments

fabioemoutinho picture fabioemoutinho  路  5Comments

wesleycho picture wesleycho  路  3Comments

wKoza picture wKoza  路  6Comments