Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Conversation

vlad-psh
Copy link
Contributor

@vlad-psh vlad-psh commented Feb 8, 2023

Vue 3 have new <script setup> (Composition API) format for SFC files
See https://vuejs.org/api/sfc-script-setup.html#script-setup

@vue/compiler-sfc can parse both, and we can find parsing results at:

  • parsed.descriptor.script if code is written in traditional way
  • parsed.descriptor.scriptSetup if code is written using new <script setup> syntax

One more problem is that typescript plugin wasn't included into vue.js parser (Vue 3 supports TypeScript by defining <script lang="ts">) and when depcheck encounters any TS in .vue file, it just fails silently, skipping current file.

PS: Currently, in test/fake_modules/vue3/component.vue we're checking only old vue2 format without TS, so I fixed this too.

PSS: This PR solves #746

@vlad-psh vlad-psh force-pushed the fix-vue3-setup-typescript branch from 8f076c0 to f707a83 Compare February 8, 2023 15:00
@codecov-commenter
Copy link

Codecov Report

Merging #778 (f707a83) into main (f9eb0ed) will increase coverage by 0.01%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #778      +/-   ##
==========================================
+ Coverage   98.29%   98.30%   +0.01%     
==========================================
  Files          50       50              
  Lines        1052     1053       +1     
==========================================
+ Hits         1034     1035       +1     
  Misses         18       18              
Impacted Files Coverage Δ
src/parser/vue.js 83.34% <100.00%> (+3.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5132d5e...f707a83. Read the comment docs.

@rumpl rumpl merged commit 56155fe into depcheck:main Mar 28, 2023
@rumpl rumpl mentioned this pull request Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants