<p dir="auto">Is there a way to toggle babel via comments within code?</p>
<p dir="auto">E.g:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// code for babel to transpile...

/*babel: disable */
   // &quot;MASSIVE&quot; inlined 3rd party library here...
/*babel: enable */

// code for babel to transpile..."><pre class="notranslate"><code class="notranslate">// code for babel to transpile...

/*babel: disable */
   // "MASSIVE" inlined 3rd party library here...
/*babel: enable */

// code for babel to transpile...
</code></pre></div>
<p dir="auto">I'd like to be able to specify compile options in comments, similar to JSHint, JSCS and the Traceur REPL. For example:</p>
<p dir="auto">JSHint comments are in the format:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/* exported Harmonic */
/* global __HARMONIC */
/* jshint mocha: true */"><pre class="notranslate"><span class="pl-c">/* exported Harmonic */</span>
<span class="pl-c">/* global __HARMONIC */</span>
<span class="pl-c">/* jshint mocha: true */</span></pre></div>
<p dir="auto">JSCS comment directive example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// jscs: disable disallowSpacesInFunctionExpression, disallowSpacesInAnonymousFunctionExpression"><pre class="notranslate"><span class="pl-c">// jscs: disable disallowSpacesInFunctionExpression, disallowSpacesInAnonymousFunctionExpression</span></pre></div>
<p dir="auto"><a href="http://google.github.io/traceur-compiler/demo/repl.html#%2F%2F%20Options%3A%20--async-functions%20%0A" rel="nofollow">Traceur REPL example</a>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Options: --async-functions"><pre class="notranslate"><span class="pl-c">// Options: --async-functions</span></pre></div>
<p dir="auto">Could 6to5 support a similar comment syntax to specify file-specific configs? For instance, it could be a comment that begins with <code class="notranslate">6to5:</code> followed by a JSON/JS object literal containing options that get merged into the current configs. Whitespace before/after the "6to5:" prefix could be disregarded for readability/user-friendliness. Example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// 6to5: { optional: null, experimental: true }"><pre class="notranslate"><span class="pl-c">// 6to5: { optional: null, experimental: true }</span></pre></div>
<p dir="auto">To avoid unnecessary complexity, those options could only be valid at the top of the file before any source code (other than comments and whitespace) are processed.</p>
<p dir="auto">And if this sounds like a reasonable request, have no rush, this can be implemented and documented after the rebranding if you prefer. <g-emoji class="g-emoji" alias="stuck_out_tongue" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f61b.png">😛</g-emoji></p>