mirror of
https://github.com/hanzo-studio/studio-desktop.git
synced 2026-10-30 18:54:12 +00:00
18 lines
464 B
JavaScript
18 lines
464 B
JavaScript
export default {
|
|
'./**/*.js': formatAndEslint,
|
|
'./**/*.{ts,mts}': (stagedFiles) => [
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
...formatAndEslint(stagedFiles),
|
|
'tsc --noEmit',
|
|
],
|
|
};
|
|
|
|
/**
|
|
* Run prettier and eslint on staged files.
|
|
* @param {string[]} fileNames
|
|
* @returns {string[]}
|
|
*/
|
|
function formatAndEslint(fileNames) {
|
|
return [`prettier --write ${fileNames.join(' ')}`, `eslint --fix ${fileNames.join(' ')}`];
|
|
}
|