/
test.js.snap
122 lines (119 loc) · 3.02 KB
/
test.js.snap
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`it should produce the expected lint ouput 1`] = `
Array [
Object {
"errorCount": 1,
"filePath": "/usr/linked/Hello.vue",
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"messages": Array [
Object {
"column": 29,
"endColumn": 32,
"endLine": 31,
"line": 31,
"message": "Unexpected any. Specify a different type.",
"messageId": "unexpectedAny",
"nodeType": "TSAnyKeyword",
"ruleId": "@typescript-eslint/no-explicit-any",
"severity": 2,
"suggestions": Array [
Object {
"desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.",
"fix": Object {
"range": Array [
708,
711,
],
"text": "unknown",
},
"messageId": "suggestUnknown",
},
Object {
"desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
"fix": Object {
"range": Array [
708,
711,
],
"text": "never",
},
"messageId": "suggestNever",
},
],
},
],
"source": "<!-- Hello.vue -->
<template>
<div>
<div>
<!-- !!!!! expected error !!!!! -->
Hello {{ (name as any) }}{{exclamationMarks}}
</div>
<button @click=\\"decrement\\">-</button>
<button @click=\\"increment\\">+</button>
</div>
</template>
<script lang=\\"ts\\">
import Vue from \\"vue\\";
export default Vue.extend({
props: ['name', 'initialEnthusiasm'],
data() {
return {
enthusiasm: this.initialEnthusiasm,
}
},
methods: {
increment() { this.enthusiasm++; },
decrement() {
if (this.enthusiasm > 1) {
this.enthusiasm--;
}
},
},
computed: {
exclamationMarks(): any { // !!!!! expected error !!!!!
return Array(this.enthusiasm + 1).join('!');
}
}
});
</script>
",
"usedDeprecatedRules": Array [],
"warningCount": 0,
},
Object {
"errorCount": 0,
"filePath": "/usr/linked/Utility.vue",
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"messages": Array [],
"output": "<script lang=\\"ts\\">
/* https://github.com/typescript-eslint/typescript-eslint/issues/2591 */
/* eslint-disable class-methods-use-this */
export default class Utility {
get a() {
const list: Array<string> = [];
return list;
}
get b() {
const a = this.a;
return a;
}
}
</script>
",
"usedDeprecatedRules": Array [],
"warningCount": 0,
},
Object {
"errorCount": 0,
"filePath": "/usr/linked/World.vue",
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"messages": Array [],
"usedDeprecatedRules": Array [],
"warningCount": 0,
},
]
`;