src/language-js/parse/postprocess/typescript.js/throwErrorForInvalidDecorator
function throwErrorForInvalidDecorator(
  tsNode,
  esTreeNode,
  tsNodeToESTreeNodeMap
) {
  const tsDecorators = tsNode.decorators;
  if (!Array.isArray(tsDecorators)) {
    return;
  }
  const esTreeDecorators = esTreeNode.decorators;
  if (
    !Array.isArray(esTreeDecorators) ||
    esTreeDecorators.length !== tsDecorators.length ||
    tsDecorators.some((tsDecorator) => {
      const esTreeDecorator = tsNodeToESTreeNodeMap.get(tsDecorator);
      return !esTreeDecorator || !esTreeDecorators.includes(esTreeDecorator);
    })
  ) {
    throwSyntaxError(
      esTreeNode,
      "Leading decorators must be attached to a class declaration"
    );
  }
}