-
-
Notifications
You must be signed in to change notification settings - Fork 664
Labels
A-CoreArea: coreArea: coreS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug
Description
Environment information
> biome rage --linter
CLI:
Version: 2.0.4
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_CONFIG_PATH: unset
BIOME_THREADS: unset
NO_COLOR: unset
TERM: xterm-256color
JS_RUNTIME_VERSION: v22.14.0
JS_RUNTIME_NAME: node
NODE_PACKAGE_MANAGER: yarn/1.22.22
Biome Configuration:
Status: Loaded successfully
Path: biome.json
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: false
Linter:
JavaScript enabled: unset
JSON enabled: unset
CSS enabled: unset
GraphQL enabled: unset
Recommended: unset
Enabled rules:
...
Workspace:
Open Documents: 0
Rule name
useUniqueElementIds
Playground link
Expected result
In the playground link, toggle Lint Rules from useUniqueElementIds
to recommended
. The error still remains.
I presume the React nursery rules should not be on by default, only the "recommended" ones.
https://biomejs.dev/linter/domains/#react-rules
Nursery error using default configs.
> biome lint index.jsx
index.jsx:2:9 lint/nursery/useUniqueElementIds
✖ id attribute should not be a static string literal. Generate unique IDs using useId().
1 │ function App() {
> 2 │ return <div id="foo" />
│ ^^^^^^^^^^^^^^^^
3 │ }
To fix, manually set:
- React domains to "recommended"
- Or nursery rules to "off"
// biome.json
{
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
"linter": {
"domains": { "react": "recommended" }, // Fix 1
"rules" : { "nursery": "off" } // Fix 2
}
}
Code of Conduct
- I agree to follow Biome's Code of Conduct
Metadata
Metadata
Assignees
Labels
A-CoreArea: coreArea: coreS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug