0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/.scripts/merge-eslint-reports.js

18 lines
545 B
JavaScript
Raw Normal View History

2022-12-29 01:52:43 -05:00
import fs from 'fs';
2022-12-14 12:24:32 -05:00
const directories = [
...fs.readdirSync('./packages'),
...fs.readdirSync('./packages/toolkit').map((dir) => 'toolkit/' + dir)
];
const reports = directories
2022-12-14 12:24:32 -05:00
// Filter out unavailable paths
.filter((dir) => !['create', 'toolkit'].includes(dir) && !dir.includes('.'))
.map((dir) => fs.readFileSync(`./packages/${dir}/report.json`, { encoding: 'utf-8' }));
const merged = [];
for (const report of reports) {
merged.push(...JSON.parse(report));
}
fs.writeFileSync('./eslint_report.json', JSON.stringify(merged));