<ul dir="auto">
<li>VSCode Version: Latest insiders</li>
<li>OS Version: Win10</li>
</ul>
<p dir="auto">see gif<br>
i have settings javascript.validation.enable set to false</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/5f16dda9afe5d3531ddaedde8d1c0f73a359627a655b1e048307e04644d27e59/687474703a2f2f672e7265636f726469742e636f2f75556c4552374e364a722e676966"><img src="https://camo.githubusercontent.com/5f16dda9afe5d3531ddaedde8d1c0f73a359627a655b1e048307e04644d27e59/687474703a2f2f672e7265636f726469742e636f2f75556c4552374e364a722e676966" alt="record" data-animated-image="" data-canonical-src="http://g.recordit.co/uUlER7N6Jr.gif" style="max-width: 100%;"></a></p>
<ul dir="auto">
<li>VSCode Version: 0.10.13 (insider)</li>
<li>OS Version: OS X 10.10.5</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<p dir="auto">1.create a new .js file and past the following example code in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export default function promiseMiddleware () {
    return next =&gt; action =&gt; {
        const {promise , type , ...rest} = action;
        if (!promise) return next(action);
        const SUCCESS = type;
        const REQUEST = type + '_REQUEST';
        const FAILURE = type + '_FAILURE';

        next({...rest,type: REQUEST});

        return promise
            .then(res =&gt; {
                next({res,type: SUCCESS});
                return true;
            })
            .catch(error =&gt; {
                next({...rest,error,type: FAILURE});
                return false;
            });
    };
}"><pre class="notranslate"><code class="notranslate">export default function promiseMiddleware () {
    return next =&gt; action =&gt; {
        const {promise , type , ...rest} = action;
        if (!promise) return next(action);
        const SUCCESS = type;
        const REQUEST = type + '_REQUEST';
        const FAILURE = type + '_FAILURE';

        next({...rest,type: REQUEST});

        return promise
            .then(res =&gt; {
                next({res,type: SUCCESS});
                return true;
            })
            .catch(error =&gt; {
                next({...rest,error,type: FAILURE});
                return false;
            });
    };
}
</code></pre></div>
<p dir="auto">2.<code class="notranslate">cmd-shift-p</code> then type <code class="notranslate">format code</code></p>
<p dir="auto">With the spread operator (<code class="notranslate">...rest</code>) this causes a weird formatting issue (indent level) resulting in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export default function promiseMiddleware() {
  return next =&gt; action =&gt; {
    const {promise, type, ...rest} = action;
    if (!promise) return next(action);
    const SUCCESS = type;
    const REQUEST = type + '_REQUEST';
    const FAILURE = type + '_FAILURE';

    next({...rest, type: REQUEST});

        return promise
    .then(res =&gt; {
      next({ res, type: SUCCESS });
      return true;
    })
    .catch(error =&gt; {
      next({...rest, error, type: FAILURE});
  return false; 
}); 
    };
}"><pre class="notranslate"><code class="notranslate">export default function promiseMiddleware() {
  return next =&gt; action =&gt; {
    const {promise, type, ...rest} = action;
    if (!promise) return next(action);
    const SUCCESS = type;
    const REQUEST = type + '_REQUEST';
    const FAILURE = type + '_FAILURE';

    next({...rest, type: REQUEST});

        return promise
    .then(res =&gt; {
      next({ res, type: SUCCESS });
      return true;
    })
    .catch(error =&gt; {
      next({...rest, error, type: FAILURE});
  return false; 
}); 
    };
}
</code></pre></div>
<p dir="auto">Removing all instances of the spread operator (<code class="notranslate">...rest</code>) and repeating step 2 formats the code properly</p>