Skip to content

Commit dcbdf1d

Browse files
authored
Add test case
1 parent 7dab777 commit dcbdf1d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/lib/rules/no-import-compiler-macros.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,33 @@ tester.run('no-import-compiler-macros', rule, {
215215
}
216216
]
217217
},
218+
{
219+
filename: 'test.vue',
220+
code: `
221+
<script>
222+
// not in <script setup>
223+
import { defineProps } from 'vue'
224+
</script>
225+
`,
226+
output: `
227+
<script>
228+
// not in <script setup>
229+
230+
</script>
231+
`,
232+
errors: [
233+
{
234+
messageId: 'onlyValidInScriptSetup',
235+
data: {
236+
name: 'defineProps'
237+
},
238+
line: 4,
239+
column: 16,
240+
endLine: 4,
241+
endColumn: 27
242+
}
243+
]
244+
},
218245
{
219246
filename: 'test.ts',
220247
code: `

0 commit comments

Comments
 (0)