Skip to content

Commit bef4f4b

Browse files
committed
chore: format comment
1 parent e5acbb2 commit bef4f4b

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

transformations/add-emit-declaration.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import wrap from '../src/wrapAstTransformation'
22
import type { ASTTransformation } from '../src/wrapAstTransformation'
33

44
export const transformAST: ASTTransformation = ({ root, j }) => {
5-
// find the export default
5+
// find the export default
66
const defaultExportBody = root.find(j.ExportDefaultDeclaration)
77

8-
// find the CallExpression
8+
// find the CallExpression
99
const emitCalls = defaultExportBody.find(j.CallExpression, node => {
1010
return (
1111
node.callee.object?.type === 'ThisExpression' &&
@@ -14,15 +14,15 @@ export const transformAST: ASTTransformation = ({ root, j }) => {
1414
})
1515

1616
if (emitCalls.length) {
17-
// find the $emit argument
17+
// find the $emit argument
1818
const eventNames: string[] = []
1919
emitCalls.forEach(({ node }) => {
2020
if (node.arguments[0]?.type === 'StringLiteral') {
2121
eventNames.push(node.arguments[0].value)
2222
}
2323
})
2424

25-
// find the emit property
25+
// find the emit property
2626
const emitsProperty = defaultExportBody.find(j.ObjectProperty, node => {
2727
return node.key.name === 'emits' && node.value.type === 'ArrayExpression'
2828
})
@@ -41,7 +41,7 @@ export const transformAST: ASTTransformation = ({ root, j }) => {
4141
})
4242

4343
if (!hasEmitsProperty) {
44-
// no emits property then create emits:[...] AST
44+
// no emits property then create emits:[...] AST
4545
defaultExportBody
4646
.get(0)
4747
.node.declaration.properties?.unshift(

transformations/global-filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import wrap from '../src/wrapAstTransformation'
22
import type { ASTTransformation } from '../src/wrapAstTransformation'
33

44
export const transformAST: ASTTransformation = ({ root, j }) => {
5-
// find the createApp()
5+
// find the createApp()
66
const appDeclare = root.find(j.VariableDeclarator, {
77
id: { type: 'Identifier' },
88
init: {

transformations/render-to-resolveComponent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export const transformAST: ASTTransformation = context => {
3131
})
3232

3333
if (!callExpressionCollection.length) return
34-
// find the component name
34+
// find the component name
3535
const componentName =
3636
callExpressionCollection.get(0).node.arguments[0].value
37-
// remove non-letter for complying variable name rules
37+
// remove non-letter for complying variable name rules
3838
const componentVariableName = removeNonLetter(componentName)
3939
callExpressionCollection
4040
.get(0)
@@ -45,7 +45,7 @@ export const transformAST: ASTTransformation = context => {
4545
.find(j.VariableDeclaration)
4646
.get().node
4747
)
48-
// replace h('xxx') with resolveComponent('xxx')
48+
// replace h('xxx') with resolveComponent('xxx')
4949
callExpressionCollection.replaceWith(
5050
// @ts-ignore
5151
nodePath => (nodePath.node.callee.name = componentVariableName)
@@ -69,7 +69,7 @@ function removeNonLetter(str: string): string | undefined {
6969
) {
7070
returnValue += str[i]
7171
} else {
72-
// non-letter , remove and uppercase the first letter after non-letter
72+
// non-letter , remove and uppercase the first letter after non-letter
7373
i++
7474
if (str[i] >= 'a' && str[i] <= 'z') {
7575
returnValue += String.fromCharCode(str[i].charCodeAt(0) - 32)

transformations/tree-shaking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const transformAST: ASTTransformation = context => {
1010
observable(context)
1111
version(context)
1212

13-
// remove import 'Vue' from 'vue' if not used
13+
// remove import 'Vue' from 'vue' if not used
1414
removeImport(context, { localBinding: 'Vue' })
1515
}
1616

transformations/v-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const transformAST: ASTTransformation = ({ j, root }) => {
6767
.get(0).node
6868

6969
if (!methodsCollections.length) {
70-
// method option dont exists ,push a method option
70+
// method option dont exists ,push a method option
7171
propsCollections
7272
.get(0)
7373
.parent.value.properties.push(

0 commit comments

Comments
 (0)