Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
erindepew committed Oct 17, 2017
1 parent a0b3fe8 commit 795b6d7
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/rules/camelcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = {
* @private
*/
function isUnderscored(name) {

// if there's an underscore, it might be A_CONSTANT, which is okay
return name.indexOf("_") > -1 && name !== name.toUpperCase();
}
Expand Down Expand Up @@ -109,19 +110,12 @@ module.exports = {
// AssignmentPattern nodes can be treated like Properties:
// e.g.: const { no_camelcased = false } = bar;
} else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") {

// if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) {
// report(node);
// }
if (node.parent.parent.type === "ObjectPattern") {
debugger;
node.parent.parent.properties.map((property) => {
debugger;
if(property.value.right && property.value.right.type === "Identifier" && isUnderscored(property.value.right.name) ) {
debugger;
node.parent.parent.properties.forEach(property => {
if (property.value.right && property.value.right.type === "Identifier" && isUnderscored(property.value.right.name)) {
report(node);
}
})
});
}

// "never" check properties
Expand Down

0 comments on commit 795b6d7

Please sign in to comment.