3
3
*/
4
4
'use strict'
5
5
6
+ const semver = require ( 'semver' )
6
7
const { RuleTester } = require ( '../../eslint-compat' )
7
8
const rule = require ( '../../../lib/rules/func-call-spacing' )
9
+ const { eslintStylisticVersion } = require ( '../../test-utils/eslint-stylistic' )
8
10
9
11
const tester = new RuleTester ( {
10
12
languageOptions : { parser : require ( 'vue-eslint-parser' ) , ecmaVersion : 2020 }
@@ -61,7 +63,11 @@ tester.run('func-call-spacing', rule, {
61
63
errors : [
62
64
{
63
65
message : 'Unexpected whitespace between function name and paren.' ,
64
- line : 3
66
+ line : 3 ,
67
+ ...( eslintStylisticVersion === undefined ||
68
+ semver . lt ( eslintStylisticVersion , '3.0.0' )
69
+ ? { column : 20 , endLine : undefined , endColumn : undefined }
70
+ : { column : 23 , endLine : 3 , endColumn : 24 } )
65
71
}
66
72
]
67
73
} ,
@@ -80,7 +86,11 @@ tester.run('func-call-spacing', rule, {
80
86
errors : [
81
87
{
82
88
message : 'Missing space between function name and paren.' ,
83
- line : 3
89
+ line : 3 ,
90
+ ...( eslintStylisticVersion === undefined ||
91
+ semver . lt ( eslintStylisticVersion , '3.0.0' )
92
+ ? { column : 20 , endLine : undefined , endColumn : undefined }
93
+ : { column : 23 , endLine : 3 , endColumn : 23 } )
84
94
}
85
95
]
86
96
} ,
@@ -102,7 +112,11 @@ tester.run('func-call-spacing', rule, {
102
112
errors : [
103
113
{
104
114
message : 'Unexpected whitespace between function name and paren.' ,
105
- line : 4
115
+ line : 4 ,
116
+ ...( eslintStylisticVersion === undefined ||
117
+ semver . lt ( eslintStylisticVersion , '3.0.0' )
118
+ ? { column : 24 , endLine : undefined , endColumn : undefined }
119
+ : { column : 27 , endLine : 4 , endColumn : 28 } )
106
120
}
107
121
]
108
122
}
0 commit comments