no-install-scripts

July 9, 2026 ยท View on GitHub

๐Ÿ“ Disallow install lifecycle scripts.

๐Ÿ’ผ This rule is enabled in the โœ… recommended config.

๐Ÿ’ก This rule is manually fixable by editor suggestions.

The preinstall, install, and postinstall lifecycle scripts run automatically when a package is installed. They are a recurring supply-chain attack vector (e.g. the Shai-Hulud and event-stream attacks executed code on install), so much so that npm v12 blocks them by default and pnpm, Yarn, and Bun already do.

This rule flags those scripts. If your package genuinely needs one (for example a native addon build), disable the rule for that file or line.

Examples

// โŒ
{
	"scripts": {
		"postinstall": "node ./scripts/setup.js"
	}
}
// โœ…
{
	"scripts": {
		"build": "tsc"
	}
}