Skip to content

Commit

Permalink
fix: Node detection for requireFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Sep 6, 2024
1 parent 0d32c2a commit d7c507a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# eslint-config-ash-nazg CHANGES

## 36.15.1

- fix: Node detection for `requireFlag`

## 36.15.0

- feat: disable overly aggressive sonarjs rules
Expand Down
5 changes: 3 additions & 2 deletions detectEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ const detectNodeVersion = (packagePath) => {
*/
export const pkgSatisfiesNodeVersion = (pkg, range) => {
const {engines: {node} = {}} = pkg;
return node
? semver.satisfies(node, range)
const version = node && semver.minVersion(node)?.version;
return version
? semver.satisfies(version, range)
: (() => {
throw new Error('Could not detect Node version from package.json');
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-ash-nazg",
"version": "36.15.0",
"version": "36.15.1",
"description": "An expansion and tweaking of the \"standard\" config style for ESLint",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit d7c507a

Please sign in to comment.