Pular para o conteúdo

useRequiredScripts

Este conteúdo não está disponível em sua língua ainda.

biome.json
{
"linter": {
"rules": {
"nursery": {
"useRequiredScripts": "error"
}
}
}
}

Enforce the presence of required scripts in package.json.

This rule ensures that specified scripts are defined in the scripts section of a package.json file. It’s particularly useful in monorepo environments where consistency across workspaces is important.

Without required scripts configured, this rule doesn’t do anything.

biome.json
{
"linter": {
"rules": {
"nursery": {
"useRequiredScripts": {
"options": {
"requiredScripts": [
"test",
"build"
]
}
}
}
}
}
}
{
"scripts": {
"test": "vitest"
}
}
{
"scripts": {
"test": "vitest",
"build": "tsc"
}
}

An array of script names that must be present in the scripts section of package.json. Default: [] (no scripts required)