mirror of
https://github.com/chenasraf/DefinitelyTyped-tools.git
synced 2026-05-18 01:49:03 +00:00
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:
committed by
GitHub
parent
9df9c03345
commit
d6648751b5
@@ -66,7 +66,7 @@ if (!module.parent) {
|
||||
type: "boolean",
|
||||
default: false,
|
||||
},
|
||||
// Not sure why you’d use this, so I’m hiding it
|
||||
// Only useful for repeated local runs, so I’m hiding it
|
||||
noInstall: {
|
||||
hidden: true,
|
||||
type: "boolean",
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user