Skip to content

Commit bf911d3

Browse files
committed
(puppetlabsGH-643) Format all files using prettier
This commit formats all files using `prettier`, which was added and setup in the previous commit.
1 parent a5957b9 commit bf911d3

37 files changed

+648
-578
lines changed

.vscode/launch.json

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
15-
],
16-
"outFiles": [
17-
"${workspaceFolder}/out/**/*.js"
18-
],
13+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
14+
"outFiles": ["${workspaceFolder}/out/**/*.js"],
1915
"preLaunchTask": "npm: watch"
2016
},
2117
{
@@ -27,9 +23,7 @@
2723
"--extensionDevelopmentPath=${workspaceFolder}",
2824
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
2925
],
30-
"outFiles": [
31-
"${workspaceFolder}/out/test/**/*.js"
32-
],
26+
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
3327
"preLaunchTask": "npm: watch"
3428
},
3529
{
@@ -38,8 +32,8 @@
3832
"name": "DebugAdapter",
3933
"cwd": "${workspaceFolder}",
4034
"program": "${workspaceFolder}/src/debugAdapter.ts",
41-
"args": [ "--server=4711" ],
42-
"outFiles": [ "${workspaceFolder}/out/**/*.js" ]
35+
"args": ["--server=4711"],
36+
"outFiles": ["${workspaceFolder}/out/**/*.js"]
4337
},
4438
{
4539
"type": "node",
@@ -56,7 +50,7 @@
5650
"compounds": [
5751
{
5852
"name": "Extension + DebugAdapter",
59-
"configurations": [ "Extension", "DebugAdapter" ]
53+
"configurations": ["Extension", "DebugAdapter"]
6054
}
6155
]
6256
}

.vscode/settings.json

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"editor.insertSpaces": true,
4-
"editor.tabSize": 2,
5-
"editor.trimAutoWhitespace": true,
3+
"editor.insertSpaces": true,
4+
"editor.tabSize": 2,
5+
"editor.trimAutoWhitespace": true,
66

7-
"files.encoding": "utf8",
8-
// The default end of line character. Use \n for LF and \r\n for CRLF.
9-
"files.eol": "\n",
10-
"files.insertFinalNewline": true,
11-
"files.trimFinalNewlines": true,
12-
"files.trimTrailingWhitespace": false,
13-
"files.exclude": {
14-
"node_modules": true,
15-
"out": true, // set this to true to hide the "out" folder with the compiled JS files
16-
".vscode-test": true
17-
},
18-
"search.exclude": {
19-
"node_modules": true,
20-
"out": true // set this to false to include "out" folder in search results
21-
},
7+
"files.encoding": "utf8",
8+
// The default end of line character. Use \n for LF and \r\n for CRLF.
9+
"files.eol": "\n",
10+
"files.insertFinalNewline": true,
11+
"files.trimFinalNewlines": true,
12+
"files.trimTrailingWhitespace": false,
13+
"files.exclude": {
14+
"node_modules": true,
15+
"out": true, // set this to true to hide the "out" folder with the compiled JS files
16+
".vscode-test": true
17+
},
18+
"search.exclude": {
19+
"node_modules": true,
20+
"out": true // set this to false to include "out" folder in search results
21+
},
2222

23-
"prettier.printWidth": 120,
24-
"prettier.singleQuote": true,
25-
"prettier.tabWidth": 2,
26-
27-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
28-
"typescript.tsc.autoDetect": "off",
29-
"typescript.format.enable": false,
30-
"[typescript]": {
31-
"editor.formatOnSave": true,
32-
"editor.formatOnType": true,
33-
"editor.defaultFormatter": "esbenp.prettier-vscode"
34-
},
23+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
24+
"typescript.tsc.autoDetect": "off",
25+
"typescript.format.enable": false,
26+
"[typescript]": {
27+
"editor.formatOnSave": true,
28+
"editor.formatOnType": true,
29+
"editor.defaultFormatter": "esbenp.prettier-vscode"
30+
}
3531
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1010

