panuhorsmalahti / gulp-tslint

TypeScript linter plugin for Gulp
MIT License
118 stars 44 forks source link

Remove peer dependency? #43

Closed wcandillon closed 8 years ago

wcandillon commented 8 years ago

When using tslint@next, the peer dependency declaration conflicts:

$ npm install gulp-tslint
jsoniq@0.0.1 /Users/wcandillon/tmp/jsoniq
├── gulp-tslint@4.0.0  extraneous
└── UNMET PEER DEPENDENCY tslint@3.1.0-dev.1

npm WARN EPEERINVALID gulp-tslint@4.0.0 requires a peer of tslint@>=3.0.0 but none was installed.
panuhorsmalahti commented 8 years ago

Released 4.0.1, which fixes this issue.

The problem was with semver being pretty restrictive about prerelease tags: "If a version has a prerelease tag (for example, 1.2.3-alpha.3) then it will only be allowed to satisfy comparator sets if at least one comparator with the same [major, minor, patch] tuple also has a prerelease tag." - https://docs.npmjs.com/misc/semver

I fixed it by changing the tslint peerDependency to ^3 || >=3.1.0-dev. Note that this also makes gulp-tslint incompatible with the future version of tslint 4.x, which is a good thing. Also note that 3.0.0-dev releases are not supported. If someone really wants that support I might accept a PR. The problem is that the list of supported dev releases starts to grow pretty quickly, and soon it would be something like this: ^3 || >=3.0.0-dev || >=3.1.0-dev || >=3.2.0-dev || >=3.3.0-dev || >=3.4.0-dev || >=3.5.0-dev.

If someone knows a good way to specify those versions, drop me a line.

For comparison, here's grunt-tslint's solution: https://github.com/palantir/grunt-tslint/blob/master/package.json#L38

wcandillon commented 8 years ago

thanks a lot!