eslint-plugin-destructuring
Version:
destructuring specific linting rules for ESLint
17 lines (15 loc) • 535 B
JavaScript
;
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
create: function inMethodsParams(context) {
return {
ObjectPattern: function ObjectPattern(node) {
if (node.parent && node.parent.parent && node.parent.parent.type === 'MethodDefinition') {
context.report(node, 'Do not use destructuring in method params.');
}
}
};
}
};