Skip to content

Commit

Permalink
chore: set to Node@>=10.0.0 when no engines field is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Nov 30, 2021
1 parent 69859fe commit 33afad0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions docs/rules/no-deprecated-api.md
Expand Up @@ -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

Expand All @@ -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": []
}]
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-unsupported-features.md
Expand Up @@ -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:

Expand Down
6 changes: 3 additions & 3 deletions docs/rules/no-unsupported-features/es-builtins.md
Expand Up @@ -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": []
}]
}
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/no-unsupported-features/es-syntax.md
Expand Up @@ -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": []
}]
}
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/no-unsupported-features/node-builtins.md
Expand Up @@ -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": []
}]
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unsupported-features.js
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/util/get-configured-node-version.js
Expand Up @@ -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.
Expand All @@ -34,6 +34,6 @@ module.exports = function getConfiguredNodeVersion(version, filename) {
return (
getSemverRange(version) ||
getEnginesNode(filename) ||
getSemverRange(">=8.0.0")
getSemverRange(">=10.0.0")
)
}

0 comments on commit 33afad0

Please sign in to comment.