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

fix(rome_js_analtzer): semantic analyzer handles ts export declaration clause correctly #4694

Merged
merged 2 commits into from
Jul 13, 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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ if no error diagnostics are emitted.

- Fix [noUndeclaredVariables](https://docs.rome.tools/lint/rules/noundeclaredvariables/)'s false positive diagnostics ([#4675](https://github.com/rome/tools/issues/4675))

The semantic analyzer no longer handles `this` reference identifier in the semantic analyzer.
The semantic analyzer no longer handles `this` reference identifier.

- Fix [noUnusedVariables](https://docs.rome.tools/lint/rules/nounusedvariables/)'s false positive diagnostics ([#4688](https://github.com/rome/tools/issues/4688))

The semantic analyzer handles ts export declaration clause correctly.

### Parser

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export { a };
export function b() { }

export const { A } = { A: 1 };
export const [B] = [1];
export const [B] = [1];

export declare const valid;
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export function b() { }

export const { A } = { A: 1 };
export const [B] = [1];

export declare const valid;

```


2 changes: 1 addition & 1 deletion crates/rome_js_semantic/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ impl SemanticEventExtractor {
.and_then(|declaration| declaration.parent())
.and_then(|declaration_clause| declaration_clause.parent())
.map(|x| x.kind()),
Some(JS_EXPORT)
Some(JS_EXPORT) | Some(TS_EXPORT_DECLARE_CLAUSE)
);

if is_exported {
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载