1111
- ([GH-649](https://github.com/puppetlabs/puppet-vscode/issues/649)) Reduce activation events for extension
1212
- ([GH-639](https://github.com/puppetlabs/puppet-vscode/issues/639)) Deprecate Bolt Commands
13+
- ([GH-643](https://github.com/puppetlabs/puppet-vscode/issues/643)) Enable, configure and run prettier
1314

1415
## [0.26.1] - 2020-05-12
1516

assets/js/main.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ function generate_cy_stylesheet(cy) {
1010
{
1111
selector: 'node',
1212
style: {
13-
label: "data(id)",
14-
shape: "round-rectangle",
15-
"background-color": html_style.getPropertyValue('--vscode-button-background'),
16-
"background-width": "90%",
17-
"background-height": "90%",
18-
width: "228",
19-
height: "128",
20-
"border-width": "0",
21-
}
13+
label: 'data(id)',
14+
shape: 'round-rectangle',
15+
'background-color': html_style.getPropertyValue('--vscode-button-background'),
16+
'background-width': '90%',
17+
'background-height': '90%',
18+
width: '228',
19+
height: '128',
20+
'border-width': '0',
21+
},
2222
},
2323
{
2424
selector: 'label',
@@ -27,8 +27,8 @@ function generate_cy_stylesheet(cy) {
2727
'font-family': '"Segoe UI", Arial, Helvetica, sans-serif',
2828
'font-size': '28vh',
2929
'text-valign': 'center',
30-
'text-halign': 'center'
31-
}
30+
'text-halign': 'center',
31+
},
3232
},
3333
{
3434
selector: ':selected',
@@ -38,18 +38,18 @@ function generate_cy_stylesheet(cy) {
3838
'background-color': html_style.getPropertyValue('--vscode-button-hoverBackground'),
3939
'line-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight'),
4040
'target-arrow-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight'),
41-
'source-arrow-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight')
42-
}
41+
'source-arrow-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight'),
42+
},
4343
},
4444
{
4545
selector: 'edge',
4646
style: {
4747
'target-arrow-shape': 'triangle',
4848
'curve-style': 'bezier',
4949
'control-point-step-size': 40,
50-
width: 10
51-
}
52-
}
50+
width: 10,
51+
},
52+
},
5353
])
5454
.update(); // indicate the end of your new stylesheet so that it can be updated on elements
5555
}
@@ -62,42 +62,42 @@ function init() {
6262
wheelSensitivity: 0.15,
6363
maxZoom: 5,
6464
minZoom: 0.2,
65-
selectionType: 'single'
65+
selectionType: 'single',
6666
});
6767

6868
generate_cy_stylesheet(cy);
6969

7070
vscode.postMessage({ command: 'initialized' });
7171
}
7272

73-
window.addEventListener('message', event => {
73+
window.addEventListener('message', (event) => {
7474
const message = event.data;
75-
if(message.redraw == true){
75+
if (message.redraw == true) {
7676
cy.remove('*');
7777
}
7878

7979
nodeGraph = message.content;
8080

81-
try {
82-
nodeGraph.vertices.forEach(element => {
81+
try {
82+
nodeGraph.vertices.forEach((element) => {
8383
cy.add({
84-
data: { id: element.label }
84+
data: { id: element.label },
8585
});
8686
});
8787

88-
nodeGraph.edges.forEach(element => {
88+
nodeGraph.edges.forEach((element) => {
8989
cy.add({
9090
data: {
9191
id: element.source + element.target,
9292
source: element.source,
93-
target: element.target
94-
}
93+
target: element.target,
94+
},
9595
});
9696
});
9797
} catch (error) {
9898
vscode.postMessage({
9999
command: 'error',
100-
errorMsg: `Error building node graph from json graph data: ${error}`
100+
errorMsg: `Error building node graph from json graph data: ${error}`,
101101
});
102102
}
103103

@@ -107,6 +107,6 @@ window.addEventListener('message', event => {
107107
circle: false,
108108
nodeDimensionsIncludeLabels: true,
109109
spacingFactor: 1.5,
110-
animate: true
110+
animate: true,
111111
}).run();
112112
});

snippets/puppetfile.snippets.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"Forge_module1": {
33
"prefix": "Forge Module",
4-
"body": ["mod '${1:author}-${2:name}', '${3:version}'"],
4+
"body": [
5+
"mod '${1:author}-${2:name}', '${3:version}'"
6+
],
57
"description": "Install from the forge"
68
},
79
"Forge_module2": {
810
"prefix": "Latest Forge Module",
9-
"body": ["mod '${1:author}-${2:name}', :latest"],
11+
"body": [
12+
"mod '${1:author}-${2:name}', :latest"
13+
],
1014
"description": "Install the latest version from the forge"
1115
},
1216
"Git_module1": {
@@ -46,7 +50,9 @@
4650
},
4751
"Local_module1": {
4852
"prefix": "Local Module",
49-
"body": ["mod '${1:name}', :local => true"],
53+
"body": [
54+
"mod '${1:name}', :local => true"
55+
],
5056
"description": "Install from the local Puppetfile module path"
5157
}
5258
}

0 commit comments

Comments
 (0)