17 lines
500 B
JavaScript
17 lines
500 B
JavaScript
import path from "node:path"
|
|
|
|
// https://nextjs.org/docs/app/building-your-application/configuring/eslint#lint-staged
|
|
const buildEslintCommand = (filenames) =>
|
|
`next lint --fix --max-warnings 0 --file ${filenames
|
|
.map((f) => path.relative(process.cwd(), f))
|
|
.join(" --file ")}`
|
|
|
|
const config = {
|
|
"*.{js,jsx,ts,tsx}": [buildEslintCommand],
|
|
"*.{ts,tsx}": () => "tsc -p tsconfig.json --noEmit",
|
|
"*": "prettier --write",
|
|
"i18n/dictionaries/*.json": "jsonsort",
|
|
}
|
|
|
|
export default config
|