Skip to content

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

Merged
mysticatea merged 1 commit intomysticatea:masterfrom
coreyfarrell:semver-public-api
Dec 7, 2017
Merged

no-unsupported-features: Use semver public API's.#99
mysticatea merged 1 commit intomysticatea:masterfrom
coreyfarrell:semver-public-api

Conversation

@coreyfarrell
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Owner

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

@coreyfarrell
Copy link
Copy Markdown
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.

3 participants