diff --git a/lib/rules/jira-ticket-todo-comment.js b/lib/rules/jira-ticket-todo-comment.js index ede6602..357429d 100644 --- a/lib/rules/jira-ticket-todo-comment.js +++ b/lib/rules/jira-ticket-todo-comment.js @@ -1,7 +1,7 @@ module.exports = { create(context) { return { - "Program": function(node) { + Program(node) { const options = context.options[0]; const projectKey = options && options.projectKey; const regexOption = options && options.regex; @@ -16,8 +16,8 @@ module.exports = { if(regexOption) { regex = new RegExp(regexOption); } - for(const comment of context.getSourceCode().getAllComments()) { - const value = comment.value.trimStart(); + for(const node of context.getSourceCode().getAllComments()) { + const value = node.value.trimStart(); if(value.startsWith(`TODO`) && !regex.test(value)) { context.report({ message: `Add a JIRA ticket number to the TODO comment (e.g. ${projectKey ? projectKey : `MP`}-123)`, node }); }