Closed
Description
So this is a weird one. I added check-line-alignment
and it works locally on Windows.
My repo is a cross-platform library, so I run GitHub Actions against it on Linux, OSX, and Windows with Node 14 (and Node 8, but ESLint 7 doesn't support Node 8, so just ignore that).
The weird thing is that only the Windows version is failing. And it isn't failing when ran locally on Windows.
Here is the GHA checks. you can switch between each OS and see that it's only on the Windows branch.
No idea what the cause is, all the code is stored in LF, so unless the GHA Windows VM is cloning in CRLF and I need to change some GHA setting, I don't think it's related to that.
Activity
brettz9 commentedon May 21, 2021
As mentioned, you might try updating the deprecated
babel-eslint
to@babel/eslint-parser
(you will need to add@babel/core
(should be just a devDep. if your parser is) as well as add either a Babel config or addrequireConfigFile: false
toparserOptions
. A bug in the parser could perhaps be presenting issues.TheJaredWilcurt commentedon May 22, 2021
@brettz9 I think I did what you said, but it's still happening:
is there something I'm missing
brettz9 commentedon May 22, 2021
Hmm, ok. (That was just a guess, as thought it'd be good to do that anyways, and ensure we control our variables.) I think solving this might require someone doing a bunch of logging within a fork of the plug-in and seeing where things go awry on Windows.
TheJaredWilcurt commentedon May 22, 2021
Turns out it was line ending related.
I changed
.gitattributes
from* text=LF
to
And that fixed it. But at least I got some parser updates too out of this.
brettz9 commentedon May 22, 2021
Should have thought of this earlier...
Here is what should be a valid test case but fails:
(An equivalent "never" example with alignment removed works fine with carriage returns, however.)
Then there is this invalid case which fails:
Here's what does work though:
I think this should probably be reported to
comment-parser
which I see does split by optional carriage returns while joining with newlines only. Reopening (feel free to unsubscribe if not interested). Update: Now reported to syavorsky/comment-parser#129fix(`check-line-alignment`): preserve carriage returns; fixes gajus#745
check-line-alignment
): preserve carriage returns; fixes #745 #763fix(`check-line-alignment`): preserve carriage returns; fixes gajus#745
4 remaining items