Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow clients to access messages from eslint #827

Merged
merged 5 commits into from Dec 19, 2023

Conversation

gwhitney
Copy link
Contributor

Adds another export analyze from this package, which behaves
exactly like format except that it returns a simple object
with properties output giving the formatted text and messages
giving the eslint messages produced in processing the input text.
Clients can call analyze instead of format if they wish, for
example, to capture any errors that eslint may have encountered.

Resolves #704.

@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2022

🦋 Changeset detected

Latest commit: 1e1901b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
prettier-eslint Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gwhitney
Copy link
Contributor Author

I expect that given that this PR adds a new export, it should have a changeset. So I clicked on the link about how to add a changeset, and I tried npx changeset in the top-level directory of my clone, but it reports could not determine executable to run. I tried sudo npm install -g changeset, but still neither npx changeset nor changeset worked. So I am currently unable to add a changeset, but would be happy to do so if further guidance could be provided.

@idahogurl
Copy link
Collaborator

@gwhitney To create a changeset, the command should be npx -p @changesets/cli changeset

@gwhitney
Copy link
Contributor Author

Thanks! Now it reports 🦋 error There is no .changeset folder. so sadly I am still stuck.

@idahogurl
Copy link
Collaborator

@gwhitney If you want you can add me to as a contributor to your forked repo and I'll make a PR to put the changeset in

@gwhitney
Copy link
Contributor Author

I'm confused? I've already allowed edits by maintainers...

@gwhitney
Copy link
Contributor Author

I am still confused, why do you need access to the entire fork as opposed to this branch on the fork, which you presumably already have? That was my question, sorry I wasn't clear...

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d4d55fd) 100.00% compared to head (1e1901b) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #827   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          291       301   +10     
  Branches        82        83    +1     
=========================================
+ Hits           291       301   +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gwhitney
Copy link
Contributor Author

Thanks so much for doing that for me! I really appreciate it.

.eslintrc.js Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Stale pull request

@gwhitney
Copy link
Contributor Author

I see the stale marking; is there anything I am supposed to be doing to advance this? Thanks for letting me know.

@github-actions github-actions bot closed this May 21, 2023
@gwhitney
Copy link
Contributor Author

Why was this closed? Was it deemed not desirable for the project? Or would some different approach to issue #704 be preferred? Please let me know what I can do to work toward a solution for that issue. Thanks!

@idahogurl idahogurl reopened this May 22, 2023
@JounQin
Copy link
Member

JounQin commented Dec 16, 2023

Well, the stale bot is stupid in this case...

@JounQin
Copy link
Member

JounQin commented Dec 17, 2023

@gwhitney Do you have anytime to fix the conflicts?

@gwhitney
Copy link
Contributor Author

@gwhitney Do you have anytime to fix the conflicts?

Hope to later today, not 100% certain. Will keep you posted.

gwhitney and others added 4 commits December 18, 2023 21:00
  Adds another export `analyze` from this package, which behaves
  exactly like `format` except that it returns a simple object
  with properties `output` giving the formatted text and `messages`
  giving the eslint messages produced in processing the input text.
  Clients can call `analyze` instead of `format` if they wish, for
  example, to capture any errors that esling may have encountered.

  Resolves prettier#704.
@gwhitney
Copy link
Contributor Author

OK, did my best to rebase. The new test runs OK on my machine. Let me know what else I can do to help. Thanks!

@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

I don't see anything strange, so merging.

@JounQin JounQin merged commit 6ba8025 into prettier:master Dec 19, 2023
6 checks passed
@JounQin
Copy link
Member

JounQin commented Dec 19, 2023

Released as v16.2.0.

Thanks for your contribution! @gwhitney

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.

ability to capture (non-fixable) eslint errors/warnings?
4 participants