mirror of
https://github.com/learnk8s/learnk8s.io.git
synced 2026-02-14 16:39:52 +00:00
Add a command for running an autoformat of the content
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
"visual:approve": "ts-node --files --transpile-only test.ts --approve",
|
||||
"check:canonical": "ts-node --files --transpile-only src/checkCanonical.ts",
|
||||
"build": "ts-node --files --transpile-only src/index.tsx",
|
||||
"autofmt": "ts-node --files --transpile-only src/autofmt.ts",
|
||||
"fmt": "ts-node --files --transpile-only src/check.ts",
|
||||
"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\"",
|
||||
"start": "ts-node --files --transpile-only src/start.ts"
|
||||
|
||||
15
src/autofmt.ts
Normal file
15
src/autofmt.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { LintMd } from '../repositories/lintmd/lintmd.cli'
|
||||
import { LintSVG } from '../repositories/svgo/svgo.cli'
|
||||
import { Prettier } from '../repositories/prettier/prettier.cli'
|
||||
import { exit } from 'shelljs'
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
await LintMd(['{src,repositories}/**/*.md'], true)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
run()
|
||||
Reference in New Issue
Block a user