Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Prettier Dev Container Feature

Image

What is Prettier?

  • An opinionated code formatter
  • Supports many languages
  • Integrates with most editors
  • Has few options

Why?

  • Your code is formatted on save
  • No need to discuss style in code review
  • Saves you time and energy
  • And more

Prettier

This Dev Container Feature installs Prettier and plugins globally using Node.js and npm to run npm install -g prettier. You can also add plugins by specifying a plugins option. This will install all the plugins at once using npm install -g $PLUGINS. You can use prettier-plugin-octocat@1.2.3 full npm specifiers! Just make sure each plugin is separated by a space character, not a comma.

Usage

Codespaces Devcontainers

// devcontainer.json
"features": {
  "ghcr.io/devcontainers-community/features/prettier": {}
}

Options

You can specify a specific Prettier version like this:

// devcontainer.json
"features": {
  "ghcr.io/devcontainers-community/features/prettier": {
    "version": "3.0.0"
  }
}

You can specify plugins like this:

// devcontainer.json
"features": {
  "ghcr.io/devcontainers-community/features/prettier": {
    "plugins": "prettier-plugin-jsdoc @prettier/plugin-php@0.20.1"
  }
}