Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Autoformat breaks compilation

$
0
0

Take the following element as an example.

 <img
    src="https://i.ibb.co/6WW5vVC/shiptest.jpg"
    alt={"alt"}
    draggable=false
    style={ReactDOM.Style.make(~width="100%", ~height="100%", ())}
    loading=#"lazy"
/>

I saved a file with an element like this in it. The autoformatter has removed the quotes around it and then I get the following compilation error:

lazy is a reserved keyword. Keywords need to be escaped: "lazy"

file after autosave messes with it:

 <img
    loading=#lazy
    // etc etc...
/>

Is there a way to disable this autosave behavior on a per line basis or otherwise work around this? I generally want to keep autoformatting on. For now I’m going to edit this file outside of VSCode to keep the changes in it.

… package.json

        "rescript": "^11.1.4",
        "rescript-relay": "^3.0.1",
        "@rescript/core": "^1.6.1",
        "@rescript/react": "^0.13.0",


Viewing all articles
Browse latest Browse all 2592

Trending Articles