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

Prettier for imports #74

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

jerempy
Copy link
Contributor

@jerempy jerempy commented Oct 16, 2023

Closes: #57

I tried to get a close approximation from the earlier eslint rule. Not an exact, but pretty close.

The earlier rule was already removed here: 795d93b

I tried to match the descriptions in eslint: https://eslint.org/docs/latest/rules/sort-imports#examples

The import orders are done a littler differently with the prettier plugin. So i tried to get an idea of how most of the imports are being done and then wrote the import order to approximate that.

Then i ran prettier on code base - so there is a commit that shows what the import sorting will look like

Update .prettierrc.json
@jerempy jerempy requested a review from finn-block as a code owner October 16, 2023 02:10
@codesandbox
Copy link

codesandbox bot commented Oct 16, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@trivago/prettier-plugin-sort-imports 4.2.0 None +27 6.91 MB ayusharma

@jerempy jerempy force-pushed the prettier-for-imports branch from 43f5b72 to 6bc37dd Compare October 16, 2023 21:18
@@ -182,7 +181,7 @@ export async function sendWsMessage(
socket.onopen = (_event): void => {
socket.onmessage = (event): void => {
socket.terminate();
return resolve(<Buffer>event.data);
return resolve(event.data as Buffer);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linter was raising error as unclosed JSX. so casting it using as which does same thing

@finn-block finn-block merged commit fef5b82 into decentralized-identity:main Oct 16, 2023
1 check passed
@finn-block finn-block added the hacktoberfest-accepted Accepted PRs for the hacking month of October label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accepted PRs for the hacking month of October
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace eslint sort-imports rule with prettier plugin
2 participants