跳转到内容

JSON Rules

此内容尚不支持你的语言。

Below the list of rules supported by Biome, divided by group. Here’s a legend of the emojis:

  • The icon indicates that the rule is part of the recommended rules.
  • The icon indicates that the rule provides a code action (fix) that is safe to apply.
  • The icon indicates that the rule provides a code action (fix) that is unsafe to apply.
  • The icon indicates that the rule has been implemented and scheduled for the next release.
Rule name Description Properties
noJsonUnsafeValues Disallow unsafe JSON values that may cause interoperability issues.
noRestrictedDependencies Disallow dependencies that are known to have better alternatives.
useConsistentObjectKeys Enforce JSON keys with consistent Unicode representation.
useConsistentUnicodeBom Require or disallow a Unicode byte order mark at the beginning of a file.
usePackageJsonCpu Require the cpu field in package.json.
usePackageJsonEngines Require the engines field in package.json.
usePackageJsonValidCpu Require the cpu field in package.json to be a valid list of processor types.
usePackageJsonValidEngines Enforce that the engines field in package.json is valid.
Rule name Description Properties
noTopLevelLiterals Require the JSON top-level value to be an array or object.
Rule name Description Properties
noBiomeFirstException Disallow ineffective ordering in files.includes patterns.
noDuplicateDependencies Disallow duplicate dependencies in package.json.
noDuplicateObjectKeys Disallow duplicate keys in JSON objects.
noEmptyObjectKeys Disallow empty keys in JSON objects.
noQuickfixBiome Disallow quickfix.biome in supported editor settings.
noUntrustedLicenses Disallow dependencies with untrusted licenses.
useBiomeIgnoreFolder Prefer folder exclusions that prevent Biome from scanning the folder.
useRequiredScripts Require configured scripts in package.json.

Missing a rule? Help us by contributing to the analyzer or create a rule suggestion here.