<p dir="auto">Is there any way to insert an optional transform as intentionally left blank? I want to set the <code class="notranslate">react.inlineElements</code> transform to only run in production but there doesn't seem to be a nice way to handle a ternary.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="query: { optional: ['optimisation.react.constantElements', PROD ? 'optimisation.react.inlineElements' : null] } },"><pre class="notranslate">query: <span class="pl-kos">{</span> optional: <span class="pl-kos">[</span><span class="pl-s">'optimisation.react.constantElements'</span><span class="pl-kos">,</span> <span class="pl-c1">PROD</span> ? <span class="pl-s">'optimisation.react.inlineElements'</span> : <span class="pl-c1">null</span><span class="pl-kos">]</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span></pre></div>
<p dir="auto">The logic for the pipeline appears to be <a href="https://github.com/babel/babel/blob/v5.6.20/src/babel/transformation/pipeline.js#L163-L181">here</a>, but it doesn't seem to handle any falsey values, instead falling through to the <code class="notranslate">Module build failed: ReferenceError: Unknown transformer null specified in optional</code> message.</p>
<p dir="auto">Could we use some sentinel value, either <code class="notranslate">''</code>, <code class="notranslate">false</code>, or <code class="notranslate">null</code> to signify "this space intentionally left blank?</p>
<p dir="auto">An idea that came after reading about <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="48937668" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/174" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/174/hovercard" href="https://github.com/babel/babel/issues/174">#174</a>. What about generating the JSDoc-style comments for classes and methods?</p>
<p dir="auto">This is very provocative, and for sure something hard to maintain. Yet an interesting idea IMHO.</p>
<p dir="auto">Please note I don’t personally use JSDoc, but I could start using it if it was somehow auto-generated.</p>
<p dir="auto">I still think that</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/**
 * A Klass
 * @class Klass
 * @extends Parent
 */
class Klass extends Parent {}"><pre class="notranslate"><span class="pl-c">/**</span>
<span class="pl-c"> * A Klass</span>
<span class="pl-c"> * <span class="pl-k">@class</span> Klass</span>
<span class="pl-c"> * <span class="pl-k">@extends</span> Parent</span>
<span class="pl-c"> */</span>
<span class="pl-k">class</span> <span class="pl-v">Klass</span> <span class="pl-k">extends</span> <span class="pl-v">Parent</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">is a little too verbose. But if <code class="notranslate">6to5</code> mangled the code that follows accordingly it could be interesting.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/** A Klass */ // no need to use @class and @extends here
class Klass extends Parent {}"><pre class="notranslate"><span class="pl-c">/** A Klass */</span> <span class="pl-c">// no need to use <span class="pl-k">@class</span> and @extends here</span>
<span class="pl-k">class</span> <span class="pl-v">Klass</span> <span class="pl-k">extends</span> <span class="pl-v">Parent</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>