-
-
Notifications
You must be signed in to change notification settings - Fork 681
/
Copy pathno-deprecated-v-on-native-modifier.js
66 lines (62 loc) · 1.52 KB
/
no-deprecated-v-on-native-modifier.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
'use strict'
const rule = require('../../../lib/rules/no-deprecated-v-on-native-modifier')
const RuleTester = require('../../eslint-compat').RuleTester
const ruleTester = new RuleTester({
languageOptions: { parser: require('vue-eslint-parser'), ecmaVersion: 2015 }
})
ruleTester.run('no-deprecated-v-on-native-modifier', rule, {
valid: [
{
filename: 'test.vue',
code: "<template><input v-on:keyup.enter='fire'></template>"
},
{
filename: 'test.vue',
code: "<template><input @keyup.enter='fire'></template>"
},
{
filename: 'test.vue',
code: "<template><input v-native:foo.native.foo.bar='fire'></template>"
},
{
filename: 'test.vue',
code: "<template><input @native.enter='fire'></template>"
},
{
filename: 'test.vue',
code: "<template><input :keydown.native='fire'></template>"
}
],
invalid: [
{
filename: 'test.vue',
code: "<template><input v-on:keyup.native='fore'></template>",
errors: [
{
line: 1,
column: 29,
messageId: 'deprecated',
endLine: 1,
endColumn: 35
}
]
},
{
filename: 'test.vue',
code: "<template><input v-on:keyup.foo.native.bar='fore'></template>",
errors: [
{
line: 1,
column: 33,
messageId: 'deprecated',
endLine: 1,
endColumn: 39
}
]
}
]
})