@@ -6,7 +6,7 @@ import globals from 'globals'
66import utils from 'eslint-plugin-vue/lib/utils/index.js'
77import eslintParser from 'vue-eslint-parser'
88
9- RuleTester . describe = describe
9+ RuleTester . describe = describe . skip
1010RuleTester . it = it
1111
1212const ruleTester = new RuleTester ( {
@@ -39,37 +39,37 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
3939 valid : [
4040 {
4141 name : 'allows correct key in js' ,
42- code : '$tc ("components.hello.world")' ,
42+ code : '$t ("components.hello.world")' ,
4343 options : options ,
4444 filename : '/src/components/hello.js' ,
4545 } ,
4646 {
4747 name : 'allows correct key in vue component js' ,
48- code : '<script>$tc ("components.helloWorld.foo")</script>' ,
48+ code : '<script>$t ("components.helloWorld.foo")</script>' ,
4949 options : options ,
5050 filename : '/src/components/HelloWorld.vue' ,
5151 } ,
5252 {
5353 name : 'allows correct key in vue component setup script' ,
54- code : '<script setup>const translation = $tc ("components.helloWorld.foo")</script>' ,
54+ code : '<script setup>const translation = $t ("components.helloWorld.foo")</script>' ,
5555 options : options ,
5656 filename : '/src/components/HelloWorld.vue' ,
5757 } ,
5858 {
5959 name : 'allows correct key in scoped use in vue component js' ,
60- code : '<script>export default { computed: { translate() { return this.$tc ("components.helloWorld.foo") } } }</script>' ,
60+ code : '<script>export default { computed: { translate() { return this.$t ("components.helloWorld.foo") } } }</script>' ,
6161 options : options ,
6262 filename : '/src/components/HelloWorld.vue' ,
6363 } ,
6464 {
6565 name : 'allows correct key in vue component template mustache syntax' ,
66- code : '<template>{{ $tc ("components.helloWorld.foo") }}</template>' ,
66+ code : '<template>{{ $t ("components.helloWorld.foo") }}</template>' ,
6767 options : options ,
6868 filename : '/src/components/HelloWorld.vue' ,
6969 } ,
7070 {
7171 name : 'allows correct key in vue component template v-bind' ,
72- code : '<template><div :title="$tc (\'components.helloWorld.foo\')"></div></template>' ,
72+ code : '<template><div :title="$t (\'components.helloWorld.foo\')"></div></template>' ,
7373 options : options ,
7474 filename : '/src/components/HelloWorld.vue' ,
7575 } ,
@@ -93,37 +93,37 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
9393 } ,
9494 {
9595 name : 'allows global key, based on ignoreKeysRegex' ,
96- code : '$tc ("global.something")' ,
96+ code : '$t ("global.something")' ,
9797 options : options ,
9898 filename : '/src/components/hello.js' ,
9999 } ,
100100 {
101101 name : 'allows correct key with complex directory names' ,
102- code : '$tc ("components.camelCase.kebabCase.pascalCase.withPeriod.hello.world")' ,
102+ code : '$t ("components.camelCase.kebabCase.pascalCase.withPeriod.hello.world")' ,
103103 options : options ,
104104 filename : '/src/components/camelCase/kebab-case/PascalCase/with.period/hello.js' ,
105105 } ,
106106 {
107107 name : 'allows correct key with single quotes' ,
108- code : "$tc ('components.hello.world')" ,
108+ code : "$t ('components.hello.world')" ,
109109 options : options ,
110110 filename : '/src/components/hello.js' ,
111111 } ,
112112 {
113113 name : 'allows correct key with single quotes' ,
114- code : '$tc (\'components.hello.world\', 0, { test: "foo" })' ,
114+ code : '$t (\'components.hello.world\', 0, { test: "foo" })' ,
115115 options : options ,
116116 filename : '/src/components/hello.js' ,
117117 } ,
118118 {
119119 name : 'allows correct key with backticks' ,
120- code : '$tc (`components.hello.world`)' ,
120+ code : '$t (`components.hello.world`)' ,
121121 options : options ,
122122 filename : '/src/components/hello.js' ,
123123 } ,
124124 {
125125 name : 'allows correct key with arguments' ,
126- code : '$tc ("components.hello.world", 0, { test: "foo" })' ,
126+ code : '$t ("components.hello.world", 0, { test: "foo" })' ,
127127 options : options ,
128128 filename : '/src/components/hello.js' ,
129129 } ,
@@ -135,37 +135,37 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
135135 } ,
136136 {
137137 name : 'ignores call without arguments' ,
138- code : '$tc ()' ,
138+ code : '$t ()' ,
139139 options : options ,
140140 filename : '/src/components/hello.js' ,
141141 } ,
142142 {
143143 name : 'ignores unrelated file type' ,
144- code : "$tc ('hello.world')" ,
144+ code : "$t ('hello.world')" ,
145145 options : options ,
146146 filename : '/src/components/hello.json' ,
147147 } ,
148148 {
149149 name : 'ignores test file' ,
150- code : "$tc ('hello.world')" ,
150+ code : "$t ('hello.world')" ,
151151 options : options ,
152152 filename : '/src/components/hello.spec.js' ,
153153 } ,
154154 {
155155 name : 'ignores test helper file' ,
156- code : "$tc ('hello.world')" ,
156+ code : "$t ('hello.world')" ,
157157 options : options ,
158158 filename : '/src/components/__tests__/hello.js' ,
159159 } ,
160160 {
161161 name : 'ignores e2e test file' ,
162- code : "$tc ('hello.world')" ,
162+ code : "$t ('hello.world')" ,
163163 options : options ,
164164 filename : '/src/e2e/hello.js' ,
165165 } ,
166166 {
167167 name : 'accepts source file paths which do not start with /src' ,
168- code : '$tc ("components.hello.world")' ,
168+ code : '$t ("components.hello.world")' ,
169169 options : options ,
170170 filename : '/components/hello.js' ,
171171 } ,
@@ -174,7 +174,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
174174 invalid : [
175175 {
176176 name : 'lints incorrect key in js' ,
177- code : '$tc ("hello.world")' ,
177+ code : '$t ("hello.world")' ,
178178 options : options ,
179179 filename : '/src/components/hello.js' ,
180180 errors : [
@@ -186,7 +186,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
186186 } ,
187187 {
188188 name : 'lints incorrect key in vue component js' ,
189- code : '<script>$tc ("hello.world")</script>' ,
189+ code : '<script>$t ("hello.world")</script>' ,
190190 options : options ,
191191 filename : '/src/components/HelloWorld.vue' ,
192192 errors : [
@@ -198,7 +198,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
198198 } ,
199199 {
200200 name : 'lints incorrect key in vue component setup script' ,
201- code : '<script setup>const translation = $tc ("hello.world")</script>' ,
201+ code : '<script setup>const translation = $t ("hello.world")</script>' ,
202202 options : options ,
203203 filename : '/src/components/HelloWorld.vue' ,
204204 errors : [
@@ -210,7 +210,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
210210 } ,
211211 {
212212 name : 'lints correct key in scoped use in vue component js' ,
213- code : '<script>export default { computed: { translate() { return this.$tc ("hello.world") } } }</script>' ,
213+ code : '<script>export default { computed: { translate() { return this.$t ("hello.world") } } }</script>' ,
214214 options : options ,
215215 filename : '/src/components/HelloWorld.vue' ,
216216 errors : [
@@ -222,7 +222,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
222222 } ,
223223 {
224224 name : 'lints incorrect key in vue component template mustache syntax' ,
225- code : '<template>{{ $tc ("hello.world") }}</template>' ,
225+ code : '<template>{{ $t ("hello.world") }}</template>' ,
226226 options : options ,
227227 filename : '/src/components/HelloWorld.vue' ,
228228 errors : [
@@ -234,7 +234,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
234234 } ,
235235 {
236236 name : 'lints incorrect key in vue component template v-bind' ,
237- code : '<template><div :title="$tc (\'hello.world\')"></div></template>' ,
237+ code : '<template><div :title="$t (\'hello.world\')"></div></template>' ,
238238 options : options ,
239239 filename : '/src/components/HelloWorld.vue' ,
240240 errors : [
@@ -270,7 +270,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
270270 } ,
271271 {
272272 name : 'lints incorrect global key, based on ignoreKeysRegex' ,
273- code : '$tc ("something.containing.global.hello.world")' ,
273+ code : '$t ("something.containing.global.hello.world")' ,
274274 options : options ,
275275 filename : '/src/components/hello.js' ,
276276 errors : [
@@ -282,7 +282,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
282282 } ,
283283 {
284284 name : 'lints incorrect key with single quotes' ,
285- code : "$tc ('hello.world')" ,
285+ code : "$t ('hello.world')" ,
286286 options : options ,
287287 filename : '/src/components/hello.js' ,
288288 errors : [
@@ -294,7 +294,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
294294 } ,
295295 {
296296 name : 'lints incorrect key with backticks' ,
297- code : '$tc (`hello.world`)' ,
297+ code : '$t (`hello.world`)' ,
298298 options : options ,
299299 filename : '/src/components/hello.js' ,
300300 errors : [
@@ -306,7 +306,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
306306 } ,
307307 {
308308 name : 'lints incorrect key with arguments' ,
309- code : '$tc (\'hello.world\', 0, { test: "foo" })' ,
309+ code : '$t (\'hello.world\', 0, { test: "foo" })' ,
310310 options : options ,
311311 filename : '/src/components/hello.js' ,
312312 errors : [
@@ -330,7 +330,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
330330 } ,
331331 {
332332 name : 'lints empty key in js' ,
333- code : '$tc ("")' ,
333+ code : '$t ("")' ,
334334 options : options ,
335335 filename : '/src/components/hello.js' ,
336336 errors : [
@@ -342,7 +342,7 @@ ruleTester.run('local-rules/matching-translation-keys', ruleInstance, {
342342 } ,
343343 {
344344 name : 'lints in file with path which does not start with src/' ,
345- code : '$tc ("hello.world")' ,
345+ code : '$t ("hello.world")' ,
346346 options : options ,
347347 filename : '/components/hello.js' ,
348348 errors : [
0 commit comments