How to use the @parcel/utils.prettyDiagnostic function in @parcel/utils

To help you get started, we’ve selected a few @parcel/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github parcel-bundler / parcel / packages / reporters / cli / src / Log.js View on Github external
{diagnostics.map((d, i) => {
        let {message, stack, hints, codeframe} = prettyDiagnostic(d);

        return (
          <div>
            {i &gt; 0 ? ' ' : '' /* spacer */}
            
              {`${emoji} `} {message}
            
            {!codeframe &amp;&amp; stack &amp;&amp; (
              <div>
                {stack}
              </div>
            )}
            {codeframe &amp;&amp; <div>{codeframe}</div>}
            {hints.length &gt; 0 &amp;&amp; }
          </div>
        );
github parcel-bundler / parcel / packages / core / parcel / src / cli.js View on Github external
function logUncaughtError(e: mixed) {
  if (e instanceof ThrowableDiagnostic) {
    for (let diagnostic of e.diagnostics) {
      let out = prettyDiagnostic(diagnostic);
      console.error(out.message);
      console.error(out.codeframe || out.stack);
      for (let h of out.hints) {
        console.error(h);
      }
    }
  } else {
    console.error(e);
  }
}
github parcel-bundler / parcel / packages / reporters / hmr-server / src / HMRServer.js View on Github external
    let renderedDiagnostics = diagnostics.map(d => prettyDiagnostic(d));