diff --git a/README.md b/README.md index 40c58faf8..7693be396 100644 --- a/README.md +++ b/README.md @@ -611,6 +611,29 @@ See more on [this blog post](https://medium.com/@tomchentw/imagemin-lint-staged- +### Integrate with Next.js + +
+ Click to expand + +```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], +} +``` + +
+ ## Frequently Asked Questions ### The output of commit hook looks weird (no colors, duplicate lines, …)