Skip to content

Commit

Permalink
update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Nov 9, 2024
1 parent 148fa57 commit f7468d3
Show file tree
Hide file tree
Showing 4 changed files with 279 additions and 992 deletions.
6 changes: 3 additions & 3 deletions crates/oxc_transformer/src/typescript/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ impl<'a, 'ctx> TypeScriptModule<'a, 'ctx> {
/// import AliasModule = LongNameModule;
///
/// ```JavaScript
/// var module = require('module');
/// var AliasModule = LongNameModule;
/// const module = require('module');
/// const AliasModule = LongNameModule;
/// ```
fn transform_ts_import_equals(
&self,
decl: &mut TSImportEqualsDeclaration<'a>,
ctx: &mut TraverseCtx<'a>,
) -> Declaration<'a> {
let kind = VariableDeclarationKind::Var;
let kind = VariableDeclarationKind::Const;
let decls = {
let binding_pattern_kind =
ctx.ast.binding_pattern_kind_binding_identifier(SPAN, &decl.id.name);
Expand Down
33 changes: 9 additions & 24 deletions tasks/coverage/snapshots/semantic_babel.snap
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,7 @@ after transform: ["Y", "foo"]
rebuilt : []

tasks/coverage/babel/packages/babel-parser/test/fixtures/estree/typescript/import-require/input.js
semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS.
Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Import assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/estree/typescript/literals/input.js
semantic error: Bindings mismatch:
Expand Down Expand Up @@ -1101,12 +1100,10 @@ after transform: ScopeId(0): [ScopeId(1), ScopeId(2), ScopeId(3), ScopeId(4), Sc
rebuilt : ScopeId(0): []

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/export/equals/input.ts
semantic error: `export = <value>;` is only supported when compiling modules to CommonJS.
Please consider using `export default <value>;`, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Export assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/export/equals-in-unambiguous/input.ts
semantic error: `export = <value>;` is only supported when compiling modules to CommonJS.
Please consider using `export default <value>;`, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Export assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/export/export-type/input.ts
semantic error: Bindings mismatch:
Expand Down Expand Up @@ -1226,18 +1223,10 @@ after transform: ScopeId(0): [SymbolId(0)]
rebuilt : ScopeId(0): [SymbolId(0)]

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/equals-require/input.ts
semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS.
Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Import assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/equals-require-in-unambiguous/input.ts
semantic error: Missing SymbolId: "a"
Missing ReferenceId: "requires"
Binding symbols mismatch:
after transform: ScopeId(0): [SymbolId(0)]
rebuilt : ScopeId(0): [SymbolId(0)]
Unresolved references mismatch:
after transform: []
rebuilt : ["requires"]
semantic error: Import assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/export-import/input.ts
semantic error: Missing SymbolId: "A"
Expand All @@ -1246,21 +1235,18 @@ after transform: ScopeId(0): [SymbolId(0)]
rebuilt : ScopeId(0): [SymbolId(0)]

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/export-import-require/input.ts
semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS.
Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Import assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/export-import-type-as-identifier/input.ts
semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS.
Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Import assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/export-import-type-require/input.ts
semantic error: Bindings mismatch:
after transform: ScopeId(0): ["a"]
rebuilt : ScopeId(0): []

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/input.ts
semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS.
Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Import assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/import-default-and-named-id-type/input.ts
semantic error: Bindings mismatch:
Expand All @@ -1283,8 +1269,7 @@ after transform: ScopeId(0): ["a"]
rebuilt : ScopeId(0): []

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/import-type-as-identifier/input.ts
semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS.
Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config.
semantic error: Import assignment cannot be used when targeting ECMAScript modules.

tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/import/internal-comments/input.ts
semantic error: Bindings mismatch:
Expand Down
Loading

0 comments on commit f7468d3

Please sign in to comment.