-
-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(js_semantic_model): handle bogus conditional type (#2619)
- Loading branch information
Showing
4 changed files
with
47 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...biome_js_analyze/tests/specs/correctness/noUnusedVariables/unusedInferBogusConditional.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type ToPascalCase<S extends string> = S extends `${infer Prefix}` ? : ; |
22 changes: 22 additions & 0 deletions
22
..._js_analyze/tests/specs/correctness/noUnusedVariables/unusedInferBogusConditional.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: unusedInferBogusConditional.ts | ||
--- | ||
# Input | ||
```ts | ||
export type ToPascalCase<S extends string> = S extends `${infer Prefix}` ? : ; | ||
``` | ||
|
||
# Diagnostics | ||
``` | ||
unusedInferBogusConditional.ts:1:65 lint/correctness/noUnusedVariables ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! This variable is unused. | ||
> 1 │ export type ToPascalCase<S extends string> = S extends `${infer Prefix}` ? : ; | ||
│ ^^^^^^ | ||
i Unused variables usually are result of incomplete refactoring, typos and other source of bugs. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters