Skip to content

Commit

Permalink
feat!: Require Node.js ^18.18.0 || ^20.9.0 || >=21.1.0 (#17725)
Browse files Browse the repository at this point in the history
* feat!: Require Node.js `^18.18.0 || ^20.7.0 || >=21.1.0`

Drops support for Node.js 12/14/16/17/19

Fixes #17595

* update getting-started

* fix lint errors

* 20.7.0 -> 20.9.0
  • Loading branch information
mdjermanovic committed Dec 20, 2023
1 parent b577e8a commit e1e827f
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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"]
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 @@ -174,6 +174,6 @@
],
"license": "MIT",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
}
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 @@ -2299,21 +2299,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

0 comments on commit e1e827f

Please sign in to comment.