4 small fixes (#605)

1. 2 typo fixes
2. Use slice instead of substr, which is deprecated
3. Add support for JSDocThrowsTag using the workaround for the
dependency that doesn't have it in its enum.
This commit is contained in:
Nathan Shively-Sanders
2023-02-08 09:44:00 -08:00
committed by GitHub
parent 9df9c03345
commit d6648751b5
4 changed files with 6 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ if (!module.parent) {
type: "boolean",
default: false,
},
// Not sure why youd use this, so Im hiding it
// Only useful for repeated local runs, so Im hiding it
noInstall: {
hidden: true,
type: "boolean",

View File

@@ -127,7 +127,7 @@ export async function runDTSLint({
break;
case CrashRecoveryState.Crashed:
if (expectedFailures?.has(input.path)) {
console.error(`${prefix}${input.path} failed as expected: outof memory.`);
console.error(`${prefix}${input.path} failed as expected: out of memory.`);
} else {
console.error(`${prefix}${input.path} Out of memory: failed`);
allFailures.push([input.path, "Out of memory"]);

View File

@@ -51,7 +51,7 @@ async function main(): Promise<void> {
onlyTestTsNext = true;
break;
// Only for use by types-publisher.
// Listens for { path, onlyTestTsNext } messages and ouputs { path, status }.
// Listens for { path, onlyTestTsNext } messages and outputs { path, status }.
case "--listen":
shouldListen = true;
break;
@@ -66,7 +66,7 @@ async function main(): Promise<void> {
arg.indexOf("@") === 0 && arg.indexOf("/") !== -1
? // we have a scoped module, e.g. @bla/foo
// which should be converted to bla__foo
arg.substr(1).replace("/", "__")
arg.slice(1).replace("/", "__")
: arg;
dirPath = joinPaths(dirPath, path);
}

View File

@@ -58,9 +58,11 @@ function walk(ctx: Lint.WalkContext<void>): void {
function checkTag(tag: ts.JSDocTag): void {
const jsdocSeeTag = (ts.SyntaxKind as any).JSDocSeeTag || 0;
const jsdocDeprecatedTag = (ts.SyntaxKind as any).JSDocDeprecatedTag || 0;
const jsdocThrowsTag = (ts.SyntaxKind as any).JSDocThrowsTag || 0;
switch (tag.kind) {
case jsdocSeeTag:
case jsdocDeprecatedTag:
case jsdocThrowsTag:
case ts.SyntaxKind.JSDocAuthorTag:
// @deprecated and @see always have meaning
break;