gts icon indicating copy to clipboard operation
gts copied to clipboard

fix: run eslint from PATH

Open richardbarrell-calvium opened this issue 4 years ago • 5 comments

Rationale:

  • npm and Yarn both put (a directory containing) the eslint binary on PATH during "npm run foo", so take advantage of that to invoke eslint in a way that is compatible with Yarn workspaces.
  • (Node that node_modules/eslint/... may not exist, because the module may have been installed in another node_modules further up the filesystem tree. Yarn does ensure that the binary gets symlinked into node_modules/.bin.)
  • This should fix issue #490.

richardbarrell-calvium avatar Jul 19 '21 14:07 richardbarrell-calvium

Hi! I'd like some feedback on this, please.

  • Does this work with everyone else's workflow? I believe it works fine with using gts by running the various scripts like npm run lint, npm run test and so on. I don't know for certain if there are other ways in which people invoke gts in the wild?
  • Were there any performance issues or anything like that which were being dealt with previously by invoking eslint from node_modules/eslint/bin/eslint?
  • I'm not aware of any reason why this in principle shouldn't work on Windows, but I don't have access to a Windows box to test this on. (I can get ahold of one in a few hours.)

richardbarrell-calvium avatar Jul 19 '21 14:07 richardbarrell-calvium

@JustinBeckwith would you be a good person from whom to request code review on this, please? Tagging you because you mentioned PRs being welcome on the issue (#490) that I'm trying to solve.

richardbarrell-calvium avatar Jul 22 '21 10:07 richardbarrell-calvium

@richardbarrell-calvium this change seems reasonable to me, but I would like to test in a few environments before landing.

Could I bother you to rebase and push, for whatever reason it seems like actions did not kick off.

bcoe avatar Jun 10 '22 14:06 bcoe

Alternatively, @richardbarrell-calvium, if you could check the box that grants contributor write access to your branch, we can drive this to completion. Thank you!

alexander-fenster avatar Jul 21 '22 17:07 alexander-fenster

Hi there! @bcoe apologies for not replying sooner, the email notification got buried in my inbox. My bad.

@alexander-fenster I've rebased my branch on main and pushed it. I'm afraid I have no idea where that checkbox is. I can grant you write access to https://github.com/calvium/gts from the "Collaborators and teams" page?

GitHub's UI is telling me that the CI actions weren't invoked because workflow approval is required. Here is a screenshot of what I'm seeing: Screenshot 2022-07-25 at 11 24 27

richardbarrell-calvium avatar Jul 25 '22 10:07 richardbarrell-calvium

@alexander-fenster It would be great to see this move forward. If you're worried about compatibility, you could append ./node_modules/eslint/bin to PATH or manually fallback to the original invocation?

aabmass avatar Jan 10 '23 23:01 aabmass

@danielbankhead could you please have a look at this one?

naseemkullah avatar Sep 14 '23 23:09 naseemkullah

@richardbarrell-calvium please pull from the base branch and I can get this merged.

danielbankhead avatar Sep 14 '23 23:09 danielbankhead

@danielbankhead Thanks! I've merged main in to my branch and pushed.

richardbarrell-calvium avatar Sep 19 '23 10:09 richardbarrell-calvium

Looking into the Windows test timeout...

danielbankhead avatar Sep 21 '23 23:09 danielbankhead

@richardbarrell-calvium Nice! Looks like it passed. Do you mind pulling from main again?

danielbankhead avatar Sep 21 '23 23:09 danielbankhead

I've merged main and pushed again.

richardbarrell-calvium avatar Sep 29 '23 09:09 richardbarrell-calvium