Skip to content

Commit

Permalink
docs: add migration notice
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Jun 9, 2023
1 parent de25c73 commit 84869cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.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.
Expand Down Expand Up @@ -222,7 +226,7 @@ Linter commands work on a subset of all staged files, defined by a _glob pattern
- **`"!(*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`
- **`"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

Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 84869cf

Please sign in to comment.