Chatie / git-scripts

Git Hooks Integration for Chatie Projects
https://npmjs.com/package/@chatie/git-scripts
Apache License 2.0
1 stars 4 forks source link

npm run lint may not output error messages when running errors #29

Closed binsee closed 2 years ago

binsee commented 2 years ago
 ✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > git push                   
[Step-1] Checking last commit... 

[Step-2] Checking lint... 

Error:
------------------------------------------

------------------------------------------

Failed to exec pre-push hook script
error: 无法推送一些引用到 'github.com:binsee/puppet-xp.git'

Running npm lint fails with no error message

 ✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > npm run lint                     

> wechaty-puppet-xp@1.10.26 lint
> npm run lint:es && npm run lint:ts && npm run lint:md

> wechaty-puppet-xp@1.10.26 lint:es
> eslint "src/**/*.ts" "tests/**/*.spec.ts" --ignore-pattern tests/fixtures/

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.5.0

YOUR TYPESCRIPT VERSION: 4.5.5

Please only submit bug reports when using the officially supported version.

=============

> wechaty-puppet-xp@1.10.26 lint:ts
> tsc --isolatedModules --noEmit

examples/ding-dong-bot.ts:113:5 - error TS2339: Property 'talkerId' does not exist on type 'MessagePayload'.

113     talkerId,
        ~~~~~~~~

src/puppet-xp.ts:307:7 - error TS2322: Type '{ id: string; roomId: string; talkerId: string; text: string; timestamp: number; toId: string; type: PUPPET.type.Message.Unknown | PUPPET.type.Message.Audio | PUPPET.type.Message.Contact | ... 4 more ... | PUPPET.type.Message.Video; }' is not assignable to type 'MessagePayload'.
  Object literal may only specify known properties, and 'talkerId' does not exist in type 'MessagePayload'.

307       talkerId,
          ~~~~~~~~

Found 2 errors.
 ✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > npm run lint:ts            

> wechaty-puppet-xp@1.10.26 lint:ts
> tsc --isolatedModules --noEmit

examples/ding-dong-bot.ts:113:5 - error TS2339: Property 'talkerId' does not exist on type 'MessagePayload'.

113     talkerId,
        ~~~~~~~~

src/puppet-xp.ts:307:7 - error TS2322: Type '{ id: string; roomId: string; talkerId: string; text: string; timestamp: number; toId: string; type: PUPPET.type.Message.Unknown | PUPPET.type.Message.Audio | PUPPET.type.Message.Contact | ... 4 more ... | PUPPET.type.Message.Video; }' is not assignable to type 'MessagePayload'.
  Object literal may only specify known properties, and 'talkerId' does not exist in type 'MessagePayload'.

307       talkerId,
          ~~~~~~~~

Found 2 errors.
 ✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > npm run lint:ts > /dev/null

So, error message for tsc --isolatedModules --noEmit not output to stderr, but output to stdout.

We need to be compatible with the message output to stdout when stderr has no message.

binsee commented 2 years ago

After pr #30

✘ binsee@shanmudeMBP15  ~/CodeWork/puppet-xp   fix-git-scripts ±  git push                   
[Step-1] Checking last commit... 

[Step-2] Checking lint... 

Error:
------------------------------------------

> wechaty-puppet-xp@1.10.26 lint
> npm run lint:es && npm run lint:ts && npm run lint:md

> wechaty-puppet-xp@1.10.26 lint:es
> eslint "src/**/*.ts" "tests/**/*.spec.ts" --ignore-pattern tests/fixtures/

> wechaty-puppet-xp@1.10.26 lint:ts
> tsc --isolatedModules --noEmit

examples/ding-dong-bot.ts(113,5): error TS2339: Property 'talkerId' does not exist on type 'MessagePayload'.
src/puppet-xp.ts(307,7): error TS2322: Type '{ id: string; roomId: string; talkerId: string; text: string; timestamp: number; toId: string; type: PUPPET.type.Message.Unknown | PUPPET.type.Message.Audio | PUPPET.type.Message.Contact | ... 4 more ... | PUPPET.type.Message.Video; }' is not assignable to type 'MessagePayload'.
  Object literal may only specify known properties, and 'talkerId' does not exist in type 'MessagePayload'.

------------------------------------------

Failed to exec pre-push hook script
error: 无法推送一些引用到 'github.com:binsee/puppet-xp.git'
huan commented 2 years ago

I ran into this problem today as well, thank you very much for the improvement!