eslint-plugin-eslint-snake-case
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -1,21 +0,19 @@ | ||
module.exports = { | ||
rules: { | ||
snake_case: function(context) { | ||
return { | ||
Identifier: function(node) { | ||
var variableName = context.getSource(node, 0, 1); | ||
module.exports = { | ||
snake_case: function(context) { | ||
return { | ||
Identifier: function(node) { | ||
var variableName = context.getSource(node, 0, 1); | ||
if (/[A-Z]/.test(variableName) | ||
&& variableName.indexOf("_") > -1) { | ||
context.report(node, '`{{identifier}}` : Variable must be in snake case', { | ||
identifier: node.name, | ||
}); | ||
} else { | ||
return; | ||
} | ||
}, | ||
}; | ||
}, | ||
if (/[A-Z]/.test(variableName) | ||
&& variableName.indexOf("_") > -1) { | ||
context.report(node, '`{{identifier}}` : Variable must be in snake case', { | ||
identifier: node.name, | ||
}); | ||
} else { | ||
return; | ||
} | ||
}, | ||
}; | ||
}, | ||
}; |
{ | ||
"name": "eslint-plugin-eslint-snake-case", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "This plugin verifys variable names are in snake_case", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
2521
30