From ce7a3cc4b47f9fb53987b45547d757107365a132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 13 Mar 2023 16:46:03 +0800 Subject: [PATCH] feat!: engines.node defaults to 16.0.0 node.js < 13, v15 has been eol. and node.js v14 will be eol in a few months. refs: #42 --- lib/util/get-configured-node-version.js | 4 ++-- tests/lib/rules/no-unsupported-features/es-syntax.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/util/get-configured-node-version.js b/lib/util/get-configured-node-version.js index ff5f9dcd..c1395d7f 100644 --- a/lib/util/get-configured-node-version.js +++ b/lib/util/get-configured-node-version.js @@ -36,7 +36,7 @@ function getEnginesNode(filename) { * * 1. Parse a given version then return it if it's valid. * 2. Look package.json up and parse `engines.node` then return it if it's valid. - * 3. Return `>=8.0.0`. + * 3. Return `>=16.0.0`. * * @param {string|undefined} version The version range text. * @param {string} filename The path to the current linting file. @@ -52,7 +52,7 @@ module.exports = function getConfiguredNodeVersion(context) { return ( getSemverRange(version) || getEnginesNode(filePath) || - getSemverRange(">=8.0.0") + getSemverRange(">=16.0.0") ) } diff --git a/tests/lib/rules/no-unsupported-features/es-syntax.js b/tests/lib/rules/no-unsupported-features/es-syntax.js index 1e402321..0f85de62 100644 --- a/tests/lib/rules/no-unsupported-features/es-syntax.js +++ b/tests/lib/rules/no-unsupported-features/es-syntax.js @@ -2663,6 +2663,7 @@ ruleTester.run( { filename: fixture("invalid/a.js"), code: "var a = { ...obj }", + options: [{version: '>=8.0.0'}], errors: [ { messageId: "no-rest-spread-properties", @@ -2683,6 +2684,7 @@ ruleTester.run( { filename: fixture("nothing/a.js"), code: "var a = { ...obj }", + options: [{version: '>=8.0.0'}], errors: [ { messageId: "no-rest-spread-properties",