Skip to content

Commit 63eabd8

Browse files
committed
use skipDynamicArguments
1 parent 7b291b8 commit 63eabd8

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

lib/rules/keyword-spacing.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55

66
const { wrapCoreRule } = require('../utils')
77

8-
// eslint-disable-next-line
9-
module.exports = wrapCoreRule(require('eslint/lib/rules/keyword-spacing'))
8+
// eslint-disable-next-line no-invalid-meta
9+
module.exports = wrapCoreRule(
10+
require('eslint/lib/rules/keyword-spacing'),
11+
{ skipDynamicArguments: true }
12+
)

tests/lib/rules/keyword-spacing.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ tester.run('keyword-spacing', rule, {
3838
" />
3939
</template>`,
4040
options: [{ before: false, after: false }]
41-
}
41+
},
42+
`<template>
43+
<div :[(function(){return(1)})()]="val" />
44+
</template>`
4245
],
4346
invalid: [
4447
{
@@ -137,6 +140,21 @@ tester.run('keyword-spacing', rule, {
137140
line: 7
138141
}
139142
]
143+
},
144+
{
145+
code:
146+
`<template>
147+
<div :[(function(){return(1)})()]="(function(){return(1)})()" />
148+
</template>`,
149+
output:
150+
`<template>
151+
<div :[(function(){return(1)})()]="(function(){return (1)})()" />
152+
</template>`,
153+
errors: [
154+
{
155+
message: 'Expected space(s) after "return".',
156+
line: 2
157+
}]
140158
}
141159
]
142160
})

0 commit comments

Comments
 (0)