-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbadges.js
18 lines (15 loc) · 902 Bytes
/
badges.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const dedent = require('../packages/eslint-plugin-codegen/node_modules/dedent')
const {getRushJson} = require('../tools/builder')
/** @type {import('../packages/eslint-plugin-codegen').Preset<{}>} */
module.exports = params => {
const {rush} = getRushJson()
const matchedProject = rush.projects.find(p => params.meta.filename.replace(/\\/g, '/').includes(p.projectFolder))
const relativePath = matchedProject.projectFolder
const leafPkg = {name: matchedProject.packageName}
const repo = 'https://github.com/mmkal/ts'
return dedent`
[](${repo}/actions?query=workflow%3A%22Node+CI%22)
[](https://codecov.io/gh/mmkal/ts/tree/main/${relativePath})
[](https://npmjs.com/package/${leafPkg.name})
`
}