Skip to content

Commit

Permalink
feat: add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 18, 2019
1 parent 8556abe commit c5a185b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 54 deletions.
63 changes: 11 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,14 @@
"@antfu/eslint-config-ts": "0.2.10",
"@types/jest": "^24.0.23",
"@types/node": "12.12.17",
"@types/prettier": "^1.19.0",
"@types/vscode": "^1.40.0",
"@typescript-eslint/eslint-plugin": "2.11.0",
"@typescript-eslint/parser": "2.11.0",
"conventional-github-releaser": "3.1.3",
"eslint": "6.7.2",
"jest": "^24.9.0",
"prettier": "^1.19.1",
"rimraf": "3.0.0",
"standard-version": "7.0.1",
"ts-jest": "^24.2.0",
Expand Down
5 changes: 3 additions & 2 deletions src/commands/compile.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { window } from 'vscode'
import prettier from 'prettier'
import { Exec } from '../exec'
import { showOutputAsDocument } from './output'

export async function compile () {
const document = window.activeTextEditor?.document
if (document?.languageId === 'wenyan') {
try {
const result = await Exec(document.uri.fsPath) || ''

let result = await Exec(document.uri.fsPath) || ''
result = prettier.format(result, { semi: false })
showOutputAsDocument(result, undefined, 'javascript')
}
catch (e) {
Expand Down

0 comments on commit c5a185b

Please sign in to comment.