Skip to content

Commit

Permalink
Revert "fix: unsupported-features/node-builtins-modules range compare" (
Browse files Browse the repository at this point in the history
#254)

Revert "fix: unsupported-features/node-builtins-modules range compare (#252)"

This reverts commit d50ae85.
  • Loading branch information
aladdin-add authored Apr 24, 2024
1 parent d8d8454 commit caecf3e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
3 changes: 1 addition & 2 deletions lib/util/check-unsupported-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const { ReferenceTracker } = require("@eslint-community/eslint-utils")
const getConfiguredNodeVersion = require("./get-configured-node-version")
const getSemverRange = require("./get-semver-range")
const unprefixNodeColon = require("./unprefix-node-colon")
const semverRangeSubset = require("semver/ranges/subset")

/**
* Parses the options.
Expand Down Expand Up @@ -51,7 +50,7 @@ function isSupported({ supported }, configured) {
return false
}

return semverRangeSubset(configured, range)
return configured.intersects(range)
}

/**
Expand Down
17 changes: 0 additions & 17 deletions tests/lib/rules/no-unsupported-features/es-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2424,23 +2424,6 @@ runTests([
},
],
},
// https://github.com/eslint-community/eslint-plugin-n/issues/250
{
code: "function wrap() { globalThis }",
settings: {
node: { version: ">=11.9.9" },
},
errors: [
{
messageId: "not-supported-till",
data: {
name: "globalThis",
supported: "12.0.0",
version: ">=11.9.9",
},
},
],
},
],
},
])

7 comments on commit caecf3e

@aladdin-add
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scagood is there a way to let release-please pushing a patch version - seems it does know the "revert" commit?

@caugner
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aladdin-add The best way is to adjust the squash commit message:

  1. manually change it to start with fix:, or
  2. add a line fix: ... in the commit (it'll appear in the changelog), or
  3. mention "Release-As: x.y.z" in the commit message.

If you already merged, then you could push an empty commit (see here):

git commit --allow-empty -m "chore: release x.y.z" -m "Release-As: x.y.z"

@aladdin-add
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caugner thanks for the tips, seems useful! 👍

I had just pushed a patch manually, will try it next time! 😄

@scagood
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually use revert: fix: unsupported-features/node-builtins-modules range compare, I am not sure there is a good way 🤔

@caugner
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use revert:, you could configure it as a changelog section:

"changelog-sections": [
{ "type": "feat", "section": "🌟 Features", "hidden": false },
{ "type": "fix", "section": "🩹 Fixes", "hidden": false },
{ "type": "docs", "section": "📚 Documentation", "hidden": false },
{ "type": "chore", "section": "🧹 Chores", "hidden": false },
{ "type": "perf", "section": "🧹 Chores", "hidden": false },
{ "type": "refactor", "section": "🧹 Chores", "hidden": false },
{ "type": "test", "section": "🧹 Chores", "hidden": false },
{ "type": "build", "section": "🤖 Automation", "hidden": false },
{ "type": "ci", "section": "🤖 Automation", "hidden": true }
],

@scagood
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have too many release please configs! 😱
image

@caugner
Copy link

@caugner caugner commented on caecf3e Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note also that you can fix release notes (before merging the release-please PR) by updating the description of the PR for which you want to fix the release notes, and adding this section:

BEGIN_COMMIT_OVERRIDE
feat: add ability to override merged commit message

fix: another message
chore: a third message
END_COMMIT_OVERRIDE

Please sign in to comment.