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

Package Scripts Order #19

Closed
reggi opened this issue Dec 11, 2017 · 2 comments
Closed

Package Scripts Order #19

reggi opened this issue Dec 11, 2017 · 2 comments

Comments

@reggi
Copy link

reggi commented Dec 11, 2017

In my "scripts" I am seeing this order:

    "test": "jest",
    "posttest": "npm run lint",
    "test:update": "jest -u"

Why isn't this alphabetical?

@keithamus
Copy link
Owner

Hey @reggi thanks for the issue.

post* and pre* scripts have specific meaning for package.json - posttest in this case will run after test automatically. Because of this, it felt more intuitive to sort these not by alphabetical order, but to specifically order pre* scripts before * and post* scripts after *.

I'll close this because I think we're doing the right thing here. If you want to discuss it more we can, and I can always re-open the issue.

@waldyrious
Copy link

For future reference, this behavior has changed slightly in #49: now, the "pre" and "post" prefixes will only be treated specially if they're not followed by a - character (e.g. pre-foo won't be sorted at the start, while prefoo will).

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

No branches or pull requests

3 participants