Skip to content

Commit

Permalink
docs: add example to integrate with Next.js (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
Haltarys authored Jan 28, 2023
1 parent 8f63a0a commit 421234c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,29 @@ See more on [this blog post](https://medium.com/@tomchentw/imagemin-lint-staged-

</details>

### Integrate with Next.js

<details>
<summary>Click to expand</summary>

```js
// .lintstagedrc.js
// See https://nextjs.org/docs/basic-features/eslint#lint-staged for details

const path = require('path')

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(' --file ')}`

module.exports = {
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
}
```

</details>

## Frequently Asked Questions

### The output of commit hook looks weird (no colors, duplicate lines, …)
Expand Down

0 comments on commit 421234c

Please sign in to comment.