Skip to content

🐛 Setting rule's fix overrides the inheirited options from a shared config #7943

@Conaclos

Description

@Conaclos

Environment information

main branch

What happened?

Given the following shared configuration:

{
  "linter": {
    "enabled": true,
    "rules": {
      "style": {
        "useNamingConvention": {
          "level": "on",
          "options": {
            "conventions": [{
              "selector": { "kind": "variable", "scope": "global" },
              "formats": ["CONSTANT_CASE"]
            }]
          }
        }
      }
    }
  }
}

If a user extends this configuration and set only the fix of the rule, then the inherited options is overrided by the default rule options.

{
  "extends": ["shared.json"],
  "linter": {
    "enabled": true,
    "rules": {
      "style": {
        "useNamingConvention": {
          "level": "on",
          "fix": "none"
        }
      }
    }
  }
}

This basically results in the following merged config:

{
  "extends": ["shared.json"],
  "linter": {
    "enabled": true,
    "rules": {
      "style": {
        "useNamingConvention": {
          "level": "on",
          "fix": "none",
          "options": {}
        }
      }
    }
  }
}

Expected result

The merged configuration should be:

{
  "extends": ["shared.json"],
  "linter": {
    "enabled": true,
    "rules": {
      "style": {
        "useNamingConvention": {
          "level": "on",
          "fix": "none",
          "options": {
            "conventions": [{
              "selector": { "kind": "variable", "scope": "global" },
              "formats": ["CONSTANT_CASE"]
            }]
          }
        }
      }
    }
  }
}

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AnalyzerArea: analyzerA-LinterArea: linterS-Bug-confirmedStatus: report has been confirmed as a valid bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions