rizowski / eslint-watch

ESLint with simple watching capabilities
https://www.npmjs.com/package/eslint-watch
MIT License
196 stars 29 forks source link

Using `\u001B[2J\u001B[0;0f` to avoid special character in `Hyper` with --clear flag #140

Closed filipposarzana closed 6 years ago

filipposarzana commented 6 years ago

Using \u001B[2J\u001B[0;0f to avoid special character in Hyper with --clear flag

It works in every other terminal, tested 👍

What was the problem/Ticket Number

There is some issue with special character if --clear is specified

cleannotworking errornotworking

How does this solve the problem?

Using \u001B[2J\u001B[0;0f native method solves the issue. The first code \u001B[2J instructs the terminal to clear itself, and the second one \u001B[0;0f forces the cursor back to position 0,0.

cleanworking errorworking

How to duplicate the issue

  1. Pass --clear option
filipposarzana commented 6 years ago

Hi @rizowski i've tried to figure out why the coverage/coveralls was failing but actually I'm unable to find a response to it 🤔

Actually I edited only the file i've touched and it seems breaking anyway. Could you give me a hint about it? I would be happy to contribute somehow if it's needed 👍

rizowski commented 6 years ago

@filipposarzana Thanks for the PR. I actually need to upgrade eslint-watch to support Node V6. I try to follow what eslint is currently supporting which is what caused some of your test errors earlier. Node 4 doesn't include console.clear. As for the coveralls issue. It's possible it have it setup incorrectly currently. I have been having problems with it reporting the status. But I am ok with pulling this in anyways if you are good with the code.

filipposarzana commented 6 years ago

Yeah, I've reverted usage of console.clear with something more reliable on more environments, but I'm ok with the code, since it's working with all terminals.

Once you upgrade node version, I could make another PR to upgrade the code.

Thanks 👍

Let me know 😉