如何格式化原子中的原子代码

N S*_*rma 4 javascript atom-editor babeljs react-native

我正在开发react-native应用程序.我正在使用atom文本编辑器来开发react-native应用程序.

我没有找到任何react-native在atom中格式化代码的快捷方式.我试过美化包https://atom.io/packages/atom-beautify,但它无法正常工作.

import React, {
    Component
} from 'react';
import {
    AppRegistry,
    Image,
    View,
    Text,
    Button,
    StyleSheet
} from 'react-native';

class SplashScreen extends Component {
    render() {
        return ( <
            View style = {
                styles.container
            } >
            <
            Image source = {
                require('./img/talk_people.png')
            }
            style = {
                {
                    width: 300,
                    height: 300
                }
            }
            /> <
            Text style = {
                {
                    fontSize: 22,
                    textAlign: 'center',
                    marginTop: 30
                }
            } > Never forget to stay in touch with the people that matter to you. < /Text> <
            View style = {
                {
                    marginTop: 30
                }
            } > < Button title = "CONTINUE"
            color = "#FE434C" / > < /View> <
            /View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        backgroundColor: '#FFFFFF',
        margin: 50,
        alignItems: 'center',
        flex: 1,
        flexDirection: 'column'
    }
})

AppRegistry.registerComponent('Scheduled', () => SplashScreen);
Run Code Online (Sandbox Code Playgroud)

des*_*ant 13

我强烈推荐更漂亮的原子.

漂亮的人最近得到了很多关注,这是有充分理由的.

这是一个非常直接的,固执己见的JavaScript格式化程序,具有适合您风格的有限选项.如果您需要更多控制,它还带有可选的ESLint集成.