JSLab adds Prettier formatting for JavaScript and TypeScript scratch code on macOS
JSLab, a JavaScript and TypeScript scratchpad for macOS, now uses Prettier to clean up messy code with a single shortcut, ⌥⇧F, which is also available in the Actions menu and command palette. Formatting is applied as one undo step with minimal edits, so folds, scroll position and cursor placement are preserved. Users can optionally format automatically before each run or on save, both disabled by default. A Formatting settings panel exposes Prettier options such as print width, tab width, semicolons and quote style, using Prettier's standard defaults. If code cannot be parsed, the status bar reports the error and the code is left unchanged, while formatting attempts that run too long are stopped to keep the editor responsive.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in