2022-11-20 13:19:57 +00:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const buildEslintCommand = (filenames) =>
|
|
|
|
`next lint --fix --file ${filenames
|
|
|
|
.map((f) => path.relative(process.cwd(), f))
|
|
|
|
.join(' --file ')}`;
|
|
|
|
|
|
|
|
const buildPrettierCommand = (filenames) =>
|
|
|
|
`yarn prettier --write --ignore-unknown ${filenames.join(' ')}`;
|
|
|
|
|
|
|
|
module.exports = {
|
2023-02-17 14:43:52 +00:00
|
|
|
'src/**/*.{js,jsx,ts,tsx}': [buildEslintCommand, buildPrettierCommand],
|
2022-11-20 13:19:57 +00:00
|
|
|
};
|