-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
Relates to issue #176 (prettier enhancements)
Currently our prettier functionality only handles JS files as it always uses babylon (which should now be babel, I believe). Formatting for json, typescript and more just fails silently. I'm working on prettier enhancements which will address this issue. See below for an outline of how I'm tackling the issue. Open for discussion now and/or when my PR comes in.
Current plan:
- Check current file extension and use that to set a valid non-custom parser option by updating the parser name and loading the necessary script on click (loaded from this list of prettier parsers)
- Less sure of this one: Keep prettier and the babel/babylon parser loaded (but via 'async') in the head of
index.htmlas they'll be used a lot. - Hide the prettier button if we're in a file with an extension that we cannot prettify
- In addition to
formattinganddonestate, add aformatting failedstate to the prettier button (current state changes in a local branch on my machine. Relates to discussion in Prettier enhancements: feedback/state & options #176 )