Back to Biomejs

JSON Rules

src/content/docs/linter/json/rules.mdx

latest4.2 KB
Original Source

import { Icon } from "@astrojs/starlight/components";

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

  • The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle" label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
  • The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is safe to apply.
  • The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is unsafe to apply.
  • The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.

nursery

Rule nameDescriptionProperties
noEmptyObjectKeysDisallow empty keys in JSON objects.<span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" size="1.2rem" /></span>
noTopLevelLiteralsRequire the JSON top-level value to be an array or object.<span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" size="1.2rem" /></span>
useRequiredScriptsEnforce the presence of required scripts in package.json.

suspicious

Rule nameDescriptionProperties
noBiomeFirstExceptionPrevents the misuse of glob patterns inside the files.includes field.<span class='inline-icon' title="This rule is recommended" ><Icon name="approve-check-circle" size="1.2rem" label="This rule is recommended" /></span><span class='inline-icon' title='The rule has a safe fix.'><Icon name="seti:config" label="The rule has a safe fix" size="1.2rem" /></span>
noDuplicateDependenciesPrevent the listing of duplicate dependencies.
noDuplicateObjectKeysDisallow two keys with the same name inside objects.<span class='inline-icon' title="This rule is recommended" ><Icon name="approve-check-circle" size="1.2rem" label="This rule is recommended" /></span>
noQuickfixBiomeDisallow the use if quickfix.biome inside editor settings file.<span class='inline-icon' title="This rule is recommended" ><Icon name="approve-check-circle" size="1.2rem" label="This rule is recommended" /></span><span class='inline-icon' title='The rule has a safe fix.'><Icon name="seti:config" label="The rule has a safe fix" size="1.2rem" /></span>
useBiomeIgnoreFolderPromotes the correct usage for ignoring folders in the configuration file.<span class='inline-icon' title="This rule is recommended" ><Icon name="approve-check-circle" size="1.2rem" label="This rule is recommended" /></span><span class='inline-icon' title='The rule has a safe fix.'><Icon name="seti:config" label="The rule has a safe fix" size="1.2rem" /></span>

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