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

Added prettier to the project #335

Closed
wants to merge 16 commits into from

Conversation

amin-xiv
Copy link
Contributor

@amin-xiv amin-xiv commented Nov 11, 2024

Description

I have added the Prettier setup to the project.

Related Issue

Fixes #321

Note:

  • I have added a .gitignore file, in which the __pycache__ folder and the node_modules folder are ignored.
  • I have added a .gitattributes folder to handle line endings across different systems.
  • I have added the required extra files for it to work (package.json, .prettierrcc...etc).
  • I have already uploaded the formatted files.
  • The prettier.png image in the documentation will appear only after it has been merged.

Type of change

  • Bug fix
  • New feature

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

🎉 Thank you for your contribution! Your pull request has been submitted successfully. A maintainer from team will review it as soon as possible. We appreciate your support in making Dataverse better.

Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for multiverse-dataverse ready!

Name Link
🔨 Latest commit 1e4e8fc
🔍 Latest deploy log https://app.netlify.com/sites/multiverse-dataverse/deploys/673a05594f29d90008c382c3
😎 Deploy Preview https://deploy-preview-335--multiverse-dataverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@multiverseweb
Copy link
Owner

@amin-xiv I will test and review it soon

@multiverseweb
Copy link
Owner

Hey @amin-xiv, I tested the PR, it works great. But I had to run the Format Document to run Prettier. So I had a doubt that it does not run automatically upon saving the files, right?

Also, is it possible to put the newly added files in some directory? So that there not too many files in the root directory. I understand that some files need to be in the root directory for automatic detection. Just let me know if some movement is possible.

Checkout this prettier.PNG too and upload the correct image.
image
You can create a new cleaner pull request with the stated changes or make them in the existing one.

@amin-xiv
Copy link
Contributor Author

amin-xiv commented Nov 17, 2024

Hey @multiverseweb,
Regarding the issue that it doesn't format on save, it should actually do. I tested it by deleting prettier, then creating a new directory, cloning the branch on the new directory and doing all of the steps and it works fine. But I can provide some extra steps for it to work.

  • Try to reload the window after running npm install after downloading Prettier.
  • Wait like 30 seconds before trying to save again or less it should work.
  • Ensure that the settings.json file has the correct settings.
  • Try changing the indentation and spacing of a few lines and try to save again, it should format.

About making the root directory look less crowded, I will be changing the location of .prettierignore and .prettierrc files from root directory to the website folder in a new PR since they are only needed there.

Let me know your thoughts.

@amin-xiv amin-xiv closed this Nov 17, 2024
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.

[Website] Proposal to add Prettier to the project.
2 participants