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