Skip to content
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

dtslint broken because of latest dependencies #898

Open
wesleytodd opened this issue Jan 10, 2024 · 6 comments
Open

dtslint broken because of latest dependencies #898

wesleytodd opened this issue Jan 10, 2024 · 6 comments

Comments

@wesleytodd
Copy link

I am guessing that dtslint is not very popular and so this went under the radar (and based on the download count), but it is currently broken because it has dependencies on a few @definitelytyped packages @latest. The dtslint package has not been updated in 2 years, and these packages have been published within the last month bumping the major version.

$ curl -s https://registry.npmjs.com/dtslint | jq -r '.["dist-tags"].latest'
4.2.1
$ curl -s https://registry.npmjs.com/dtslint | jq '.versions."4.2.1".dependencies'
{
  "@definitelytyped/header-parser": "latest",
  "@definitelytyped/typescript-versions": "latest",
  "@definitelytyped/utils": "latest",
  "dts-critic": "latest",
  "fs-extra": "^6.0.1",
  "json-stable-stringify": "^1.0.1",
  "strip-json-comments": "^2.0.1",
  "tslint": "5.14.0",
  "tsutils": "^2.29.0",
  "yargs": "^15.1.0"
}

Ideally that package needs to be republished to use semver ranges for that. Not sure if it is just old and neglected, but latest should never be used in a published package for exactly this reason. I hope it is not being used in this way in other repos, but if so please consider using semver ranges in the future 😄.

@jakebailey
Copy link
Member

The correct package to use is @definiteltyped/dtslint; dtslint (no scope) has not been updated in years. We should probably go and mark it as deprecated.

Are you attempting to use dtslint outside of DT? You may find that it doesn't work quite right (#775, #850).

@wesleytodd
Copy link
Author

This was an old package I was trying to get updated which I did not setup, so yeah had I see it was deprecated I probably would have just deleted and moved on. I can try moving to the new scoped package, is there an upgrade guide or is it just the same thing but properly maintained for external users?

@jakebailey
Copy link
Member

I would not claim that anything in this repo is "properly maintained" for external users, I'm afraid. We make changes here in tandem with changes to DT and have not actually decided on what is/isn't supposed to be usable anywhere outside of DT (hence those other two issues). We don't generally follow semver as it's expected that everyone is just getting the latest on DT (as it wouldn't work for the layout of DT otherwise).

I would definitely be interested in what you're using it for; there are lots of external tools which do things that dtslint does that are more suited for external use (e.g., tsd, the expect eslint plugin).

@wesleytodd
Copy link
Author

Haha, no worries! Honestly I don't know who set this project up or when, it is an old internal project and it looks like it is doing something like what I have used tsd for int he past, just testing some .d.ts files. Maybe I will just see if I can use tsd and remove this dep.

We don't generally follow semver as it's expected that everyone is just getting the latest on DT (as it wouldn't work for the layout of DT otherwise).

This is probably not the right forum for me to make the case, but just know that this decision continues to cause pain across the ecosystem.

@jakebailey
Copy link
Member

This is probably not the right forum for me to make the case, but just know that this decision continues to cause pain across the ecosystem.

The README has a big warning:

These tools are not intended for public consumption, so we may break the API whenever convenient for us.

And that was added 4 years ago; I'm not sure what else we can say if we're already saying "don't use this".

@wesleytodd
Copy link
Author

I think it needs to be deprecated and that warning needs to be in the published readme: https://www.npmjs.com/package/dtslint

I started there, then it linked here: https://github.com/Microsoft/dtslint

From there, I clicked into here but went right into the package name since it is a monorepo and then read this readme: https://github.com/microsoft/DefinitelyTyped-tools/tree/main/packages/dtslint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants