Sha256: 063376f498d2be83d772214db4b09cfe43a7f00d79233920dc82783f41bb6272
Contents?: true
Size: 986 Bytes
Versions: 45
Compression:
Stored size: 986 Bytes
Contents
/** * @fileoverview Rule to disallow an empty pattern * @author Alberto RodrÃguez */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { docs: { description: "disallow empty destructuring patterns", category: "Best Practices", recommended: true }, schema: [] }, create: function(context) { return { ObjectPattern: function(node) { if (node.properties.length === 0) { context.report(node, "Unexpected empty object pattern."); } }, ArrayPattern: function(node) { if (node.elements.length === 0) { context.report(node, "Unexpected empty array pattern."); } } }; } };
Version data entries
45 entries across 45 versions & 2 rubygems