-
-
Notifications
You must be signed in to change notification settings - Fork 681
/
Copy pathscript-setup.js
48 lines (45 loc) · 1008 Bytes
/
script-setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
'use strict'
const RuleTester = require('eslint').RuleTester
const rule = require('../../../../lib/rules/no-unsupported-features')
const utils = require('./utils')
const buildOptions = utils.optionsBuilder('script-setup', '^3.0.0')
const tester = new RuleTester({
parser: require.resolve('vue-eslint-parser'),
parserOptions: {
ecmaVersion: 2019
}
})
tester.run('no-unsupported-features/script-setup', rule, {
valid: [
{
code: `
<script setup>
</script>`,
options: buildOptions()
},
{
code: `
<script>
</script>`,
options: buildOptions({ version: '^2.6.0' })
}
],
invalid: [
{
code: `
<script setup>
</script>`,
options: buildOptions({ version: '^2.6.0' }),
errors: [
{
message: '`<script setup>` are not supported until Vue.js "3.0.0".',
line: 2
}
]
}
]
})