source-line-processor
v1.0.0-alpha.2
Published
`source-line-processor script.js --dir $PWD/test --dry-run --pattern "*.js"`
Downloads
4
Readme
source-line-processor script.js --dir $PWD/test --dry-run --pattern "*.js"
script.js
module.exports = ({ handlers }) => async (file) => {
await handlers.todos(file, async (todo) => {
if (!todo.issueId) {
const issueId = await createIssue(todo.content, todo.owner, todo.lineNumber, todo.path);
todo.issueId = issueId;
} else {
const issue = await getIssueState(todo.issueId);
if (issue.state === 'fixed') {
todo.remove();
} else if (issue.owner !== todo.owner) {
todo.owner = issue.owner;
}
}
}
});