Want to Make Your Code Look Pretty and Well-Organized?
Try the ๐ฃ๐ฟ๐ฒ๐๐๐ถ๐ฒ๐ฟ extension in VS Code!๐ก
๐ช๐ต๐ฎ๐ ๐ถ๐ ๐ฃ๐ฟ๐ฒ๐๐๐ถ๐ฒ๐ฟ?
โณ Prettier is a tool that makes your code look neat and consistent.
โณ It works by checking your code and fixing its style according to set rules.
โณ Prettier supports many programming languages and works with most code editors, including Visual Studio Code (VS Code).
โณ By using Prettier, your code will always be clean, easy to read, and free of style issues.
๐๐ผ๐ ๐๐ผ ๐๐ป๐๐๐ฎ๐น๐น ๐ฃ๐ฟ๐ฒ๐๐๐ถ๐ฒ๐ฟ ๐ถ๐ป ๐ฉ๐ฆ ๐๐ผ๐ฑ๐ฒ:
1๏ธโฃ Open ๐ฉ๐ฆ ๐๐ผ๐ฑ๐ฒ.
2๏ธโฃ Go to the ๐๐ ๐๐ฒ๐ป๐๐ถ๐ผ๐ป๐ ๐๐ถ๐ฒ๐ by clicking on the Extensions icon in the Activity Bar on the side of the window or by pressing ๐๐๐ฟ๐น+๐ฆ๐ต๐ถ๐ณ๐+๐ซ.
3๏ธโฃ Search for "๐ฃ๐ฟ๐ฒ๐๐๐ถ๐ฒ๐ฟ - ๐๐ผ๐ฑ๐ฒ ๐ณ๐ผ๐ฟ๐บ๐ฎ๐๐๐ฒ๐ฟ" in the search bar.
4๏ธโฃ Select the first one which appears in the search results, Click on the ๐ถ๐ป๐๐๐ฎ๐น๐น ๐ฏ๐๐๐๐ผ๐ป.
5๏ธโฃ Once installed, you can ๐ฐ๐น๐ผ๐๐ฒ ๐๐ต๐ฒ ๐๐ ๐๐ฒ๐ป๐๐ถ๐ผ๐ป๐ ๐๐ถ๐ฒ๐.
๐๐ผ๐ ๐๐ผ ๐๐ป๐ฎ๐ฏ๐น๐ฒ ๐๐๐๐ผ ๐ฆ๐ฎ๐๐ฒ ๐ฎ๐ป๐ฑ ๐๐๐๐ผ ๐๐ผ๐ฟ๐บ๐ฎ๐ ๐๐ถ๐๐ต ๐ฃ๐ฟ๐ฒ๐๐๐ถ๐ฒ๐ฟ:
1๏ธโฃ Open the Command Palette by pressing ๐๐๐ฟ๐น+๐ฆ๐ต๐ถ๐ณ๐+๐ฃ.
2๏ธโฃ Type and select Preferences: ๐ข๐ฝ๐ฒ๐ป ๐ฆ๐ฒ๐๐๐ถ๐ป๐ด๐ (๐๐ฆ๐ข๐ก).
3๏ธโฃ Add the following settings to your ๐๐ฒ๐๐๐ถ๐ป๐ด๐.๐ท๐๐ผ๐ป file:
{
"editor.formatOnSave": true,
"editor.defaultFormatter":
"esbenp.prettier-vscode"
}
4๏ธโฃ Save the ๐๐ฒ๐๐๐ถ๐ป๐ด๐.๐ท๐๐ผ๐ป file.
Now, every time you save your any file in VS Code, Prettier will automatically format your code according to its rules.โจ
Top comments (0)