HookyQR / VSCodeBeautify

Enable js-beautify (https://github.com/beautify-web/js-beautify) in VS Code
MIT License
607 stars 178 forks source link

Beautify don't work in React Functional Component #405

Open mrhrifat opened 2 years ago

mrhrifat commented 2 years ago

NOTE: Please provide code snippets instead of screen shots. Your issue needs to be replicated, and we need the failing code (text) to do this.

Provide the settings you use: (VS Code workspace and user settings, .jsbeautifyrc, .editorconfig) VS Code:

{
    "editor.inlayHints.fontSize": 8,
    "workbench.colorCustomizations": {},
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 100,
    "liveServer.settings.donotShowInfoMsg": true,
    "explorer.confirmDelete": false,
    "workbench.colorTheme": "Andromeda Bordered",
    "explorer.confirmDragAndDrop": false,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "editor.quickSuggestions": true,
    "[javascriptreact]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "editor.formatOnSave": true,
    "[javascript]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "editor.inlineSuggest.enabled": true,
    "github.copilot.enable": {
        "*": false,
        "yaml": false,
        "plaintext": true,
        "markdown": true,
        "javascriptreact": true,
        "javascript": false
    },
    "[html]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "git.enableSmartCommit": true
}

Action performed

Format javascript file with HookyQR.beautifyFile command provide example code

const Home=props=> { return (

Hey

)

}

export default Home


## Expected results
Expected ... to ...
_provide example (expected) output_
```js
import React from 'react'

const Home=props=> {
    return (
        <div>
            <h4>Hey</h4>
        </div>
    )
}

export default Home

Actual results

Details of what happened ... provide example (actual) output

import React from 'react'

const Home = props => {
    return ( <
        div >
        <
        h4 > Hey < /h4> <
        /div>
    )
}

export default Home