Skip to content

Commit

Permalink
fix: void error on type of a function declaration (#309)
Browse files Browse the repository at this point in the history
Co-authored-by: Victorien Elvinger <victorien@elvinger.fr>
  • Loading branch information
b4s36t4 and Conaclos authored Sep 17, 2023
1 parent 214dd31 commit 37e91e7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

- Add [noMisleadingInstantiator](https://biomejs.dev/linter/rules/no-mileading-instantiator) rule. The rule reports the misleading use of the `new` and `constructor` methods. Contributed by @unvalley

#### Bug fixes

- Fix [#294](https://github.com/biomejs/biome/issues/294). [noConfusingVoidType](https://biomejs.dev/linter/rules/no-confusing-void-type/) no longer reports false positives for return types. Contributed by @b4s36t4

### Parser
### VSCode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ fn node_in(node: &SyntaxNode<Language>) -> Option<VoidTypeIn> {
JsSyntaxKind::TS_THIS_PARAMETER
| JsSyntaxKind::TS_RETURN_TYPE_ANNOTATION
| JsSyntaxKind::TS_TYPE_PARAMETER
| JsSyntaxKind::TS_FUNCTION_TYPE
| JsSyntaxKind::TS_TYPE_ARGUMENT_LIST => {
return None;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ logAndReturn<void>(undefined);

let voidPromise: Promise<void> = new Promise<void>(() => { });
let voidMap: Map<string, void> = new Map<string, void>();

type FallbackHandler = (error?: Error) => void;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/biome_js_analyze/tests/spec_tests.rs
assertion_line: 80
expression: valid.ts
---
# Input
Expand All @@ -13,6 +12,7 @@ logAndReturn<void>(undefined);
let voidPromise: Promise<void> = new Promise<void>(() => { });
let voidMap: Map<string, void> = new Map<string, void>();

type FallbackHandler = (error?: Error) => void;
```


4 changes: 4 additions & 0 deletions website/src/content/docs/internals/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

- Add [noMisleadingInstantiator](https://biomejs.dev/linter/rules/no-mileading-instantiator) rule. The rule reports the misleading use of the `new` and `constructor` methods. Contributed by @unvalley

#### Bug fixes

- Fix [#294](https://github.com/biomejs/biome/issues/294). [noConfusingVoidType](https://biomejs.dev/linter/rules/no-confusing-void-type/) no longer reports false positives for return types. Contributed by @b4s36t4

### Parser
### VSCode

Expand Down

0 comments on commit 37e91e7

Please sign in to comment.