Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
binsee opened this issue Apr 20, 2022 · 2 comments · Fixed by #30
Closed

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

binsee opened this issue Apr 20, 2022 · 2 comments · Fixed by #30

Comments

@binsee
Copy link
Member

binsee commented Apr 20, 2022

 ✘ 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

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

> [email protected] lint
> npm run lint:es && npm run lint:ts && npm run lint:md


> [email protected] 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.

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

> [email protected] 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            

> [email protected] 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.
  • turn off display stdout
 ✘ 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
Copy link
Member Author

binsee commented Apr 20, 2022

After pr #30

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

[Step-2] Checking lint... 

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


> [email protected] lint
> npm run lint:es && npm run lint:ts && npm run lint:md


> [email protected] lint:es
> eslint "src/**/*.ts" "tests/**/*.spec.ts" --ignore-pattern tests/fixtures/


> [email protected] 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 huan closed this as completed in #30 Apr 20, 2022
huan pushed a commit that referenced this issue Apr 20, 2022
…ge (#30)

* compatible with the message output to stdout when stderr has no message
Fixes #29

* 0.7.10
@huan
Copy link
Member

huan commented Apr 20, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants