Upgrading Biome from 1.5 to 1.6 Caused 'Found an unknown key' Error

Problem Encountered

After updating Biome from version 1.5 to 1.6 and running lint, the following error occurred:

Found an unknown key `noUnusedImports`.

Cause

The part of the biome.json file before the Biome update was as follows:

{
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "nursery": {
        "noUnusedImports": "error"
      }
    }
  }
}

According to the Biome CHANGELOG, from 1.6.0, noUnusedImports was promoted from nursery to correctness.

Solution

By changing the rule for noUnusedImports as shown below, it became possible to run lint as before.

{
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "correctness": {
        "noUnusedImports": "error"
      }
    }
  }
}

By the way, besides noUnusedImports, other rules that were promoted this time include:

Related Posts