Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

source-line-processor

mortenolsen2MIT1.0.0-alpha.2

source-line-processor script.js --dir $PWD/test --dry-run --pattern "*.js"

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;
      }
    }
  }
});