/**
* @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,
url: "https://eslint.org/docs/rules/no-empty-pattern"
},
schema: []
},
create(context) {
return {
ObjectPattern(node) {
if (node.properties.length === 0) {
context.report({ node, message: "Unexpected empty object pattern." });
}
},
ArrayPattern(node) {
if (node.elements.length === 0) {
context.report({ node, message: "Unexpected empty array pattern." });
}
}
};
}
};
# |
Change |
User |
Description |
Committed |
|
#1
|
23539 |
jenbottom |
Adding the basic code for ember test appk, created with 'ember new' command |
|
|