S2 EsLint implementation
All checks were successful
Build, test and publish / verify (push) Successful in 1m40s
All checks were successful
Build, test and publish / verify (push) Successful in 1m40s
This commit is contained in:
21
agiledancers-fe/lint-staged.config.mjs
Normal file
21
agiledancers-fe/lint-staged.config.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
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(' ')}`];
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user