oxc/crates/oxc_isolated_declarations/tests
michaelm 3fcad5e16f
fix(isolated_declarations): Remove nested AssignmentPatterns from inside parameters (#4077)
The default values in destructured parameters are retained in
declarations, which can cause captured variables to be part of the emit
when they shouldn't be. This can also lead to unnecessary isolated
declaration errors when those variables are themselves missing type
annotations and can't be inferred.

For example:
```ts
const x = 42;
const y = '';
export function fooGood3({a = x, b: [{c = y}]}: object): void {}
```

before this change will be emitted as:
```ts
declare const x = 42;
declare const y = '';
export declare function fooGood3({ a = x, b: [{ c = y }] }: object): void;
```

and after this change will be emitted as:
```ts
export declare function fooGood3({ a, b: [{ c }] }: object): void;
```

Co-authored-by: MichaelMitchell-at <=>
2024-07-08 11:06:26 +08:00
..
deno chore(isolated-declarations): run integration tests only once 2024-06-24 00:24:16 +08:00
fixtures fix(isolated_declarations): Remove nested AssignmentPatterns from inside parameters (#4077) 2024-07-08 11:06:26 +08:00
snapshots fix(isolated_declarations): Remove nested AssignmentPatterns from inside parameters (#4077) 2024-07-08 11:06:26 +08:00
mod.rs chore(isolated-declarations): add tests from Deno (#3808) 2024-06-21 10:20:21 +00:00