Closed ryannealmes closed 8 years ago
Hey @ryannealmes I am just getting set up for the day. I'll take a look at it in a few minutes and tell you what I think. Thanks for posting this.
Thanks. Happy to help out.
Ok, so just a couple things. The computer I am testing this on I just installed docker. But, something I noticed was that it was stating "unexpected token abc" Is that the error you were speaking of that keeps appearing? If that is the case, there isn't a rule in the .eslintrc
for es6. After that, it seems like the linting works as intended.
Hmm it's difficult to explain this issue.
The errors coming through on the linter are perfect. The problem is when do they come through. They are staggered.
Let's say you change the name of variable abc
to zzzz
you would expect your linter to run. It does run, but it prints out the previous error message.
So I make a change and I get the following error
lint_1 | /app/test.js (1/0)
lint_1 | ✖ 1:5 Parsing error: Unexpected token abc
lint_1 |
lint_1 | ✖ 1 error (2:53:10 PM)
lint_1 |
But the variable has been changed to zzzz
. If you change the file again, say change zzzz
to myvariable
you get
lint_1 | /app/test.js (1/0)
lint_1 | ✖ 1:5 Parsing error: Unexpected token zzz
lint_1 |
lint_1 | ✖ 1 error (2:55:02 PM)
lint_1 |
Do you see? It should be displaying myvariable
. It's staggered. Is this not happening for you?
To your point, I am expecting that behaviour. That is what eslint-watcher should be printing out. I am not testing linting rules, I am just trying to get things working with docker. The linter runs perfectly, but when using docker it's staggered.
Gotcha. This is following the exact steps that you just said:
Starting eslintwatchbugreplica_lint_1
Attaching to eslintwatchbugreplica_lint_1
lint_1 | npm info it worked if it ends with ok
lint_1 | npm info using npm@3.10.8
lint_1 | npm info using node@v6.9.1
lint_1 | npm info lifecycle eslint-docker@1.0.0~preinstall: eslint-docker@1.0.0
lint_1 | npm info linkStuff eslint-docker@1.0.0
lint_1 | npm info lifecycle eslint-docker@1.0.0~install: eslint-docker@1.0.0
lint_1 | npm info lifecycle eslint-docker@1.0.0~postinstall: eslint-docker@1.0.0
lint_1 | npm info lifecycle eslint-docker@1.0.0~prepublish: eslint-docker@1.0.0
lint_1 | npm WARN eslint-config-airbnb@13.0.0 requires a peer of eslint-plugin-jsx-a11y@^2.2.3 but none was installed.
lint_1 | npm WARN eslint-docker@1.0.0 No repository field.
lint_1 | npm info ok
lint_1 | /app/test.js (1/0)
lint_1 | ✖ 1:5 Parsing error: Unexpected token abc
lint_1 |
lint_1 | ✖ 1 error (3:01:11 PM)
lint_1 |
lint_1 | /app/test.js (1/0)
lint_1 | ✖ 1:5 Parsing error: Unexpected token zzzz
lint_1 |
lint_1 | ✖ 1 error (3:01:21 PM)
lint_1 |
lint_1 |
lint_1 | /app/test.js (1/0)
lint_1 | ✖ 1:5 Parsing error: Unexpected token myvariable
lint_1 |
lint_1 | ✖ 1 error (3:01:30 PM)
I changed it 2 different times and each time it linted the variable as I was expecting it to. Doesn't seem to be staggered. What docker version are you using? I am on a mac using docker for mac.
You are only saving once correct?
These are my versions.
Docker version 1.12.3, build 6b644ec docker-compose version 1.8.1, build 878cff1 docker-machine version 0.8.2, build e18a919
Lol I want to rage!
What versions are you using?
Been there. haha Yeah, I am only saving once.
Docker version 1.12.3, build 6b644ec docker-compose version 1.8.1, build 878cff1 docker-machine version 0.8.2, build e18a919
Are you on a mac? Or should I remote into my window machine and try it there?
No I am on a Mac El Capitan - 10.11.6.
Any suggestions?
I am as well...
The only thing that comes to mind is, have you tried blowing away your images and building it from the ground up? That seems to be the only difference between our machines.
Ye I have recreated the images a couple of times, but let me maybe try wipe docker and reinstall it. Man docker is meant to make things easier :/
Thanks I will let you know how it goes.
@rizowski ... and the plot thickens. Let me guess, you aren't using iterm are you?
It seems things work fine in the mac terminal, but in iterm2 I can replicate the bug.
Yay I just fixed it!!!!!
I was using iTerm2 3.0.9. It seems in iTerm2 3.0.12 (OS 10.8+) this bug is fixed. It would be great to know why, but honestly after almost 2 days I think I deserve a break. The change logs don't say anything.
Anyway hopefully this helps someone else down the line.
Haha I was using iTerm 2 v3.0.12 to test it out. Glad you were able to figure out the issue. Strange that it was the terminal causing the issue.
I have been trying to get my front-end working on docker for the past day and I have narrowed down some irregular behaviour to eslint-watch and docker.
I have recreated a minimal working repo of the bug I am experiencing.
It seems that linting is somehow staggered when using docker-compose (
docker-compose up
specifically,docker-compose run
seems to work fine). Rather the last console log statements are staggered. I am not sure what it is, but from my reading the best interpretation I can give is that the log messages that should be printed out for the linting are for some reason not flushed out of the node message queue.I have narrowed down the message printing to the eslint watcher file. If I add in more console logs at the end of this method it prints out the linting fine, but it staggers my logs (i.e. the last logs in execution).
To replicate, download my repo, run
docker-compose up
and edit the test.js file and save. You will see what I mean.I hope this is descriptive enough, it's a really strange bug.
Any ideas how I can actually figure this out?