-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Bug: TypeScript type error in generated dts files #104
Comments
Thanks for the issue @danielrentz. I can see that the latest version of That said, it's difficult to say if that update will "just work" for you without a repro to look into. It sounds like your project is relying on a version of |
Well, my project is not relying on |
Sorry, are you suggesting that this project ( |
Ah okay, thanks. Actually the next release of |
@fasttime what "next release" are you referring to? There isn't any release pending. Or are you suggesting that some changes have to be made? @danielrentz the next here is for you to create a repro case, either a StackBlitz or a GitHub repo where we can easily see the behavior you're describing. Without that, it's difficult to really understand what the solution is. |
Minimal repro: https://stackblitz.com/edit/eslint-rewrite-repro-104 Simply run |
@nzakas I didn't consider that #94 would cause a change in the compiled code of |
I'd be slightly in favor of promoting |
@alecmev thanks! @fasttime I'm not a fan of installing type-only packages as dependencies, as that doesn't make clear the relationship between the packages, and it could lead to conflicting version issues if someone does have FWIW, empty commits won't trigger release-please in a monorepo because it uses the changed files to determine which package the change belongs to. We'd need to make a change to an actual file. |
What about a peer dependency? You can explore prior art here. |
@JoshuaKGoldberg do you have any insights on how to handle a situation like this? The suggestion is to add |
…onfig Installing it alongside `@eslint/compat` creates a types clash in `node_modules`. It will be re-added in a future release. eslint/rewrite#104.
Ping @JoshuaKGoldberg |
Sorry! Missed this. Yes, it's unfortunate - there's no way to delineate a runtime end-user We do this in typescript-eslint for the "peerDependencies": {
"@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
"eslint": "^8.57.0 || ^9.0.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}, I'd lean towards that. |
Thanks @JoshuaKGoldberg, that makes sense. @danielrentz do you want to update your PR accordingly? |
@nzakas done |
Which packages are affected?
@eslint/compat
@eslint/config-array
@eslint/core
@eslint/migrate-config
@eslint/object-schema
Environment
Node version: 20
npm version:
ESLint version: 9.9.0
Operating System: Win11
What did you do?
@stylistic/eslint-plugin
from 2.3 to 2.4A weird side effect in package installation starts to give me a type error from THIS package after upgrading
@stylistic/eslint-plugin
. See below for details.What did you expect to happen?
My TS code compiles.
What actually happened?
After upgrading
@stylistic/eslint-plugin
, I get a type error from THIS package.The typedef
in https://github.com/eslint/rewrite/blob/main/packages/compat/src/fixup-rules.js#L11-L12 has been compiled to
in
node_modules/@eslint/compat/dist/esm/index.d.ts
, i.e. the type lookup expressionFixupRuleDefinition["create"]
has been resolved toRule.OldStyleRule;
.However, the type
OldStyleRule
exists in@types/eslint
v8 only but not in v9.This seems to be a side effect of the
@stylistic/eslint-plugin
upgrade mentioned above. With@stylistic/eslint-plugin
v2.3 I seebut with v2.4 and above I see
i.e. there is no more
@types/eslint
v8 anymore in node_modules .Link to Minimal Reproducible Example
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: