Open
Conversation
simonguo
requested changes
Feb 9, 2022
Member
simonguo
left a comment
There was a problem hiding this comment.
Error: Errors in typescript@local for external dependencies:
Error: ../src/utils/createValidatorAsync.ts(24,9): error TS2345: Argument of type '(checkResult: CheckResult<E> | boolean) => CheckResult<E> | null' is not assignable to parameter of type '(value: boolean | CheckResult<E> | undefined) => CheckResult<E> | PromiseLike<CheckResult<E> | null> | null'.
Types of parameters 'checkResult' and 'value' are incompatible.
Type 'boolean | CheckResult<E> | undefined' is not assignable to type 'boolean | CheckResult<E>'.
Type 'undefined' is not assignable to type 'boolean | CheckResult<E>'.
at /home/runner/work/schema-typed/schema-typed/node_modules/dtslint/bin/index.js:206:19
at Generator.next (<anonymous>)
at fulfilled (/home/runner/work/schema-typed/schema-typed/node_modules/dtslint/bin/index.js:6:58)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! schema-typed@2.0.2 test:types: `dtslint --expectOnly --localTs node_modules/typescript/lib types`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the schema-typed@2.0.2 test:types script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-09T05_49_18_190Z-debug.log
npm ERR! Test failed. See above for more details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
当前addRule要求返回boolean 或 ErrorMessage
而代码中的逻辑是 返回 false 或 ErrorMessage 进行处理,没有返回值会被认为是通过的
所以对应的类型声明应允许返回空