Skip to content

Commit f274a45

Browse files
committed
Fix vue/func-call-spacing tests with newer ESLint Stylistic versions
1 parent e8f6687 commit f274a45

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

tests/lib/rules/func-call-spacing.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
*/
44
'use strict'
55

6+
const semver = require('semver')
67
const { RuleTester } = require('../../eslint-compat')
78
const rule = require('../../../lib/rules/func-call-spacing')
9+
const { eslintStylisticVersion } = require('../../test-utils/eslint-stylistic')
810

911
const tester = new RuleTester({
1012
languageOptions: { parser: require('vue-eslint-parser'), ecmaVersion: 2020 }
@@ -61,7 +63,11 @@ tester.run('func-call-spacing', rule, {
6163
errors: [
6264
{
6365
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 })
6571
}
6672
]
6773
},
@@ -80,7 +86,11 @@ tester.run('func-call-spacing', rule, {
8086
errors: [
8187
{
8288
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 })
8494
}
8595
]
8696
},
@@ -102,7 +112,11 @@ tester.run('func-call-spacing', rule, {
102112
errors: [
103113
{
104114
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 })
106120
}
107121
]
108122
}

0 commit comments

Comments
 (0)