mirror of
https://github.com/hanzo-studio/studio-desktop.git
synced 2026-10-30 18:54:12 +00:00
15 lines
432 B
JavaScript
15 lines
432 B
JavaScript
/** @type {import('lint-staged').Configuration} */
|
|
export default {
|
|
'./**/*.js': formatAndEslint,
|
|
'./**/*.{ts,mts}': (stagedFiles) => [...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(' ')}`];
|
|
}
|