mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-14 20:26:14 +09:00
remove timer and simon
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @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(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." });
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user