Skip to content

Commit

Permalink
Update lib/rules/v-bind-style.js
Browse files Browse the repository at this point in the history
Co-authored-by: Flo Edelmann <[email protected]>
  • Loading branch information
waynzh and FloEdelmann authored Jan 29, 2024
1 parent 155c09e commit 1b93262
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions lib/rules/v-bind-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,12 @@ const casing = require('../utils/casing')
* @returns {boolean}
*/
function isSameName(node) {
/** @returns {string | null} */
function getAttributeName() {
// not support VExpressionContainer e.g. :[attribute]
if (node.key.argument.type === 'VIdentifier') {
return node.key.argument.rawName
}

return null
}

/** @returns {string | null} */
function getValueName() {
if (node.value?.expression?.type === 'Identifier') {
return node.value.expression.name
}

return null
}

const attrName = getAttributeName()
const valueName = getValueName()
const attrName = node.key.argument.type === 'VIdentifier'

Check failure on line 21 in lib/rules/v-bind-style.js

View workflow job for this annotation

GitHub Actions / Lint

Replace `·node.key.argument.type·===·'VIdentifier'⏎····?·node.key.argument.rawName⏎···` with `⏎····node.key.argument.type·===·'VIdentifier'·?·node.key.argument.rawName`
? node.key.argument.rawName
: null
const valueName = node.value?.expression?.type === 'Identifier'

Check failure on line 24 in lib/rules/v-bind-style.js

View workflow job for this annotation

GitHub Actions / Lint

Insert `⏎···`
? node.value.expression.name

Check failure on line 25 in lib/rules/v-bind-style.js

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
: null

Check failure on line 26 in lib/rules/v-bind-style.js

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
return Boolean(
attrName &&
valueName &&
Expand Down

0 comments on commit 1b93262

Please sign in to comment.