useRequiredScripts
Ce contenu n’est pas encore disponible dans votre langue.
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/useRequiredScripts - This rule doesn’t have a fix.
- The default severity of this rule is information.
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useRequiredScripts": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”{ "linter": { "rules": { "nursery": { "useRequiredScripts": { "options": { "requiredScripts": [ "test", "build" ] } } } } }}{ "scripts": { "test": "vitest" }}{ "scripts": { "test": "vitest", "build": "tsc" }}Options
Section titled “Options”requiredScripts
Section titled “requiredScripts”An array of script names that must be present in the scripts section of package.json.
Default: [] (no scripts required)
Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.