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

no-unsupported-features: Use semver public API's. #99

Merged
merged 1 commit into from
Dec 7, 2017
Merged

no-unsupported-features: Use semver public API's. #99

merged 1 commit into from
Dec 7, 2017

Conversation

coreyfarrell
Copy link
Contributor

This patch makes the minimum changes needed to remove all use of undocumented semver API's so it can be unpinned. This results in a slight change to the error message generated when package.json contains engines.node. We no longer calculate the lowest supported version so the message now contains the sanitized semver range string insead of a single version.

Add a '<' before the minimum version of features to make semver range
representing all versions that do not support the feature.  Add '>='
before the version if provided through options to produce a semver
range.  If the two ranges intersect then report use of an unsupported
feature.
@codecov-io
Copy link

Codecov Report

Merging #99 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
+ Coverage   98.44%   98.52%   +0.07%     
==========================================
  Files          42       42              
  Lines        1029     1014      -15     
==========================================
- Hits         1013      999      -14     
+ Misses         16       15       -1
Impacted Files Coverage Δ
tests/lib/rules/no-unsupported-features.js 100% <ø> (ø) ⬆️
lib/rules/no-unsupported-features.js 98.96% <100%> (+0.4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5a8985...3534a9e. Read the comment docs.

@mysticatea
Copy link
Owner

Oh, nice patch!
The semver.intersects function is what I wanted at that time.

@coreyfarrell
Copy link
Contributor Author

I think semver.intersects is brand new. The first build attempt failed because I didn't change "semver": "^5.3.0" to "^5.4.1", I think your build server must cache the previous npm install.

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

Successfully merging this pull request may close these issues.

None yet

3 participants