royriojas/esformatter-jsx

Trailing space on nested JSX expressions

ckknight opened this issue · 0 comments

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.