-
Notifications
You must be signed in to change notification settings - Fork 16
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
module cleanup and ngdoc #26
base: master
Are you sure you want to change the base?
Conversation
why? there was an intention about having the module configuration at the bottom:
both reasons are open for discussion but i don't see why we would need to change this |
I see your points
In Javascript is does not matter if a function is defined before or after it is used if it is within the same scope. I prefer it to have it on top, to easily see the module definition and its dependencies (like in other programming languages, where the imports/dependencies are always on top)
this meta information is not very big (usually just some lines), but important. having to scroll to the bottom of the file is to "find" the declaration is in my eyes not very convenient. This is why I think it is better to have them on top instead at the bottom. |
i know that js dosn't care, but i do it is even checked via jshint please ensure that you have jshint enabled |
to ensure all changes adhere to the jshint config i just included it into the build pipeline |
ping |
I agree, but for sure this is a matter of what you're used to see and a matter of personal subjective preference. In this sense, for me: The "metadata" is the first thing I'd want to see in an angular file: What is this file doing in my code? Is this a service/factory/controller/directive? Under what name can I use it? How it is implemented is something I'd might want to know afterwards, in the knowledge of what it is. Ad JSHint: True but it's an optional check. You can disable it with |
of course it is, JSHint is optional in general I could just remove it completely, but it is here for a reason and I won't change the configuration you can configure it however you want in your codebase, but if you contribute to a open source project you have to follow their rules, not your own therefor this point is not open for discussion |
module definitions are always on top and also all dependencies ("imports")