Skip to content

Commit 056c1a1

Browse files
authored
tools(docs): Run prettier in docs dir lint script and fix issues (#19069)
Also updated root `.prettierignore` to skip file generated in docs build.
1 parent 57b4798 commit 056c1a1

30 files changed

+59
-48
lines changed

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ docs/themes/thxvscode/assets/js/bundle.js
9595
# Ignore these scss files
9696
docs/themes/thxvscode/assets/scss/*
9797

98+
# Generated
99+
docs/data/v*
100+
docs/public
101+
docs/resources
102+
docs/static/staticwebapp.config.json
103+
98104
# This is a test file
99105
tools/markdown-magic/test/include.md
100106

docs/.vscode/extensions.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"recommendations": [
66
// "docsmsft.docs-authoring-pack",
77
"davidanson.vscode-markdownlint",
8-
"stkb.rewrap"
8+
"stkb.rewrap",
99
],
1010
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
11-
"unwantedRecommendations": []
11+
"unwantedRecommendations": [],
1212
}

docs/.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"editor.rulers": [120],
3-
"git.ignoreLimitWarning": true
3+
"git.ignoreLimitWarning": true,
44
}

docs/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,10 @@ The following npm scripts are supported in this directory:
357357
| `linkcheck` | Starts a local webserver and runs `linkcheck:full` against it. |
358358
| `linkcheck:fast` | Checks all internal site links and reports the results to the terminal. |
359359
| `linkcheck:full` | Checks all internal _and external_ site links and reports the results to the terminal. |
360-
| `lint` | `markdownlint-cli2` |
361-
| `lint:fix` | `markdownlint-cli2-fix` |
360+
| `lint` | `npm run markdownlint && npm run prettier` |
361+
| `lint:fix` | `npm run markdownlint:fix && npm run prettier:fix` |
362+
| `markdownlint` | `markdownlint-cli2` |
363+
| `markdownlint:fix` | `markdownlint-cli2-fix` |
362364
| `prettier` | `prettier --check . --ignore-path ../.prettierignore` |
363365
| `prettier:fix` | `prettier --write . --ignore-path ../.prettierignore` |
364366
| `start` | Start a local webserver to preview the built site on <http://localhost:1313> |

docs/_includes/browsers.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ There is a lot of nuance in browser support, but in general, the Fluid Framework
22
that you use the most up-to-date browser that's compatible with your operating system. The following browsers are
33
supported.
44

5-
* The new [Microsoft Edge](https://www.microsoft.com/edge)
6-
* [Safari](https://www.apple.com/safari) (latest version)
7-
* [Mozilla Firefox](https://www.mozilla.org/firefox) (latest version)
8-
* [Google Chrome](https://www.google.com/chrome/browser/index.html) (latest version)
5+
- The new [Microsoft Edge](https://www.microsoft.com/edge)
6+
- [Safari](https://www.apple.com/safari) (latest version)
7+
- [Mozilla Firefox](https://www.mozilla.org/firefox) (latest version)
8+
- [Google Chrome](https://www.google.com/chrome/browser/index.html) (latest version)
99

1010
However, using transpilers and other tools in the JavaScript ecosystem, it is possible to create Fluid Framework-based
1111
apps that support additional browsers.

docs/_includes/links.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
1111
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
1212
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
13-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
13+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
1414

1515
<!-- API links -->
1616

docs/api-markdown-documenter/front-matter.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,31 @@ function createHugoFrontMatter(apiItem, config, customRenderers, version) {
3636
kind: apiItem.kind,
3737
members: new Map(),
3838
package: associatedPackage?.name.replace(/"/g, "").replace(/!/g, ""),
39-
unscopedPackageName: associatedPackage ?
40-
ApiItemUtilities.getUnscopedPackageName(associatedPackage) :
41-
undefined,
39+
unscopedPackageName: associatedPackage
40+
? ApiItemUtilities.getUnscopedPackageName(associatedPackage)
41+
: undefined,
4242
};
4343

4444
if (apiItem.tsdocComment) {
4545
frontMatter.summary = extractSummary(apiItem, config, customRenderers);
4646
}
4747

48-
const apiMembers = apiItem.kind === ApiItemKind.Package ?
49-
apiItem.entryPoints[0].members :
50-
apiItem.members;
48+
const apiMembers =
49+
apiItem.kind === ApiItemKind.Package ? apiItem.entryPoints[0].members : apiItem.members;
5150

52-
apiMembers.filter(({ displayName }) => displayName !== "")
53-
.forEach(api => {
51+
apiMembers
52+
.filter(({ displayName }) => displayName !== "")
53+
.forEach((api) => {
5454
frontMatter.members[api.kind] = frontMatter.members[api.kind] ?? {};
55-
frontMatter.members[api.kind][api.displayName] = ApiItemUtilities.getLinkForApiItem(api, config).target;
55+
frontMatter.members[api.kind][api.displayName] = ApiItemUtilities.getLinkForApiItem(
56+
api,
57+
config,
58+
).target;
5659
});
5760

58-
5961
const hugoFrontMatter = JSON.stringify(frontMatter, undefined, 2).trim();
6062
return [hugoFrontMatter, generatedContentNotice].join(`${EOL}${EOL}`).trim();
61-
};
63+
}
6264

6365
const extractSummary = (apiItem, config, customRenderers) => {
6466
const summaryParagraph = transformTsdocNode(

docs/archetypes/default.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ title: "{{ replace .Name "-" " " | title }}"
33
date: {{ .Date }}
44
draft: true
55
---
6-

docs/content/docs/build/audience.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ In some cases, the user data could be generated locally or fetched from an exter
127127
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
128128
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
129129
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
130-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
130+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
131131

132132
<!-- API links -->
133133

docs/content/docs/build/containers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ An example of a container service is the [Audience]({{< relref "audience.md" >}}
211211
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
212212
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
213213
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
214-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
214+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
215215

216216
<!-- API links -->
217217

docs/content/docs/build/data-modeling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ An example where this is useful is building a collaborative storyboarding applic
161161
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
162162
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
163163
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
164-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
164+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
165165
166166
<!-- API links -->
167167

docs/content/docs/build/dds.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ These DDSes are used for storing key-value data. They are all optimistic and use
214214
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
215215
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
216216
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
217-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
217+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
218218

219219
<!-- API links -->
220220

docs/content/docs/build/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ For more information see [Packages]({{< relref "packages.md" >}}).
8585
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
8686
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
8787
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
88-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
88+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
8989

9090
<!-- API links -->
9191

docs/content/docs/build/packages.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You can [read more about the scopes and their intent][scopes] in the Fluid Frame
6262
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
6363
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
6464
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
65-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
65+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
6666

6767
<!-- API links -->
6868

docs/content/docs/concepts/handles.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ console.log(text === text2) // true
9191
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
9292
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
9393
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
94-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
94+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
9595

9696
<!-- API links -->
9797

docs/content/docs/concepts/signals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The payload sent back in response to the `connectRequest` should include all the
143143
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
144144
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
145145
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
146-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
146+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
147147

148148
<!-- API links -->
149149

docs/content/docs/concepts/tob.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Data Objects' data structures will be summarized.
9292
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
9393
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
9494
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
95-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
95+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
9696

9797
<!-- API links -->
9898

docs/content/docs/data-structures/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Typical scenarios require the connected clients to "agree" on some course of act
128128
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
129129
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
130130
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
131-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
131+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
132132

133133
<!-- API links -->
134134

docs/content/docs/data-structures/string.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ efficient spatial querying of the nearest Marker to a given position. -->
103103
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
104104
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
105105
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
106-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
106+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
107107

108108
<!-- API links -->
109109

docs/content/docs/deep/dataobject-aqueduct.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ makes a request to the Container for `{url:"color"}` will intercept and return a
235235
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
236236
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
237237
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
238-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
238+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
239239

240240
<!-- API links -->
241241

docs/content/docs/deep/feature-detection-iprovide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ object of the correct type or `undefined`.
108108
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
109109
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
110110
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
111-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
111+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
112112
113113
<!-- API links -->
114114

docs/content/docs/deep/hosts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ As the Fluid Framework expands, we intend to make further use of these responses
134134
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
135135
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
136136
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
137-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
137+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
138138

139139
<!-- API links -->
140140

docs/content/docs/recipes/angular.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ When you make changes to the code the project will automatically rebuild and the
269269
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
270270
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
271271
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
272-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
272+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
273273

274274
<!-- API links -->
275275

docs/content/docs/recipes/audience-react.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ When you make changes to the code the project will automatically rebuild and the
392392
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
393393
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
394394
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
395-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
395+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
396396

397397
<!-- API links -->
398398

docs/content/docs/recipes/node.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ When you make changes to the code the project will automatically rebuild and the
208208
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
209209
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
210210
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
211-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
211+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
212212

213213
<!-- API links -->
214214

docs/content/docs/recipes/react.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ When you make changes to the code the project will automatically rebuild and the
251251
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
252252
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
253253
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
254-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
254+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
255255

256256
<!-- API links -->
257257

docs/content/docs/start/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ The [full code for this application is available](https://github.com/microsoft/F
212212
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
213213
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
214214
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
215-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
215+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
216216

217217
<!-- API links -->
218218

docs/content/docs/testing/telemetry.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ It's not recommended to set `localStorage.debug` in code; your users will see a
311311
[SharedCounter]: {{< relref "/docs/data-structures/counter.md" >}}
312312
[SharedMap]: {{< relref "/docs/data-structures/map.md" >}}
313313
[SharedString]: {{< relref "/docs/data-structures/string.md" >}}
314-
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
314+
[Sequences]: {{< relref "/docs/data-structures/sequences.md" >}}
315315
316316
<!-- API links -->
317317

docs/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
"linkcheck": "start-server-and-test start http://localhost:1313 linkcheck:full",
3737
"linkcheck:fast": "linkcheck http://localhost:1313 --skip-file skipped-urls.txt",
3838
"linkcheck:full": "npm run linkcheck:fast -- --external",
39-
"lint": "markdownlint-cli2",
40-
"lint:fix": "markdownlint-cli2-fix",
39+
"lint": "npm run markdownlint && npm run prettier",
40+
"lint:fix": "npm run markdownlint:fix && npm run prettier:fix",
41+
"markdownlint": "markdownlint-cli2",
42+
"markdownlint:fix": "markdownlint-cli2-fix",
4143
"prettier": "prettier --check . --cache --ignore-path ../.prettierignore",
4244
"prettier:fix": "prettier --write . --cache --ignore-path ../.prettierignore",
4345
"start": "hugo server"

docs/readVersionData.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55

66
/**
77
* This script is used to read the previousVersions data from versions.json
8-
* Note that the results are formatted and printed with console.log() so that the
8+
* Note that the results are formatted and printed with console.log() so that the
99
* output can be piped and consumed using a Bash Task in build-docs.yml
1010
*/
1111

12-
const fs = require('fs');
12+
const fs = require("fs");
1313

1414
// Read the JSON file content
15-
const jsonData = fs.readFileSync('docs/data/versions.json', 'utf8');
15+
const jsonData = fs.readFileSync("docs/data/versions.json", "utf8");
1616

1717
// Parse the JSON data
1818
const parsedData = JSON.parse(jsonData);
1919

2020
// Extract values from "previousVersions" and output for Bash processing
21-
return(console.log(parsedData.params.previousVersions.join('\n')));
21+
return console.log(parsedData.params.previousVersions.join("\n"));

0 commit comments

Comments
 (0)