Skip to content

Commit

Permalink
feat: 去掉 typescript 声明
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Oct 11, 2023
1 parent cec4e20 commit 3c68159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ dist
.AppleDouble
.LSOverride

# Icon must end with two
# Icon must end with two
Icon


Expand Down Expand Up @@ -195,3 +195,5 @@ Cargo.lock
!.yarn/versions

*.node

src/main.rs
2 changes: 2 additions & 0 deletions src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use swc_ecma_ast::{EsVersion, Program};
use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax, TsConfig};
use swc_ecma_visit::{VisitWith, FoldWith};
use swc_ecma_transforms_base::{fixer::fixer, hygiene::hygiene, resolver};
use swc_ecmascript::transforms::typescript::strip;

use crate::{
scraper::{ElementRef, Node, Selector},
Expand Down Expand Up @@ -63,6 +64,7 @@ impl JSXDocument {
let unresolved_mark = Mark::new();
let top_level_mark = Mark::new();
let program = program.fold_with(&mut resolver(unresolved_mark, top_level_mark, true));
let program = program.fold_with(&mut strip(top_level_mark));
let program = program.fold_with(&mut hygiene());
let program = program.fold_with(&mut fixer(Some(comments)));
let mut jsx_record: JSXRecord = HashMap::new();
Expand Down

0 comments on commit 3c68159

Please sign in to comment.