@@ -6,7 +6,7 @@ import * as parser from 'vue-eslint-parser'
6
6
import wrap from '../src/wrapVueTransformation'
7
7
8
8
export const transformAST : VueASTTransformation = ( context ) => {
9
- var fixOperations : Operation [ ] = [ ]
9
+ let fixOperations : Operation [ ] = [ ]
10
10
const toFixNodes : Node [ ] = findNodes ( context )
11
11
toFixNodes . forEach ( ( node ) => {
12
12
fixOperations = fixOperations . concat ( fix ( node ) )
@@ -19,16 +19,15 @@ export default wrap(transformAST)
19
19
* search slot attribute nodes
20
20
*
21
21
* @param context
22
- * @param templateBody
23
22
* @returns slot attribute nodes
24
23
*/
25
24
function findNodes ( context : any ) : Node [ ] {
26
25
const { file } = context
27
26
const source = file . source
28
27
const options = { sourceType : 'module' }
29
28
const ast = parser . parse ( source , options )
30
- var toFixNodes : Node [ ] = [ ]
31
- var root : Node = < Node > ast . templateBody
29
+ let toFixNodes : Node [ ] = [ ]
30
+ let root : Node = < Node > ast . templateBody
32
31
parser . AST . traverseNodes ( root , {
33
32
enterNode ( node : Node ) {
34
33
if ( node . type === 'VAttribute' && node . key . name === 'slot' ) {
@@ -41,11 +40,10 @@ function findNodes(context: any): Node[] {
41
40
}
42
41
/**
43
42
* fix logic
44
- * @param fixer
45
- * @param slotAttr
43
+ * @param node
46
44
*/
47
45
function fix ( node : Node ) : Operation [ ] {
48
- var fixOperations : Operation [ ] = [ ]
46
+ let fixOperations : Operation [ ] = [ ]
49
47
50
48
const target : any = node ! . parent ! . parent
51
49
// @ts -ignore
0 commit comments