royriojas / esformatter-jsx

esformatter plugin: format jsx files (or js files with Facebook React JSX Syntax)
MIT License
142 stars 25 forks source link

Trailing space on nested JSX expressions #71

Open ckknight opened 8 years ago

ckknight commented 8 years ago

Input:

import React, { Component } from 'react';
import { FormattedMessage } from 'react-intl';
import IconButton from './IconButton';

export default class NewSceneButton extends Component {
    render() {
        return (
            <IconButton
                href="/new-scene"
                icon="camera"
                caption={<FormattedMessage
                    id="home.create"
                    description="Link to the create section from the home screen"
                    defaultMessage="Create"
                />}
            />
        );
    }
}

Output:

import React, { Component } from 'react';
import { FormattedMessage } from 'react-intl';
import IconButton from './IconButton';

export default class NewSceneButton extends Component {
    render() {
        return (
            <IconButton
              href="/new-scene"
              icon="camera"
              caption={<FormattedMessage 
                         id="home.create" 
                         description="Link to the create section from the home screen" 
                         defaultMessage="Create" />} />
            );
    }
}

The internal FormattedMessage has a space at the end of the line before each newline.