diff options
Diffstat (limited to 'tools/eslint/lib/rules/no-comma-dangle.js')
-rw-r--r-- | tools/eslint/lib/rules/no-comma-dangle.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/tools/eslint/lib/rules/no-comma-dangle.js b/tools/eslint/lib/rules/no-comma-dangle.js deleted file mode 100644 index 899529efe8..0000000000 --- a/tools/eslint/lib/rules/no-comma-dangle.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Rule to flag trailing commas in object literals. - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //------------------------------------------------------------------------- - // Helpers - //------------------------------------------------------------------------- - - function checkForTrailingComma(node) { - var items = node.properties || node.elements, - length = items.length, - lastItem, penultimateToken; - - if (length) { - lastItem = items[length - 1]; - if (lastItem) { - penultimateToken = context.getLastToken(node, 1); - if (penultimateToken.value === ",") { - context.report(lastItem, penultimateToken.loc.start, "Trailing comma."); - } - } - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "ObjectExpression": checkForTrailingComma, - "ArrayExpression": checkForTrailingComma - }; - -}; - -module.exports.schema = []; |