Skip to content

Feature request: Group scripts #13

@jhnns

Description

@jhnns

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions