This repository was archived by the owner on Jan 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +41
-0
lines changed Expand file tree Collapse file tree 5 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -16,5 +16,6 @@ Prettier is an opinionated code formatter.
1616| Options Id | Description | Type | Default Value |
1717| -----| -----| -----| -----|
1818| version | Select the version to install. | string | latest |
19+ | plugins | Comma-separated list of prettier plugins to install. | string | |
1920
2021
Original file line number Diff line number Diff line change 1212 " latest"
1313 ],
1414 "type" : " string"
15+ },
16+ "plugins" : {
17+ "default" : " " ,
18+ "description" : " Comma-separated list of prettier plugins to install." ,
19+ "type" : " string"
1520 }
1621 },
1722 "installsAfter" : [
Original file line number Diff line number Diff line change @@ -19,6 +19,24 @@ $nanolayer_location \
1919 --option package=' prettier' --option version=" $VERSION "
2020
2121
22+ PRETTIER_PLUGINS=${PLUGINS:- " " }
23+
24+ # Prettier plugins are expected to be installed locally, not globally
25+ # In particular, VSCode + extensions tend to have issues with this
26+ if [ -n " ${PRETTIER_PLUGINS} " ]; then
27+ OIFS=$IFS
28+ IFS=' ,'
29+
30+ for plugin in $PRETTIER_PLUGINS ; do
31+ if ! npm list ${plugin} > /dev/null; then
32+ npm install --save-dev prettier ${plugin}
33+ fi
34+ done
35+
36+ IFS=$OIFS
37+ fi
38+
39+
2240
2341echo ' Done!'
2442
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ source dev-container-features-test-lib
6+
7+ check " npm list --parseable --depth 0 | grep prettier-plugin-ini" npm list --parseable --depth 0 | grep " prettier-plugin-ini"
8+
9+ reportResults
Original file line number Diff line number Diff line change 44 "features" : {
55 "prettier" : {}
66 }
7+ },
8+ "plugin" : {
9+ "image" : " mcr.microsoft.com/devcontainers/base:debian" ,
10+ "features" : {
11+ "prettier" : {
12+ "plugins" : " prettier-plugin-ini"
13+ }
14+ }
715 }
816}
You can’t perform that action at this time.
0 commit comments