Skip to content

Commit 86b22ca

Browse files
authored
chore: cleanup of deno lint/ vscode "problems", etc (#4608)
* add ignore directives to deno, clean up some lua diagnostics * chore: deno lint * lua-types cleanup * fix minor schema bug * build artifacts
1 parent 7d221f4 commit 86b22ca

File tree

34 files changed

+749
-189
lines changed

34 files changed

+749
-189
lines changed

.luarc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"Lua.runtime.version": "Lua 5.3",
2020
"Lua.workspace.checkThirdParty": false,
2121
"Lua.workspace.library": ["src/resources/lua-types"],
22+
"Lua.workspace.ignoreDir": ["tests/renv"],
2223
"Lua.runtime.plugin": "src/resources/lua-plugin/plugin.lua"
2324
}

deno.jsonc

Lines changed: 666 additions & 0 deletions
Large diffs are not rendered by default.

dev-docs/update-deno_jsonc.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## tl;dr
2+
3+
deno.jsonc currently doesn't support globs, so we have a script to expand the globs ourselves.
4+
5+
## Steps
6+
7+
```
8+
$ cd quarto-cli
9+
$ deno run --allow-all package/src/common/create-deno-config.ts > deno.jsonc
10+
```

src/command/render/render-files.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ import {
8282
} from "./freeze.ts";
8383
import { isJupyterNotebook } from "../../core/jupyter/jupyter.ts";
8484
import { MappedString } from "../../core/lib/text-types.ts";
85-
import {
86-
waitUntilNamedLifetime,
87-
} from "../../core/lifetimes.ts";
85+
import { waitUntilNamedLifetime } from "../../core/lifetimes.ts";
8886
import { resolveDependencies } from "./pandoc-dependencies-html.ts";
8987
import {
9088
getData as getTimingData,
@@ -289,7 +287,7 @@ export async function renderFiles(
289287

290288
if (progress) {
291289
renderProgress(
292-
`[${String(i + 1).padStart(numWidth)}/${files.length}] ${
290+
`\r[${String(i + 1).padStart(numWidth)}/${files.length}] ${
293291
relative(project!.dir, file.path)
294292
}`,
295293
);

src/core/handlers/base.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ import {
2828
optionCommentPatternFromLanguage,
2929
} from "../lib/partition-cell-options.ts";
3030
import { ConcreteSchema } from "../lib/yaml-schema/types.ts";
31-
import {
32-
pandocBlock,
33-
pandocHtmlBlock,
34-
pandocList,
35-
pandocRawStr,
36-
} from "../pandoc/codegen.ts";
31+
import { pandocBlock, pandocList, pandocRawStr } from "../pandoc/codegen.ts";
3732

3833
import {
3934
kCapLoc,
@@ -74,10 +69,6 @@ import { mappedStringFromFile } from "../mapped-text.ts";
7469
import { error } from "log/mod.ts";
7570
import { withCriClient } from "../cri/cri.ts";
7671
import { normalizePath } from "../path.ts";
77-
import {
78-
extractHtmlFromElements,
79-
extractImagesFromElements,
80-
} from "../puppeteer.ts";
8172

8273
const handlers: Record<string, LanguageHandler> = {};
8374

src/core/handlers/mermaid.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,13 @@ mermaid.initialize(${JSON.stringify(mermaidOpts)});
367367
// deno-lint-ignore require-await
368368
const makeJs = async () => {
369369
setupMermaidJsRuntime();
370-
const { baseName: tooltipName } = handlerContext
371-
.uniqueFigureName(
372-
"mermaid-tooltip-",
373-
"",
374-
);
370+
// removed until we use mermaid 10.0.0
371+
//
372+
// const { baseName: tooltipName } = handlerContext
373+
// .uniqueFigureName(
374+
// "mermaid-tooltip-",
375+
// "",
376+
// );
375377
const preAttrs = [];
376378
if (options.label) {
377379
preAttrs.push(`label="${options.label}"`);

src/core/jupyter/jupyter-embed.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { resourcePath } from "../resources.ts";
99
import { getNamedLifetime, ObjectWithLifetime } from "../lifetimes.ts";
1010

1111
import {
12-
cleanEmptyJupyterAssets,
1312
jupyterAssets,
1413
jupyterFromFile,
1514
jupyterToMarkdown,
@@ -45,7 +44,7 @@ import {
4544
import { globalTempContext } from "../temp.ts";
4645
import { isAbsolute } from "path/mod.ts";
4746
import { partitionMarkdown } from "../pandoc/pandoc-partition.ts";
48-
import { normalizePath, removeIfEmptyDir, safeExistsSync } from "../path.ts";
47+
import { normalizePath, safeExistsSync } from "../path.ts";
4948
import { basename } from "path/mod.ts";
5049

5150
export interface JupyterNotebookAddress {

src/core/jupyter/jupyter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ export async function jupyterKernelspecFromMarkdown(
466466
markdown: string,
467467
project?: ProjectContext,
468468
): Promise<[JupyterKernelspec, Metadata]> {
469-
const config = (project as any)?.config;
469+
const config = project?.config;
470470
const yaml = config
471471
? mergeConfigs(config, readYamlFromMarkdown(markdown))
472472
: readYamlFromMarkdown(markdown);

src/core/lib/yaml-intelligence/annotated-yaml.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -277,22 +277,6 @@ export function buildTreeSitterAnnotation(
277277
return dispatch[node.type](node);
278278
};
279279

280-
const annotateError = (
281-
start: number,
282-
end: number,
283-
message: string,
284-
): AnnotatedParse => {
285-
errors.push({ start, end, message });
286-
return {
287-
start,
288-
end,
289-
result: null,
290-
kind: "<<ERROR>>",
291-
components: [],
292-
source: mappedSource,
293-
};
294-
};
295-
296280
const annotateEmpty = (position: number): AnnotatedParse => {
297281
return {
298282
start: position,

src/core/lib/yaml-schema/common.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,21 +333,16 @@ export function objectSchema(params: {
333333
// if we subclass from something with patternProperties that came from case convention
334334
// detection, ignore that.
335335

336-
let filtered = false;
337336
const propNamesArray = baseSchema.map((s) => s.propertyNames)
338337
.filter((s) => {
339338
if (typeof s !== "object") return true;
340339
if (s.tags === undefined) return true;
341340
if (s.tags["case-detection"] === true) {
342-
filtered = true;
343341
return false;
344342
}
345343
return true;
346344
})
347345
.filter((s) => s !== undefined) as Schema[];
348-
// if (propertyNames) {
349-
// propNamesArray.push(propertyNames);
350-
// }
351346
if (propNamesArray.length === 1) {
352347
result.propertyNames = propNamesArray[0];
353348
} else if (propNamesArray.length > 1) {

0 commit comments

Comments
 (0)