/* eslint-disable no-undef */
const path = require('path'); // eslint-disable-line @typescript-eslint/no-require-imports

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

module.exports = {
  '*.{js,jsx,ts,tsx}': [buildEslintCommand, 'prettier --write'],
  '*.{json,md,css,scss}': ['prettier --write'],
};
