Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyzer): ignore default exported function in useCamelCase #4424

Merged
merged 2 commits into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ output. [#4405](https://github.com/rome/tools/pull/4405)
when there are breaking changes.
- Fix [#4348](https://github.com/rome/tools/issues/4348) that caused [`noNonNullAssertion`](https://docs.rome.tools/lint/rules/nononnullassertion/) to emit incorrect code action
- Fix [#4410](https://github.com/rome/tools/issues/4410) that caused [`useButtonType`](https://docs.rome.tools/lint/rules/usebuttontype/) to miss some cases
- Fix false positive diagnostics that [`useCamelCase`](https://docs.rome.tools/lint/rules/usecamelcase/) caused to default exported components

### Configuration
### Editors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn is_non_camel_ok(binding: &JsIdentifierBinding, model: &SemanticModel) -> Opti
};
Some(is_ok)
}
JS_FUNCTION_DECLARATION => {
JS_FUNCTION_DECLARATION | JS_FUNCTION_EXPORT_DEFAULT_DECLARATION => {
if binding.is_exported(model) {
return Some(true);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// valid
function Component() {}
<Component>foo</Component>
<Component>foo</Component>
export function ExportComponent() {}
export default function ExportDefaultComponent() {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ expression: useCamelCase.jsx
// valid
function Component() {}
<Component>foo</Component>
export function ExportComponent() {}
export default function ExportDefaultComponent() {}

```