From 26dea68ffeb9aefd75755b85b0cf912b90e6a32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iiro=20J=C3=A4ppinen?= Date: Thu, 20 Apr 2023 17:51:42 +0300 Subject: [PATCH] feat!: drop support for Node.js 14 as it's EOL after 2023-04-30 --- .github/workflows/main.yml | 3 +-- README.md | 16 +++++++++------- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b9b96be9..dbf158d7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,9 +42,8 @@ jobs: test: strategy: matrix: - # Test with Node.js v14 (LTS), v16 (LTS), and 18 (Current) + # Test with Node.js v16 (LTS), v18 (LTS), and v20 (Current) node: - - 14 - 16 - 18 - 20 diff --git a/README.md b/README.md index b59dc08e5..cb9002b69 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ See [Releases](https://github.com/okonet/lint-staged/releases). ### Migration +#### v14 + +- Since `v14.0.0` _lint-staged_ no longer supports Node.js 14. Please upgrade your Node.js version to at least `16.14.0`. + #### v13 - Since `v13.0.0` _lint-staged_ no longer supports Node.js 12. Please upgrade your Node.js version to at least `14.13.1`, or `16.0.0` onward. @@ -218,11 +222,11 @@ If necessary, you can limit the concurrency using `--concurrent ` or dis Linter commands work on a subset of all staged files, defined by a _glob pattern_. lint-staged uses [micromatch](https://github.com/micromatch/micromatch) for matching files with the following rules: - If the glob pattern contains no slashes (`/`), micromatch's `matchBase` option will enabled, so globs match a file's basename regardless of directory: - - **`"*.js"`** will match all JS files, like `/test.js` and `/foo/bar/test.js` - - **`"!(*test).js"`**. will match all JS files, except those ending in `test.js`, so `foo.js` but not `foo.test.js` + - `"*.js"` will match all JS files, like `/test.js` and `/foo/bar/test.js` + - `"!(*test).js"` will match all JS files, except those ending in `test.js`, so `foo.js` but not `foo.test.js` - If the glob pattern does contain a slash (`/`), it will match for paths as well: - - **`"./*.js"`** will match all JS files in the git repo root, so `/test.js` but not `/foo/bar/test.js` - - **`"foo/**/*.js"`** will match all JS files inside the `/foo` directory, so `/foo/bar/test.js` but not `/test.js` + - `"./*.js"` will match all JS files in the git repo root, so `/test.js` but not `/foo/bar/test.js` + - `"foo/**/*.js"` will match all JS files inside the `/foo` directory, so `/foo/bar/test.js` but not `/test.js` When matching, lint-staged will do the following @@ -624,9 +628,7 @@ See more on [this blog post](https://medium.com/@tomchentw/imagemin-lint-staged- const path = require('path') const buildEslintCommand = (filenames) => - `next lint --fix --file ${filenames - .map((f) => path.relative(process.cwd(), f)) - .join(' --file ')}` + `next lint --fix --file ${filenames.map((f) => path.relative(process.cwd(), f)).join(' --file ')}` module.exports = { '*.{js,jsx,ts,tsx}': [buildEslintCommand], diff --git a/package-lock.json b/package-lock.json index 08ad0b32c..b33e0666c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "prettier": "2.8.8" }, "engines": { - "node": "^14.13.1 || >=16.0.0" + "node": ">=16.0.0" }, "funding": { "url": "https://opencollective.com/lint-staged" diff --git a/package.json b/package.json index 3ecdb2be5..998158e8b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "url": "https://opencollective.com/lint-staged" }, "engines": { - "node": "^14.13.1 || >=16.0.0" + "node": "^16.14.0 || >=18.0.0" }, "type": "module", "bin": "./bin/lint-staged.js",