Skip to content

Commit

Permalink
using ts-standard
Browse files Browse the repository at this point in the history
  • Loading branch information
anniegale9538 committed Jun 14, 2024
1 parent c5c0491 commit e2106d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@
"stoppable": "^1.1.0",
"tap": "^16.1.0",
"ts-node": "^10.7.0",
"ts-standard": "^11.0.0",
"typescript": "^4.6.4",
"ts-standard": "11.0.0",
"eslint": "7.28.0",
"typescript": "4.6.4",
"workq": "^3.0.0",
"xmlbuilder2": "^3.0.2",
"zx": "^7.2.2"
Expand Down
14 changes: 11 additions & 3 deletions scripts/generate-docs-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
const { join } = require('path')
const { writeFileSync } = require('fs')
const rimraf = require('rimraf')
const standard = require('standard').default
const tsStandard = require('ts-standard')
const dedent = require('dedent')

const docsExamplesDir = join('docs', 'doc_examples')
Expand Down Expand Up @@ -140,8 +140,16 @@ console.log(response${getResponsePostfix(i)})
}

code += '// END\n}'
const results = await standard.lintText(code, { fix: true })
code = results[0].output
const results = await new Promise((resolve, reject) => {
tsStandard.lintText(code, {fix: true}, (err, result) => {
if (err) {
reject(err)
} else {
resolve(result)
}
})
})
code = results.results[0].output
code = code.slice(code.indexOf('// START\n') + 9, code.indexOf('\n\n// END'))

asciidoc += `[source, js]
Expand Down

0 comments on commit e2106d3

Please sign in to comment.