-
-
Notifications
You must be signed in to change notification settings - Fork 792
Labels
A-LinterArea: linterArea: linterD-ReactDomain: ReactDomain: ReactL-JavaScriptLanguage: JavaScript and super languagesLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug
Description
Environment information
CLI:
Version: 1.9.4
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_CONFIG_PATH: unset
NO_COLOR: unset
TERM: "xterm-256color"
JS_RUNTIME_VERSION: unset
JS_RUNTIME_NAME: unset
NODE_PACKAGE_MANAGER: unset
Biome Configuration:
Error: Found an unknown key `assist`.
Error: Found an unknown key `includes`.
Error: Found an unknown key `includes`.
Error: Found an unknown key `noVar`.
Error: Found an unknown key `noImportCycles`.
Error: Found an unknown key `plugins`.
Status: Loaded with errors
Formatter disabled: false
Linter disabled: false
Organize imports disabled: false
VCS disabled: false
Formatter:
Format with errors: false
Indent style: Tab
Indent width: 2
Line ending: Lf
Line width: 80
Attribute position: Auto
Bracket spacing: BracketSpacing(true)
Ignore: []
Include: []
JavaScript Formatter:
Enabled: true
JSX quote style: Double
Quote properties: AsNeeded
Trailing commas: All
Semicolons: Always
Arrow parentheses: Always
Bracket spacing: unset
Bracket same line: false
Quote style: Double
Indent style: unset
Indent width: unset
Line ending: unset
Line width: unset
Attribute position: unset
JSON Formatter:
Enabled: false
Indent style: Space
Indent width: unset
Line ending: unset
Line width: 1
Trailing Commas: unset
CSS Formatter:
Enabled: true
Indent style: unset
Indent width: unset
Line ending: unset
Line width: unset
Quote style: Double
GraphQL Formatter:
Enabled: false
Indent style: unset
Indent width: unset
Line ending: unset
Line width: unset
Bracket spacing: unset
Quote style: unset
Workspace:
Open Documents: 0Rule name
useHookAtTopLevel
Playground link
Expected result
React Components should be linted conditions following below
- Component with forwaredRef
- Component with memo
const TestMemo = memo(
forwardRef((props, ref) => {
useEffect(() => {
const [test, setTest] = useState(1);
}, []);
return <div ref={ref}>test</div>;
})
);
const TestForwardRef = forwardRef((props, ref) => {
useEffect(() => {
const [test, setTest] = useState(1);
}, []);
return <div ref={ref}>test</div>;
});above both cases should be cause the lint error below
| Expect | Result |
|---|---|
![]() |
![]() |
Code of Conduct
- I agree to follow Biome's Code of Conduct
Metadata
Metadata
Assignees
Labels
A-LinterArea: linterArea: linterD-ReactDomain: ReactDomain: ReactL-JavaScriptLanguage: JavaScript and super languagesLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug

