-
Notifications
You must be signed in to change notification settings - Fork 235
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
Ionic 2 Support #132
Comments
I think it would be a great addition to let user's configure an optional regex that is used to test all naming conventions that Codelyzer checks. Then for your code you could allow either Component or Page. Some other people may have other conventions they want to allow. (for example we would like to allow "Panel" for some types of components) |
This rule can be made configurable and by default the suffix will be |
Thanks! Will follow this then. 👍 |
Great! Thanks for all your work on this project |
Can you confirm that currently (beta3) it's not possible to specify an array of suffixes in tslint.json ? I saw there was a more recent commit allowing this. Thanks |
Beta3 doesn't support multiple suffixes. Yes, master is usually stable so you can give it a try. |
@mgechev so this will support an array of suffixes? Thanks you. 👍 |
Yes, master does. |
I think README.md should be updated with an example for using both, the single syntax and the array syntax, or at least mention it. :). Do you mind if I do it? |
Reviewing this now, and still the docs lacks of examples of how to pass an array. Even the JSON Schema is lacking this options, throwing warnings in the |
The JSON schema in maintained by third--party. I opened a PR sometimes back, at some point it will go upstream. It'll be great if you open a PR with docs improvement. |
I was just doing that, but found the actual documentation. I think that maybe the problem. As is right now it seems like all the docs are in README, cause there is no link to the documentation, nor a mention of it. Maybe less information of usage in README and instead a link to the docs? |
http://codelyzer.com/rules/ generated from the source code. |
I have been using Codelyzer with an Ng2 project and loving it. I have started an Ionic 2 project that uses Codelyzer and it works almost perfectly except for an issue with pages. In Ionic the Component decorator is used for pages but the class name is suffixed with "Page." For example the file hello-ionic.page.ts would be:
This causes Codelyzer to state that "The name of the class HelloIonicPage should end with the suffix Component".
Changing componentClassSuffixRule.js line 16 from:
to
Fixes the problem but I figure there is probably a more elegant solution. In Ionic projects there will still be components so is there a way of discerning between a page and component based on location (src/pages/* vs srv/components/*)? Or allowing custom component suffixes in the rules config?
The text was updated successfully, but these errors were encountered: