sbdchd / neoformat

:sparkles: A (Neo)vim plugin for formatting code.
BSD 2-Clause "Simplified" License
1.98k stars 188 forks source link

formatting .tsx (typescriptreact filetype) with prettier does not work #410

Open alk-mandrianarijaona opened 2 years ago

alk-mandrianarijaona commented 2 years ago

When working on file with extension .tsx, user should be able to format the buffer. Currently, the formatting is not working for this file type Typescript react.

To reproduce, clone an example project https://github.com/bahmutov/prettier-config-example. Create a file with extension .tsx (in folder ProjectA on the sample project) and add some content that need formatting :

const o =      {
    name: "Gleb",
    age: 39,
    hacker: true,
    twitter: "@bahmutov",
    site: "https://gleb.dev"
};

Call :Neoformat prettier, a message is displayed: Neoformat: no change necessary. If neoformat verbose mode is enabled, and additional information is given Neoformat: executable: prettier is not an executable. On other files with extension js or ts, the formatter works just fine.