Skip to content

Commit

Permalink
fix: detect methods
Browse files Browse the repository at this point in the history
  • Loading branch information
d0whc3r committed Oct 8, 2019
1 parent 02f3b82 commit 04a7106
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/own-methods-must-be-private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const rule: Rule.RuleModule = {
const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node);
const stencilDecorator = originalNode.decorators && originalNode.decorators.some(
(dec: any) => DECORATORS.includes(dec.expression.expression.escapedText));
const stencilCycle = LIFECYCLE_METHODS.includes(originalNode.name.escapedText);
const stencilCycle = LIFECYCLE_METHODS.includes(originalNode.name && originalNode.name.escapedText);
if (!stencilDecorator && !stencilCycle && !isPrivate(originalNode)) {
const text = String(originalNode.getFullText());
context.report({
Expand Down
4 changes: 4 additions & 0 deletions src/rules/required-prefix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const rule: Rule.RuleModule = {
return;
}
const [{ tag }] = parseDecorator(component);
if (!tag) {
console.warn('[required-prefix] No tag detected for component');
return;
}
const options = context.options[0];
const match = options.some((t: string) => tag.startsWith(t));

Expand Down

0 comments on commit 04a7106

Please sign in to comment.