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
Contributions
Describe the bug
When running
eslint --fixon 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-caseshould handle them uniformly as uppercase.Additional details
When switching to
pnpmas 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
Contributions