code: function expectSpaceBefore(token, pattern) {
              const prevToken = sourceCode.getTokenBefore(token);
  
              if (prevToken &&
                  (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) &&
                  !isOpenParenOfTemplate(prevToken) &&
                  astUtils.isTokenOnSameLine(prevToken, token) &&
                  !sourceCode.isSpaceBetweenTokens(prevToken, token)
              ) {
                  context.report({
                      loc: token.loc.start,
                      messageId: "expectedBefore",
                      data: token,
                      fix(fixer) {
                          return fixer.insertTextBefore(token, " ");
                      }
                  });
              }
          }
docs: Reports a given token if there are not space(s) before the token.
  
  @param {Token} token - A token to report.
  @param {RegExp} pattern - A pattern of the previous token to check.
  @returns {void}