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

Enforce capitalization of imported module variable names #368

Merged
merged 1 commit into from Jun 9, 2015

Conversation

@cjihrig
Copy link
Contributor

cjihrig commented Jun 8, 2015

Per the style guide:

Use uppercase variable names for imported modules

lib/cli.js Outdated
@@ -102,7 +102,7 @@ internals.traverse = function (paths, options) {

global._labScriptRun = false;
file = Path.resolve(file);
var pkg = require(file);
var pkg = require(file); // eslint-disable-line hapi/hapi-capitalize-modules

This comment has been minimized.

Copy link
@hueniverse

hueniverse Jun 8, 2015

Member

Can't we only enforce this rule on module global variables?

This comment has been minimized.

Copy link
@cjihrig

cjihrig Jun 8, 2015

Author Contributor

I'll look into it. It should be possible by inspecting parent nodes.

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

cjihrig commented Jun 8, 2015

@hueniverse I added an option to the rule to only target assignments in the module's global scope.

@hueniverse

This comment has been minimized.

Copy link
Member

hueniverse commented Jun 8, 2015

@cjihrig that should be the default so we don't need all these exception comments above.

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

cjihrig commented Jun 9, 2015

Yep, it is now :-)

@geek geek added the feature label Jun 9, 2015
@geek geek added this to the 5.10.0 milestone Jun 9, 2015
@geek geek self-assigned this Jun 9, 2015
geek added a commit that referenced this pull request Jun 9, 2015
Enforce capitalization of imported module variable names
@geek geek merged commit 8a1f82e into hapijs:master Jun 9, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@cjihrig cjihrig deleted the cjihrig:lint-require branch Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.