-
Notifications
You must be signed in to change notification settings - Fork 4
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
68 multiple entries on go to definition #70
Conversation
…ugin added to clean up definitions from declaration files
a33c8f5
to
82b9a0b
Compare
…ls about the plugin
82b9a0b
to
d317b47
Compare
"scope": "window", | ||
"description": "Add a declaration file to skip definition results from this file. Useful for skipping unnecessary defintions from boilder plate projects", | ||
"default": [ | ||
"node_modules/vite/client.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.
Will these paths work at any level of the project?
Eg. In a monorepo / workspace project, the path would be:
<project root>/packages/package-name/node_modules/next/types/global.d.ts
Would be cool if these also worked out of the box without any additional configuration
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.
it should since the plugin does a vague/naive string comparison .
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.
@karlhorky Added a mono repo setup in the latest commit to test this out . Tested both in vite and next app inside monorepo/packages and it works as I expected.
you can also test it if you'd like
Open the monorepo folder in debug mode. Open App.tsx
inside examples/monorepo/packages/vite-app/src/App.tsx
and try going to the definition of styles.logo
. You'll see only the css module definition is provided :)
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.
Seems like a really cool approach!
I suggested a few changes and asked some questions
Co-authored-by: Karl Horky <[email protected]>
Thanks a lot for the comments @karlhorky . Really Appreciate your time and effort. |
735bd32
to
6fb4730
Compare
It seems like in the react-ts-css/examples/monorepo/package.json Lines 5 to 10 in 19198f9
Eg. could that mean that the |
If I should open a new issue, let me know. |
@karlhorky I too tried it after the version was shipped . It did not work for me either. I suspect it could be something to do with the typescript version difference . I did not have time to investigate this further. Hope I will find some time to debug this. |
I'll reopen + edit the original issue so that we don't lose track of it. |
This is not related . I have removed the next app from packages in order for the package to have it own node_modules folder . If you look at vite example it has its own node modules setup.So this helped to test the use case you mentioned However removing the next app from the list of packages didn't make a difference since the monorepo was setup using turbo repo which provides a next boilerplate |
I reopened #68 and added a comment: #68 (comment) |
Closes #68
@karlhorky Here is the first draft to help avoid the extra definitions results from declaration files
I m using a small typescript plugin to help this cause.
currently the option to override the definitions from declaration files can be done to settings Which is documented in the readme
Let me know what you think about this PR