Skip to content

feat(format): add code formatting #200

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

Merged
merged 1 commit into from
Feb 17, 2016

Conversation

filipesilva
Copy link
Contributor

Close #143

@filipesilva filipesilva force-pushed the ng-format-command branch 3 times, most recently from b437e74 to bd7edef Compare February 16, 2016 18:09
@hansl
Copy link
Contributor

hansl commented Feb 17, 2016

LGTM.

@filipesilva filipesilva merged commit 1f89a2b into angular:master Feb 17, 2016

var Promise = require('ember-cli/lib/ext/promise');
var Task = require('ember-cli/lib/models/task');
var exec = Promise.denodeify(require('child_process').exec);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOC, couldn't Promise and exec be imported when the task is run (so that addon/ng2/index.js "loads" faster) ?
(I guess they are already imported elsewhere, so it won't make any real difference, but wouldn't it theoretically be better ?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose, in the case where they are first imported here, it would be faster, yes.

Leaving them at the top seems to be the normal usage pattern, and it's also a bit more forwards compatible with the ES6 mindset. I'm also not a big fan of conditional imports myself, they're sometimes hard to find, test and debug.

Come to think of it, I remember reading they opted with toplevel imports for a number of reasons that were meant to get around problems with node's modules system.

I don't see much advantage in this case to only requiring them when the task is run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it was more of a theoretical question, because they are surely already imported elsewhere.
Thx for the response.

I'm also not a big fan of conditional imports myself

Interesting (considering how chalk is imported below)... 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes - guilty as charged. I copy pasted an existing task and took it down to it's bare minimum. The chalk require was there as is, and me not being fully knowledgeable of ember-cli, simply left it.

@filipesilva filipesilva deleted the ng-format-command branch June 13, 2016 16:12
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a formatter/beautifier command
3 participants