From 33afad0dc65359508b55eda666f70c0b9ce2ea5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Tue, 30 Nov 2021 13:06:29 +0100 Subject: [PATCH] chore: set to Node@>=10.0.0 when no `engines` field is provided --- docs/rules/no-deprecated-api.md | 6 +++--- docs/rules/no-unsupported-features.md | 4 ++-- docs/rules/no-unsupported-features/es-builtins.md | 6 +++--- docs/rules/no-unsupported-features/es-syntax.md | 6 +++--- docs/rules/no-unsupported-features/node-builtins.md | 6 +++--- lib/rules/no-unsupported-features.js | 2 +- lib/util/get-configured-node-version.js | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/rules/no-deprecated-api.md b/docs/rules/no-deprecated-api.md index 01a58883..6d3bdccc 100644 --- a/docs/rules/no-deprecated-api.md +++ b/docs/rules/no-deprecated-api.md @@ -149,12 +149,12 @@ For example of `package.json`: "name": "your-module", "version": "1.0.0", "engines": { - "node": ">=8.0.0" + "node": ">=10.0.0" } } ``` -If you omit the [engines] field, this rule chooses `>=8.0.0` as the configured Node.js version since `8` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). +If you omit the [engines] field, this rule chooses `>=10.0.0` as the configured Node.js version since `10` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). ### Options @@ -164,7 +164,7 @@ This rule has 3 options. { "rules": { "node/no-deprecated-api": ["error", { - "version": ">=8.0.0", + "version": ">=10.0.0", "ignoreModuleItems": [], "ignoreGlobalItems": [] }] diff --git a/docs/rules/no-unsupported-features.md b/docs/rules/no-unsupported-features.md index cbcdd651..18b6d007 100644 --- a/docs/rules/no-unsupported-features.md +++ b/docs/rules/no-unsupported-features.md @@ -31,12 +31,12 @@ For example of `package.json`: "name": "your-module", "version": "1.0.0", "engines": { - "node": ">=6.0.0" + "node": ">=10.0.0" } } ``` -If the [engines] field is omitted, this rule chooses `4` since it's the minimum version the community is maintaining. +If you omit the [engines] field, this rule chooses `>=10.0.0` as the configured Node.js version since `10` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). Examples of :-1: **incorrect** code for this rule: diff --git a/docs/rules/no-unsupported-features/es-builtins.md b/docs/rules/no-unsupported-features/es-builtins.md index 7bc561eb..b9953a3a 100644 --- a/docs/rules/no-unsupported-features/es-builtins.md +++ b/docs/rules/no-unsupported-features/es-builtins.md @@ -27,19 +27,19 @@ For example of `package.json`: "name": "your-module", "version": "1.0.0", "engines": { - "node": ">=8.0.0" + "node": ">=10.0.0" } } ``` -If you omit the [engines] field, this rule chooses `>=8.0.0` as the configured Node.js version since `8` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). +If you omit the [engines] field, this rule chooses `>=10.0.0` as the configured Node.js version since `10` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). ### Options ```json { "node/no-unsupported-features/es-builtins": ["error", { - "version": ">=8.0.0", + "version": ">=10.0.0", "ignores": [] }] } diff --git a/docs/rules/no-unsupported-features/es-syntax.md b/docs/rules/no-unsupported-features/es-syntax.md index 24ed7c6d..0da2ba25 100644 --- a/docs/rules/no-unsupported-features/es-syntax.md +++ b/docs/rules/no-unsupported-features/es-syntax.md @@ -30,19 +30,19 @@ For example of `package.json`: "name": "your-module", "version": "1.0.0", "engines": { - "node": ">=8.0.0" + "node": ">=10.0.0" } } ``` -If you omit the [engines] field, this rule chooses `>=8.0.0` as the configured Node.js version since `8` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). +If you omit the [engines] field, this rule chooses `>=10.0.0` as the configured Node.js version since `10` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). ### Options ```json { "node/no-unsupported-features/es-syntax": ["error", { - "version": ">=8.0.0", + "version": ">=10.0.0", "ignores": [] }] } diff --git a/docs/rules/no-unsupported-features/node-builtins.md b/docs/rules/no-unsupported-features/node-builtins.md index 456fdbe6..126b71e7 100644 --- a/docs/rules/no-unsupported-features/node-builtins.md +++ b/docs/rules/no-unsupported-features/node-builtins.md @@ -24,19 +24,19 @@ For example of `package.json`: "name": "your-module", "version": "1.0.0", "engines": { - "node": ">=8.0.0" + "node": ">=10.0.0" } } ``` -If you omit the [engines] field, this rule chooses `>=8.0.0` as the configured Node.js version since `8` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). +If you omit the [engines] field, this rule chooses `>=10.0.0` as the configured Node.js version since `10` is the minimum version the community is maintaining (see also [Node.js Release Working Group](https://github.com/nodejs/Release#readme)). ### Options ```json { "node/no-unsupported-features/node-builtins": ["error", { - "version": ">=8.0.0", + "version": ">=10.0.0", "ignores": [] }] } diff --git a/lib/rules/no-unsupported-features.js b/lib/rules/no-unsupported-features.js index 73d422f7..fb28c31e 100644 --- a/lib/rules/no-unsupported-features.js +++ b/lib/rules/no-unsupported-features.js @@ -31,7 +31,7 @@ const VERSION_SCHEMA = { }, ], } -const DEFAULT_VERSION = "4.0.0" +const DEFAULT_VERSION = "10.0.0" const FUNC_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/u const CLASS_TYPE = /^Class(?:Declaration|Expression)$/u const DESTRUCTURING_PARENT_TYPE = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression|AssignmentExpression|VariableDeclarator)$/u diff --git a/lib/util/get-configured-node-version.js b/lib/util/get-configured-node-version.js index d682e3a0..c48f77a4 100644 --- a/lib/util/get-configured-node-version.js +++ b/lib/util/get-configured-node-version.js @@ -23,7 +23,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 `>=10.0.0`. * * @param {string|undefined} version The version range text. * @param {string} filename The path to the current linting file. @@ -34,6 +34,6 @@ module.exports = function getConfiguredNodeVersion(version, filename) { return ( getSemverRange(version) || getEnginesNode(filename) || - getSemverRange(">=8.0.0") + getSemverRange(">=10.0.0") ) }