All checks were successful
Build, test and publish / verify (push) Successful in 1m40s
22 lines
719 B
JavaScript
22 lines
719 B
JavaScript
import path from 'node:path';
|
|
|
|
export default {
|
|
'*.{ts,js,mjs,cjs,html,css,json,prettierrc}': (files) => {
|
|
const maintained = files.filter((file) => {
|
|
const relative = path
|
|
.relative(import.meta.dirname, file)
|
|
.split(path.sep)
|
|
.join('/');
|
|
return (
|
|
!relative.startsWith('../') &&
|
|
!/^(node_modules|dist|out-tsc|bazel-out|tmp|typings|__screenshots__|\.history|\.angular|coverage|test-results|unit-results|playwright-report)\//.test(
|
|
relative,
|
|
) &&
|
|
relative !== 'package-lock.json'
|
|
);
|
|
});
|
|
if (!maintained.length) return [];
|
|
return [`prettier --write ${maintained.map((file) => JSON.stringify(file)).join(' ')}`];
|
|
},
|
|
};
|