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

Feature request: Group scripts #13

Open
jhnns opened this issue Feb 14, 2020 · 2 comments · May be fixed by #38
Open

Feature request: Group scripts #13

jhnns opened this issue Feb 14, 2020 · 2 comments · May be fixed by #38
Assignees
Labels
enhancement New feature or request

Comments

@jhnns
Copy link
Member

jhnns commented Feb 14, 2020

It would be nice to have a linting rule that enforces to group scripts.

I want this:

    "scripts": {
		"test": "jest",
		"test:lint": "eslint *.js src --ext ts",
		"posttest": "run-p test:lint",
		"build": "tsc -p ./tsconfig.build-cjs.json",
		"build:cleanup": "rimraf build-cjs build-esm",
		"update:psl-fixture": "ts-node --transpile-only ./src/scripts/update-psl-fixture.ts",
		"update:tries": "ts-node --transpile-only ./src/scripts/update-tries.ts",
		"update:dependencies": "updtr"
	},

instead of:

    "scripts": {
		"test:lint": "eslint *.js src --ext ts",
		"test": "jest",
		"posttest": "run-p test:lint",
		"update:dependencies": "updtr"
		"build:cleanup": "rimraf build-cjs build-esm",
		"build": "tsc -p ./tsconfig.build-cjs.json",
		"update:psl-fixture": "ts-node --transpile-only ./src/scripts/update-psl-fixture.ts",
		"update:tries": "ts-node --transpile-only ./src/scripts/update-tries.ts",
	},
  • All scripts with the same prefix should be grouped together
  • If there is a "parent" script (like build for all build:* scripts), it should be above all child scripts

Challenges

  • pretest/posttest and maybe some other npm scripts don't fit into that scheme. Nevertheless it would be nice to have them grouped with the test scripts. pretest should also be above test, posttest should be below test
@moritzjacobs
Copy link
Collaborator

I like the idea!

@moritzjacobs moritzjacobs added the enhancement New feature or request label Feb 14, 2020
@moritzjacobs moritzjacobs self-assigned this Sep 18, 2020
@moritzjacobs moritzjacobs linked a pull request Sep 18, 2020 that will close this issue
@moritzjacobs
Copy link
Collaborator

Implemented in #38 – maybe you want to review it, @jhnns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants