Skip to content

Commit

Permalink
chore(config): update workspace configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsneighbour committed Nov 25, 2024
1 parent 2318fee commit 2b4c47f
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 388 deletions.
22 changes: 20 additions & 2 deletions .frontmatter/config.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
const dnbConfig = require('@davidsneighbour/frontmatter-config');
const dnbConfig = require("@davidsneighbour/frontmatter-config");

module.exports = async function (config) {
let resolvedDnbConfig;

try {
resolvedDnbConfig = await (typeof dnbConfig === "function"
? dnbConfig()
: dnbConfig);
} catch (error) {
throw new Error(`Failed to load dnbConfig: ${error.message}`);
}

if (typeof resolvedDnbConfig !== "object") {
throw new Error("dnbConfig must resolve to an object.");
}

if (typeof config !== "object") {
throw new Error("The provided config must be an object.");
}

return {
...dnbConfig,
...resolvedDnbConfig,
...config,
};
};
2 changes: 2 additions & 0 deletions .github/vale/config/vocabularies/dnb/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ Boxicons
Iconoir
MIT License
Lineicons
SASS
YouTube
7 changes: 2 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"markdown.extension.tableFormatter.normalizeIndentation": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[dotenv]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
Expand All @@ -38,13 +35,13 @@
"stylelint.snippet": ["css", "less", "postcss", "scss", "sass"],
"stylelint.validate": ["css", "less", "postcss", "sass", "scss"],
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[markdown]": {
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
Expand Down
Loading

0 comments on commit 2b4c47f

Please sign in to comment.