Skip to content

Commit

Permalink
fix: astring-typescript upgrade (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahinvardar authored Dec 14, 2024
1 parent 82d9dd1 commit ae4c03d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"repo-clean": "git clean -xdf -e .env"
},
"dependencies": {
"@vardario/astring-ts-generator": "^1.1.0",
"@vardario/astring-ts-generator": "^1.1.1",
"astring": "^1.9.0",
"commander": "^10.0.1",
"estree-walker": "^3.0.3",
"astring": "^1.9.0",
"lodash": "^4.17.21"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/tests/print-script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function testScriptPrinter(code: string, expectedResult?: string) {
indent: '',
lineEnd: ''
});

expect(result).toBe(expectedResult ?? code);
}

Expand All @@ -27,4 +28,10 @@ describe('<script>', () => {
test('typescript instance', () => {
testScriptPrinter('<script lang="ts">interface A {}const a: number = 0;</script>');
});

test('default import', () => {
testScriptPrinter(
`<script>import WifiSlashIcon from '$lib/components/icons/wifi-slash-icon.svelte';import {i18n} from '$lib/utils';</script>`
);
});
});

0 comments on commit ae4c03d

Please sign in to comment.