mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 12:41:36 +10:00
chore: tidying
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
const path = require('path');
|
||||
|
||||
const buildEslintCommand = (filenames) =>
|
||||
const eslint = (filenames) =>
|
||||
`eslint --fix ${filenames.map((f) => `"${path.relative(process.cwd(), f)}"`).join(' ')}`;
|
||||
|
||||
const buildPrettierCommand = (filenames) =>
|
||||
const prettier = (filenames) =>
|
||||
`prettier --write ${filenames.map((f) => `"${path.relative(process.cwd(), f)}"`).join(' ')}`;
|
||||
|
||||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = {
|
||||
'**/*.{ts,tsx,cts,mts}': [buildEslintCommand, buildPrettierCommand],
|
||||
'**/*.{js,jsx,cjs,mjs}': [buildPrettierCommand],
|
||||
'**/*.{yml,mdx}': [buildPrettierCommand],
|
||||
'**/*.{ts,tsx,cts,mts}': [eslint, prettier],
|
||||
'**/*.{js,jsx,cjs,mjs}': [prettier],
|
||||
'**/*.{yml,mdx}': [prettier],
|
||||
'**/*/package.json': 'npm run precommit',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user