<h3 dir="auto">Input Code</h3>
<p dir="auto"><a href="https://github.com/sotream/babylon_test">Demo repo</a></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Core
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { actions } from '../../actions/navigation';

const mapStateToProps = ({ navigation }) =&gt; ({ // eslint-disable-line arrow-body-style
	menuStatus: navigation.get('menuStatus')
});

const mapDispatchToProps = (dispatch) =&gt; ({ // eslint-disable-line arrow-body-style
	actions: bindActionCreators({ ...actions }, dispatch)
});

@connect(mapStateToProps, mapDispatchToProps)
export default class Home extends Component {
	render () {
		return (
			&lt;section&gt;
				&lt;h1&gt;Home container!&lt;/h1&gt;
			&lt;/section&gt;
		);
	}
}"><pre class="notranslate"><span class="pl-c">// Core</span>
<span class="pl-k">import</span> <span class="pl-v">React</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-v">Component</span><span class="pl-kos">,</span> <span class="pl-v">PropTypes</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">connect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react-redux'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">bindActionCreators</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'redux'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">actions</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'../../actions/navigation'</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-en">mapStateToProps</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> navigation <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">// eslint-disable-line arrow-body-style</span>
	<span class="pl-c1">menuStatus</span>: <span class="pl-s1">navigation</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'menuStatus'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-en">mapDispatchToProps</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">dispatch</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">// eslint-disable-line arrow-body-style</span>
	<span class="pl-c1">actions</span>: <span class="pl-en">bindActionCreators</span><span class="pl-kos">(</span><span class="pl-kos">{</span> ...<span class="pl-s1">actions</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">dispatch</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

@<span class="pl-en">connect</span><span class="pl-kos">(</span><span class="pl-en">mapStateToProps</span><span class="pl-kos">,</span> <span class="pl-en">mapDispatchToProps</span><span class="pl-kos">)</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">class</span> <span class="pl-v">Home</span> <span class="pl-k">extends</span> <span class="pl-v">Component</span> <span class="pl-kos">{</span>
	<span class="pl-en">render</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
		<span class="pl-k">return</span> <span class="pl-kos">(</span>
			<span class="pl-c1">&lt;</span><span class="pl-ent">section</span><span class="pl-c1">&gt;</span>
				<span class="pl-c1">&lt;</span><span class="pl-ent">h1</span><span class="pl-c1">&gt;</span>Home container!<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">h1</span><span class="pl-c1">&gt;</span>
			<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">section</span><span class="pl-c1">&gt;</span>
		<span class="pl-kos">)</span><span class="pl-kos">;</span>
	<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Babel Configuration (.babelrc, package.json, cli command)</h3>
<p dir="auto">All config files are in demo repository.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Decorator should be top of default export</p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">Decorator placed after after default export</p>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">?</p>
<h3 dir="auto">Context</h3>
<p dir="auto">I'm trying to parse js file with babylon. Make some modifications with babel-traverse (for example add a new import declaration) and generate js file back.</p>
<h3 dir="auto">Your Environment</h3>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>6.23.1</td>
</tr>
<tr>
<td>node</td>
<td>7.5.0</td>
</tr>
<tr>
<td>npm</td>
<td>4.1.2</td>
</tr>
<tr>
<td>Operating System</td>
<td>Ubuntu 16.04</td>
</tr>
</tbody>
</table>
<h3 dir="auto">Input Code</h3>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Decorator()
export class MyClass {}"><pre class="notranslate">@<span class="pl-v">Decorator</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">MyClass</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Babel Configuration (.bablerc, package.json, cli command)</h3>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;plugins&quot;: [
        &quot;syntax-decorators&quot;
    ]
}"><pre class="notranslate"><span class="pl-kos">{</span>
    <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
        <span class="pl-s">"syntax-decorators"</span>
    <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Expected Behavior</h3>


<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Decorator()
export class MyClass {}"><pre class="notranslate">@<span class="pl-v">Decorator</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">MyClass</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Current Behavior</h3>


<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export @Decorator()
class MyClass {}"><pre class="notranslate"><span class="pl-k">export</span> @<span class="pl-v">Decorator</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">class</span> <span class="pl-v">MyClass</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Possible Solution</h3>


<p dir="auto">What I'm currently doing to circumvent this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export let MyClass = @Decorator()
class MyClass {}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">let</span> <span class="pl-v">MyClass</span> <span class="pl-c1">=</span> @<span class="pl-v">Decorator</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">class</span> <span class="pl-v">MyClass</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">¯\_(ツ)_/¯</p>
<h3 dir="auto">Context</h3>


<p dir="auto">I've got a project where I'm trying to parse ES6 code with Flow types, and just take the types out. This minimal case reproduces the same issue, though.</p>
<h3 dir="auto">Your Environment</h3>

<table role="table">
<thead>
<tr>
<th>software</th>
<th>version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>babel-cli@6.14.0</td>
</tr>
<tr>
<td>node</td>
<td>6.5.0</td>
</tr>
<tr>
<td>npm</td>
<td>3.10.3</td>
</tr>
<tr>
<td>Operating System</td>
<td>Win 10 x64</td>
</tr>
</tbody>
</table>