-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Vue support #171
Add Vue support #171
Conversation
This also adds a test that may or may not test anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work - a few TODOs:
- CHANGELOG
Please add an 'Added' entry to the top of the CHANGELOG.md file
"strictNullChecks": true | ||
}, | ||
"include": ["./**/*.ts", "./**/*.vue"], | ||
"atom": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove atom
section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah not sure why this is in here - I just copied it from another example, you might want to delete it there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, but we can start by removing it here ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logged #172 but in this MR we can at least avoid adding more such files with these small issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#172 has been fixed
{ | ||
extension: 'vue', | ||
isMixedContent: true, | ||
scriptKind: ts.ScriptKind.Deferred, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder could this cause any issues.
For example if an existing user has some vue
files that they do NOT want scanned.
Also, to be honest I do not fully understand these parameters 😀
We could hide this behind a new option like --vue
- then that could also auto-suppress the shims file shims-tsx-d-ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, the README change is much smaller (just document the new option)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the approach of adding a new option --vue
@pzavolinsky what do you reckon ?
(related)
@Timmmm about the itest not failing: The itests use the
So it is not counting the number of unused items - it is counting the files. When I tried it on this branch, it worked ok (by making a copy of Math.ts) For future - Logged #172 to improve how itests checked. |
@@ -0,0 +1,6 @@ | |||
export function add1(x: number) { return x + 1; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename add1 to unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions were just copied from another example, I left the names for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in master - if you rebase you will see.
export function add1(x: number) { return x + 1; } | ||
|
||
// ts-unused-exports:disable-next-line | ||
export function add2(x: number) { return x + 2; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename add2 to unusedButDisabled
[UPDATED - itests]
|
{ | ||
extension: 'vue', | ||
isMixedContent: true, | ||
scriptKind: ts.ScriptKind.Deferred, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comment to explain the values used for:
isMixedContent,
scriptKind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments needed to explain parameters chosen (see above)
The PR has an itest, but some unit tests are needed for future maintenance and debugging. Add a new file like: vue.feature Example: https://github.com/pzavolinsky/ts-unused-exports/blob/master/features/base-url-undefined.feature |
I think mixins are a standard Typescript feature. |
Since this is closed now, in case someone is still looking for a Vue compatible alternative you may want to try |
This also adds a test that may or may not test anything.
Fixes #162