Skip to content

Commit

Permalink
use skipDynamicArguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Feb 28, 2019
1 parent 7b291b8 commit 63eabd8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/rules/keyword-spacing.js
Expand Up @@ -5,5 +5,8 @@

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

// eslint-disable-next-line
module.exports = wrapCoreRule(require('eslint/lib/rules/keyword-spacing'))
// eslint-disable-next-line no-invalid-meta
module.exports = wrapCoreRule(
require('eslint/lib/rules/keyword-spacing'),
{ skipDynamicArguments: true }
)
20 changes: 19 additions & 1 deletion tests/lib/rules/keyword-spacing.js
Expand Up @@ -38,7 +38,10 @@ tester.run('keyword-spacing', rule, {
" />
</template>`,
options: [{ before: false, after: false }]
}
},
`<template>
<div :[(function(){return(1)})()]="val" />
</template>`
],
invalid: [
{
Expand Down Expand Up @@ -137,6 +140,21 @@ tester.run('keyword-spacing', rule, {
line: 7
}
]
},
{
code:
`<template>
<div :[(function(){return(1)})()]="(function(){return(1)})()" />
</template>`,
output:
`<template>
<div :[(function(){return(1)})()]="(function(){return (1)})()" />
</template>`,
errors: [
{
message: 'Expected space(s) after "return".',
line: 2
}]
}
]
})

0 comments on commit 63eabd8

Please sign in to comment.