DEV Community

Cover image for Productivity Boost with Cmd+. / Ctrl+.
Daniel Bellmas
Daniel Bellmas

Posted on β€’ Edited on

3 1

Productivity Boost with Cmd+. / Ctrl+.

The light bulb icon πŸ’‘ means that VS Code found a possibility to refactor the code. It can be accessed by pressing ⌘ Cmd+. / βŒƒ Ctrl+.

There are many more little quick fixes, but here are some I frequently use:

Remove braces

Remove braces


Add braces

Add braces


Extract to a constant/function

Extract to a constant


Extract Type/Interface

Extract Type/Interface


Remove unused imports

There are many more little quick fixes options.


Add a missing import

Add a missing import


Add all missing imports

Add all missing imports


Convert then to async await

Convert then to async await


Bonus Productivity Tip ⚑️

By pressing F2, the variable's name will be changed everywhere it is referenced.

Renaming

Top comments (2)

Collapse
 
lgrammel profile image
Lars Grammel β€’

Great tips! I've written an extension that adds more quick fixes and keyboard shortcuts, maybe you find it useful too: JavaScript Refactoring Assistant

Collapse
 
danielbellmas profile image
Daniel Bellmas β€’

Niceee,Thank you πŸ™πŸΌ

11 Tips That Make You a Better Typescript Programmer

typescript

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay