azz / prettier-tslint

Code ➡️ prettier ➡️ tslint --fix ➡️ Formatted Code ✨
https://npm.im/prettier-tslint
MIT License
225 stars 13 forks source link

Support TypeScript 4.x #41

Open opl- opened 4 years ago

opl- commented 4 years ago

Versions:

Problem description:

TypeScript has recently released a new update which bumped the major. Unfortunately, TypeScript doesn't adhere to semver (see microsoft/TypeScript#14116). This means that this package needs to update the typescript peerDependency to allow using TypeScript 4.0+ with it.

Suggested solution:

Using 2.5.3 || >=3.0.0 (or simply >=2.5.3 if all versions past v2.5.3 are supported) as the peer dependency version for the typescript package should fix this issue. See https://docs.npmjs.com/files/package.json#dependencies

hisham commented 3 years ago

+1

samrae7 commented 3 years ago

+1

hisham commented 3 years ago

Any update on this? I assume this package works fine with ts4 you just get a warning?

opl- commented 3 years ago

Since TypeScript is declared as a peerDependency, in theory npm should just complain that the peer dependency is unmet, but node should still be able to resolve it to the newer version as long as one is installed.

In practice, you might want to check that prettier-tslint doesn't have its own version of TypeScript (in node_modules/prettier-tslint/node_modules/typescript), as that's what prompted me to open this issue in the first place.

hisham commented 3 years ago

Thanks @opl- - I ended up moving off of tslint as it's deprecated, and then used prettier-eslint package.