Skip to content

Commit c9f66dc

Browse files
amitsahadanielepolencic
authored andcommitted
Add a command for running an autoformat of the content
1 parent 7b5780d commit c9f66dc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"visual:approve": "ts-node --files --transpile-only test.ts --approve",
88
"check:canonical": "ts-node --files --transpile-only src/checkCanonical.ts",
99
"build": "ts-node --files --transpile-only src/index.tsx",
10+
"autofmt": "ts-node --files --transpile-only src/autofmt.ts",
1011
"fmt": "ts-node --files --transpile-only src/check.ts",
1112
"test": "cross-env tsc --noEmit && ts-node --files node_modules/tape/bin/tape \"src/**/test.ts\" \"src/**/*.test.ts\" \"src/**/*.integration.ts\" \"src/**/integration.ts\"",
1213
"start": "ts-node --files --transpile-only src/start.ts"

src/autofmt.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { LintMd } from '../repositories/lintmd/lintmd.cli'
2+
import { LintSVG } from '../repositories/svgo/svgo.cli'
3+
import { Prettier } from '../repositories/prettier/prettier.cli'
4+
import { exit } from 'shelljs'
5+
6+
async function run() {
7+
try {
8+
await LintMd(['{src,repositories}/**/*.md'], true)
9+
} catch (error) {
10+
console.log(error)
11+
exit(1)
12+
}
13+
}
14+
15+
run()

0 commit comments

Comments
 (0)