Skip to content

Commit

Permalink
fix(plugin-script): js plugin code format when save (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexqi authored Dec 11, 2023
1 parent af3989a commit 699dc7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/plugins/script/src/js/method.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { ref, reactive, watchEffect, onActivated, nextTick } from 'vue'
import { useCanvas, useModal, useNotify } from '@opentiny/tiny-engine-controller'
import { string2Ast, ast2String, insertName } from '@opentiny/tiny-engine-common/js/ast'
import { string2Ast, ast2String, insertName, formatString } from '@opentiny/tiny-engine-common/js/ast'
import { constants } from '@opentiny/tiny-engine-utils'
import { getSchema } from '@opentiny/tiny-engine-canvas'
import { lint } from '@opentiny/tiny-engine-common/js/linter'
Expand Down Expand Up @@ -109,7 +109,7 @@ const saveMethods = () => {
delete declaration.trailingComments
}

const content = ast2String(declaration).trim()
const content = formatString(ast2String(declaration).trim(), 'javascript')

saveMethod({ name, content })
})
Expand Down

0 comments on commit 699dc7b

Please sign in to comment.