Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Require Node.js ^18.18.0 || ^20.9.0 || >=21.1.0 #17725

Merged
merged 4 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [21.x, 20.x, 19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
node: [21.x, 20.x, 18.x, "18.18.0"]

Choose a reason for hiding this comment

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

why not 18.x?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are both 18.x and 18.18.0.

18.x to test on the latest version of Node.js 18 (currently 18.18.2).
18.18.0 to test on the minimum supported version

include:
- os: windows-latest
node: "lts/*"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J

## Installation and Usage

Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
Prerequisites: [Node.js](https://nodejs.org/) (`^18.18.0`, `^20.9.0`, or `>=21.1.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)

You can install and configure ESLint using this command:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/integrate/integration-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This tutorial assumes you are familiar with JavaScript and Node.js.

To follow this tutorial, you'll need to have the following:

* Node.js (v12.22.0 or higher)
* Node.js (`^18.18.0`, `^20.9.0`, or `>=21.1.0`)
* npm
* A text editor

Expand Down
4 changes: 2 additions & 2 deletions docs/src/use/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Getting Started with ESLint
eleventyNavigation:
key: getting started
key: getting started
parent: use eslint
title: Getting Started
order: 1
Expand All @@ -14,7 +14,7 @@ ESLint is completely pluggable. Every single rule is a plugin and you can add mo

## Prerequisites

To use ESLint, you must have [Node.js](https://nodejs.org/en/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) installed and built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
To use ESLint, you must have [Node.js](https://nodejs.org/en/) (`^18.18.0`, `^20.9.0`, or `>=21.1.0`) installed and built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)

## Quick start

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@
],
"license": "MIT",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"

Choose a reason for hiding this comment

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

Hey sorry for the random comment but why ^18.18.0 and not ^18.0.0? I've been trying to dig around for this and can't find the reason. I've got the node engine set to >=18 in my app so I'd need to upgrade which is fine, I'm just curious :)

Choose a reason for hiding this comment

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

It's the first LTS release for 18

Copy link

@koddsson koddsson Jan 10, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor

@Tanujkanti4441 Tanujkanti4441 Jan 10, 2024

Choose a reason for hiding this comment

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

have you gone through the discussion in the related issue?

Choose a reason for hiding this comment

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

have you gone through the discussion in the related issue?

Yeah but I'm missing why those versions were chosen. The only thing I see is it being the latest versions at the time.

}
}
2 changes: 1 addition & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
],
"license": "MIT",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
}
16 changes: 1 addition & 15 deletions tests/lib/eslint/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2404,21 +2404,7 @@ describe("ESLint", () => {
*/
function deleteCacheDir() {
try {

/*
* `fs.rmdir(path, { recursive: true })` is deprecated and will be removed.
* Use `fs.rm(path, { recursive: true })` instead.
* When supporting Node.js 14.14.0+, the compatibility condition can be removed for `fs.rmdir`.
*/
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- just checking if it exists
if (typeof fs.rm === "function") {

// eslint-disable-next-line n/no-unsupported-features/node-builtins -- conditionally used
fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} else {
fs.rmdirSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
}

fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} catch {

/*
Expand Down
16 changes: 1 addition & 15 deletions tests/lib/eslint/flat-eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2300,21 +2300,7 @@ describe("FlatESLint", () => {
*/
function deleteCacheDir() {
try {

/*
* `fs.rmdir(path, { recursive: true })` is deprecated and will be removed.
* Use `fs.rm(path, { recursive: true })` instead.
* When supporting Node.js 14.14.0+, the compatibility condition can be removed for `fs.rmdir`.
*/
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- just checking if it exists
if (typeof fs.rm === "function") {

// eslint-disable-next-line n/no-unsupported-features/node-builtins -- conditionally used
fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} else {
fs.rmdirSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
}

fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} catch {

/*
Expand Down