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

Small aliases refactor. #2236

Merged
merged 1 commit into from
Dec 13, 2016
Merged

Conversation

skratchdot
Copy link
Contributor

I'm working on some code, and rather than including all my commits in one PR, I'd like to separate a few of the smaller, non-related fixes into their own PR's (for easier review).

Summary

Locally, I've upgraded my eslint versions, and the current aliases file throws lint errors due to the sort-keys rule. This commit fixes the errors by sorting all our keys. I kept the shorthands vs affordances separation by using 2 variables and the object spread syntax in the exported value.

Test plan

  1. I made my changes then ran yarn build
  2. I ran ./bin/yarn ls and a few other of the alias commands.
  3. Confirmed that the behavior is the same before and after my changes.
  4. Run yarn test
  5. Confirm __tests__/cli/aliases.js has no errors
  6. open ./coverage/lcov-report/index.html
  7. Confirm that the coverage for src/cli/aliases.js is still 100%

* fix eslint `sort-keys` rule

* seperate shorthands and affordances
@skratchdot
Copy link
Contributor Author

NOTE: I didn't remove any values, all I did was re-order them. I also updated the flow syntax so the "string" values aren't optional. I can't ever see us adding an alias to a non-string command.

@bestander
Copy link
Member

I don't think @kittens wanted to overload number of aliases for commands and I agree with him.
For example yarn list is short enough and if you use it a lot, it is easy to create your own shortcut on OS level.

@skratchdot
Copy link
Contributor Author

@bestander - it still doesn't let you run yarn ls, it'll throw the error message: did you mean yarn list per:
https://github.com/yarnpkg/yarn/blob/master/src/cli/index.js#L126-L134

All I did was fix an eslint warning (which will happen if we ever upgrade our eslint versions).

@rjpcasalino
Copy link

@skratchdot I'm a fan of getting yarn i for install and was literally just thinking of adding that this morning. Anyway, thanks!

@bestander
Copy link
Member

Ah, thanks for clearing up, @skratchdot!
Thanks.

@bestander bestander merged commit 85026be into yarnpkg:master Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants