Eslint: Expected { after 'while' condition

The reason for the eslint warning is that you need curly braces surrounding your return text;

That is, it should look like so:

  while (
    text !==
    (text = text.replace(/\[title\](.+?)\[\/title\]/gi, function (match, p) {
      return `<div class="job-title">${p}</div>`;
    }))
  ) {
    return text;
  }

Although JavaScript allows for the omission of the curly braces, ESLint enforces the consistent curly brace style.

More details on the curly rule here: