Skip to content

Conversation

@serhalp
Copy link
Contributor

@serhalp serhalp commented Aug 4, 2020

Background

See https://www.npmjs.com/package/@rushstack/eslint-patch for detailed context.

See https://goodeggs.slack.com/archives/CPX6NFU02/p1586283695076400 and https://goodeggs.slack.com/archives/CPX6NFU02/p1588966563372800 for some past discussions on the topic.

In practice, what this means is that the latest setup where repos use goodeggs-toolkit for linting (which wraps eslint-plugin-goodeggs) does not work correctly in IDEs that try to use the underlying eslint commands directly rather than the goodeggs-toolkit getk run commands. Most IDEs should be able to work around this by configuring the --resolve-plugins-relative-to option, but (1) this isn't strictly, exhaustively correct, and (2) for some inexplicable reason, this does not appear to work with Visual Studio Code.

The previous workaround involved installing all the transitive dependencies in each consuming repo (despite the fact that 80% of the point of goodeggs-toolkit was avoiding this in the first place), e.g. https://github.com/goodeggs/garbanzo/pull/6787.

Changes

This pulls in a monkey-patch that alters the behavior of eslint's plugin resolution mechanism to behave the way it should.

I generally avoid monkey-patches like the plague, but:

  • all alternatives here are terrible, are high cost/effort, and require adjustments in every single repo that uses eslint-plugin-goodeggs
  • this is causing significant developer pain
  • this is a tracked issue in an active, maintained community library (eslint) which has a specific roadmap to address the underlying issue
  • this is a community-maintained monkey-patch used by many repos, and owned by Microsoft

To Do

  • verify this works

@serhalp serhalp force-pushed the fix/work-around-eslint-plugin-sharing-limitation branch from 7bd6c2d to f903882 Compare November 10, 2020 15:51
@serhalp serhalp force-pushed the fix/work-around-eslint-plugin-sharing-limitation branch from 0a2ec55 to bf46619 Compare July 22, 2022 14:01
serhalp added 2 commits July 22, 2022 10:16
See https://www.npmjs.com/package/@rushstack/eslint-patch for a full history.

See https://goodeggs.slack.com/archives/CPX6NFU02/p1586283695076400 and
https://goodeggs.slack.com/archives/CPX6NFU02/p1588966563372800 for some past discussions
on the topic.

I generally avoid monkey-patches like the plague, but:
- all alternatives here are terrible, are high cost/effort, and require adjustments in
  every single repo that uses eslint-plugin-goodeggs
- this is causing significant developer pain
- this is a tracked issue in an active, maintained community library (eslint) which has a
  specific roadmap to address the underlying issue
- this is a community-maintained monkey-patch used by many repos, and owned by Microsoft
@serhalp serhalp force-pushed the fix/work-around-eslint-plugin-sharing-limitation branch from 7864fc3 to 9946b09 Compare July 22, 2022 14:19
@serhalp
Copy link
Contributor Author

serhalp commented Oct 10, 2022

If anyone is looking at this some day in the future... the above patch library appears not to work with eslint 8, even though it claims it does. Last I checked, that's the blocker to using this.

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 this pull request may close these issues.

2 participants