Skip to content

Hex literal uppercase issues with eslint --fix in Astro scripts #836

@Liumingxun

Description

@Liumingxun

Describe the bug

When running eslint --fix on an Astro project, there are two issues with hex literal uppercase handling:

  • In code fence scripts, lowercase hex literals are incorrectly fixed.

  • In client scripts, circular fixes occur.

I checked with the eslint config inspector; unicorn/number-literal-case should handle them uniformly as uppercase.


Additional details

When switching to pnpm as the package manager, circular fixes no longer occur. However, hex literals are still fixed to lowercase by the prettier-related rules.

Reproduction

https://stackblitz.com/~/github.com/Liumingxun/hex-literal-issues

System Info

System:
    OS: Linux 6.6 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
    Memory: 1.84 GB / 7.71 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 24.14.0 - /home/limx/.local/share/pnpm/node
    npm: 11.9.0 - /home/limx/.local/share/pnpm/npm
    pnpm: 10.32.1 - /home/limx/.local/share/pnpm/pnpm
    bun: 1.3.11 - /home/limx/.bun/bin/bun
    Deno: 2.7.5 - /home/limx/.deno/bin/deno



{
  "dependencies": {
    "astro": "^6.0.7"
  },
  "devDependencies": {
    "@antfu/eslint-config": "^7.7.3",
    "astro-eslint-parser": "^1.3.0",
    "eslint": "^10.0.3",
    "eslint-plugin-astro": "^1.6.0",
    "eslint-plugin-format": "^2.0.1",
    "prettier-plugin-astro": "^0.14.1"
  }
}

Used Package Manager

bun

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions