Skip to content

Commit 822d4ed

Browse files
authored
Merge pull request #225 from vim-denops/fix-ci
☕ Fix lint
2 parents 31d5419 + 871c031 commit 822d4ed

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

deno.jsonc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"lock": false,
3+
"exclude": [
4+
"docs/**"
5+
],
36
"tasks": {
47
"test": "deno test --unstable -A --doc --parallel --shuffle --coverage=.coverage",
58
"check": "deno check --unstable $(find . -name '*.ts')",

scripts/gen-option/parse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function parseBlock(name: string, body: string): Option | undefined {
111111
const reDefinition =
112112
`^'${name}'${reShortNames}(?:${reType}(?:${reDefaults})?)?(?:${reTags})?$`;
113113
const m1 = body.match(new RegExp(reDefinition, "dm"));
114-
const type = m1?.groups!.type ?? fallbackTypes[name];
114+
const type = m1?.groups?.type ?? fallbackTypes[name];
115115
if (!m1 || !isOptionType(type)) {
116116
// {name} not found, or {type} is invalid
117117
return;
@@ -124,12 +124,12 @@ function parseBlock(name: string, body: string): Option | undefined {
124124
const scope = (
125125
m2?.[1].split(" or ") ?? ["global"]
126126
) as Array<"global" | "local">;
127-
body = trimLines(body.substring(m2?.indices![0][1] ?? 0)) + "\n";
127+
body = trimLines(body.substring(m2?.indices?.at(0)?.at(1) ?? 0)) + "\n";
128128

129129
// Extract {attention}
130130
const m3 = body.match(/^\t{3,}(\{(?:Vi[: ]|not|only)[^{}]*\})\s*?\n/d);
131131
const attention = m3?.[1].replaceAll(/\s+/g, " ").trim();
132-
body = trimLines(body.substring(m3?.indices![0][1] ?? 0)) + "\n";
132+
body = trimLines(body.substring(m3?.indices?.at(0)?.at(1) ?? 0)) + "\n";
133133

134134
// Append {defaults} and {attention} to {document}
135135
body += `\n\n${defaults ?? ""}\n\n${attention ?? ""}`;

0 commit comments

Comments
 (0)