From 4568014f6a9f330079cf1d053298b67b6aabaae9 Mon Sep 17 00:00:00 2001 From: Maksim Baranov Date: Wed, 23 Apr 2025 14:25:56 +0200 Subject: [PATCH 1/2] fix: fix not triggering no-dynamic-keys in non-vue files --- lib/rules/no-dynamic-keys.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/rules/no-dynamic-keys.ts b/lib/rules/no-dynamic-keys.ts index a5206777..3c297808 100644 --- a/lib/rules/no-dynamic-keys.ts +++ b/lib/rules/no-dynamic-keys.ts @@ -1,7 +1,11 @@ /** * @author kazuya kawaguchi (a.k.a. kazupon) */ -import { defineTemplateBodyVisitor, isStaticLiteral } from '../utils/index' +import { + compositingVisitors, + defineTemplateBodyVisitor, + isStaticLiteral +} from '../utils/index' import type { RuleContext, RuleListener } from '../types' import type { AST as VAST } from 'vue-eslint-parser' import { createRule } from '../utils/rule' @@ -93,9 +97,8 @@ function checkCallExpression( } function create(context: RuleContext): RuleListener { - return defineTemplateBodyVisitor( - context, - { + return compositingVisitors( + defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name='t']"(node: VAST.VDirective) { checkDirective(context, node) }, @@ -113,7 +116,7 @@ function create(context: RuleContext): RuleListener { CallExpression(node: VAST.ESLintCallExpression) { checkCallExpression(context, node) } - }, + }), { CallExpression(node: VAST.ESLintCallExpression) { checkCallExpression(context, node) From 79968411add76e6f999829ed51fb3a5afaf5ae0d Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Tue, 29 Jul 2025 18:45:18 +0900 Subject: [PATCH 2/2] Create empty-steaks-stare.md --- .changeset/empty-steaks-stare.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/empty-steaks-stare.md diff --git a/.changeset/empty-steaks-stare.md b/.changeset/empty-steaks-stare.md new file mode 100644 index 00000000..4c0dd84a --- /dev/null +++ b/.changeset/empty-steaks-stare.md @@ -0,0 +1,5 @@ +--- +"@intlify/eslint-plugin-vue-i18n": minor +--- + +Improved to apply no-dynamic-keys rule to non-Vue files as well.