Skip to content

Commit 4568014

Browse files
committed
fix: fix not triggering no-dynamic-keys in non-vue files
1 parent 3693f87 commit 4568014

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/rules/no-dynamic-keys.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
/**
22
* @author kazuya kawaguchi (a.k.a. kazupon)
33
*/
4-
import { defineTemplateBodyVisitor, isStaticLiteral } from '../utils/index'
4+
import {
5+
compositingVisitors,
6+
defineTemplateBodyVisitor,
7+
isStaticLiteral
8+
} from '../utils/index'
59
import type { RuleContext, RuleListener } from '../types'
610
import type { AST as VAST } from 'vue-eslint-parser'
711
import { createRule } from '../utils/rule'
@@ -93,9 +97,8 @@ function checkCallExpression(
9397
}
9498

9599
function create(context: RuleContext): RuleListener {
96-
return defineTemplateBodyVisitor(
97-
context,
98-
{
100+
return compositingVisitors(
101+
defineTemplateBodyVisitor(context, {
99102
"VAttribute[directive=true][key.name='t']"(node: VAST.VDirective) {
100103
checkDirective(context, node)
101104
},
@@ -113,7 +116,7 @@ function create(context: RuleContext): RuleListener {
113116
CallExpression(node: VAST.ESLintCallExpression) {
114117
checkCallExpression(context, node)
115118
}
116-
},
119+
}),
117120
{
118121
CallExpression(node: VAST.ESLintCallExpression) {
119122
checkCallExpression(context, node)

0 commit comments

Comments
 (0)