Is there a VS Code built-in shortcut or extension that will insert and correctly format starred-block comments, as described in ESLint's rule "multiline-comment-style"?
I am using TypeScript, but this should apply to vanilla JavaScript and other languages as well.
Example
I should be able to highlight multiple uncommented lines as below:
interface CatInfo {
age: number;
breed: string;
}
type CatName = "miffy" | "boris" | "mordred";
~~~~START HIGHLIGHT~~~~
const cats: Record<CatName, CatInfo> = {
miffy: { age: 10, breed: "Persian" },
boris: { age: 5, breed: "Maine Coon" },
mordred: { age: 16, breed: "British Shorthair" },
};
cats.boris;
~~~~END HIGHLIGHT~~~~
And use a shortcut to comment all highlighted lines, so they look like this:
/*
* const cats: Record<CatName, CatInfo> = {
* miffy: { age: 10, breed: "Persian" },
* boris: { age: 5, breed: "Maine Coon" },
* mordred: { age: 16, breed: "British Shorthair" },
* };
*
* cats.boris;
*/
Anti-examples
I am not looking for Ctrl+/
aka ⌘+/
, which would yield:
// const cats: Record<CatName, CatInfo> = {
// miffy: { age: 10, breed: "Persian" },
// boris: { age: 5, breed: "Maine Coon" },
// mordred: { age: 16, breed: "British Shorthair" },
// };
// cats.boris;
I am not looking for Shift+Alt+A
aka Shift+⌥+A
, which would yield:
/*
const cats: Record<CatName, CatInfo> = {
miffy: { age: 10, breed: "Persian" },
boris: { age: 5, breed: "Maine Coon" },
mordred: { age: 16, breed: "British Shorthair" },
};
cats.boris;
*/