Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for schema.json #1983

Merged
merged 5 commits into from Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 30 additions & 2 deletions .vscode/settings.json
@@ -1,14 +1,42 @@
{
"files.associations": {
Gerrit0 marked this conversation as resolved.
Show resolved Hide resolved
"tsdoc.json": "jsonc", // TSDoc allows comments.
"typedoc.json": "jsonc" // TypeDoc uses the JSONC parser for its configuration files.
},

"typescript.tsdk": "./node_modules/typescript/lib",

// Automatically run the formatter when certain files are saved.
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 4
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 4
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 4
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 4
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 4
},

"prettier.enable": true,
"prettier.configPath": ".config/.prettierrc.json",
"prettier.ignorePath": ".config/.prettierignore",

"eslint.workingDirectories": [".", "./example"],
"mochaExplorer.configFile": ".config/mocha.test-explorer.json",
"cSpell.words": ["cname", "tsbuildinfo", "tsdoc"]
Expand Down
9 changes: 7 additions & 2 deletions scripts/generate_options_schema.js
Expand Up @@ -13,6 +13,7 @@ const schema = {
title: "JSON Schema for typedoc.json",
type: "object",
properties: {},
allowTrailingCommas: true,
};

addTypeDocOptions({
Expand Down Expand Up @@ -72,8 +73,12 @@ addTypeDocOptions({
).map;
data.enum =
map instanceof Map
? [...map.keys()]
Gerrit0 marked this conversation as resolved.
Show resolved Hide resolved
: Object.keys(map).filter((key) => isNaN(+key));
? [...map.values()]
: Object.keys(map)
.filter((key) => isNaN(+key))
.map((key) =>
typeof map[key] === "number" ? key : map[key]
);
data.default =
/** @type {import("../dist").MapDeclarationOption} */ (
option
Expand Down