Skip to content

Commit

Permalink
chore: Fix lint issues for real
Browse files Browse the repository at this point in the history
  • Loading branch information
Alon Bukai committed Aug 6, 2019
1 parent cb654c8 commit 8e47714
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
13 changes: 6 additions & 7 deletions lib/ast-input-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class AngleBracketInputPolyfill {
tag === 'Textarea'
? textareaAttributes
: isCheckbox
? checkboxAttributes
: inputAttributes;
? checkboxAttributes
: inputAttributes;

checkAttributes(node, supportedAttributes, moduleName);

Expand All @@ -121,11 +121,10 @@ class AngleBracketInputPolyfill {
.map(attribute => Object.assign({}, attribute, { name: attribute.name.slice(1) }));
let attrs = attributes
.filter(({ name }) => supportsAttribute(name, supportedAttributes))
.map(
attribute =>
attributeToPropertyMap[attribute.name]
? Object.assign({}, attribute, { name: attributeToPropertyMap[attribute.name] })
: attribute
.map(attribute =>
attributeToPropertyMap[attribute.name]
? Object.assign({}, attribute, { name: attributeToPropertyMap[attribute.name] })
: attribute
);

let hash = b.hash(
Expand Down
9 changes: 4 additions & 5 deletions lib/ast-link-to-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,10 @@ class AngleBracketLinkToPolyfill {
.map(attribute => Object.assign({}, attribute, { name: attribute.name.slice(1) }));
let attrs = attributes
.filter(({ name }) => supportsAttribute(name, supportedHTMLAttributes))
.map(
attribute =>
attributeToPropertyMap[attribute.name]
? Object.assign({}, attribute, { name: attributeToPropertyMap[attribute.name] })
: attribute
.map(attribute =>
attributeToPropertyMap[attribute.name]
? Object.assign({}, attribute, { name: attributeToPropertyMap[attribute.name] })
: attribute
);

let hash = b.hash(
Expand Down
4 changes: 1 addition & 3 deletions lib/helpers/check-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ module.exports = function checkAttributes(node, supported, moduleName) {

if (node.modifiers.length > 0) {
throw new SilentError(
`Passing element modifiers to the <${
node.tag
}> component ${sourceReference} is not supported by ember-angle-bracket-invocation-polyfill.`
`Passing element modifiers to the <${node.tag}> component ${sourceReference} is not supported by ember-angle-bracket-invocation-polyfill.`
);
}

Expand Down
5 changes: 2 additions & 3 deletions lib/helpers/supports-attribute.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict';

module.exports = function supportsAttribute(name, supported) {
return !!supported.find(
supportedName =>
supportedName instanceof RegExp ? supportedName.exec(name) : name === supportedName
return !!supported.find(supportedName =>
supportedName instanceof RegExp ? supportedName.exec(name) : name === supportedName
);
};

0 comments on commit 8e47714

Please sign in to comment.