11ty / 11ty-website

Documentation site for the Eleventy static site generator.
https://www.11ty.dev/
MIT License
473 stars 680 forks source link

Update Prettier & EditorConfig files #1651

Open uncenter opened 9 months ago

uncenter commented 9 months ago

Closes #1610.

uncenter commented 9 months ago

I won't format the files in this PR to avoid conflicts, but we should run the command at some point...

uncenter commented 9 months ago

Also do you know whether or not this is run on any git hooks (this might lead to issues until all files in the repo are formatted)?

I don't really understand or use Git hooks but it looks to be the case:

  "lint-staged": {
    "*.{js,css,md}": [
      "prettier --write",
      "git add"
    ]
  },

I chose to avoid formatting it here because a) the diff is huge, +-30k lines, and b) I don't want to block other PRs.

Did you try running this and see if it has problems with the autogenerated files?

What do you mean by autogenerated files? If there are any we can just add them to a .prettierignore. There are some files that Prettier struggles with, quite understandably though:

Screenshot 2024-01-11 at 10 02 40 (Visual Studio Code)

That seems like an interesting approach to whatever that is!

Snapstromegon commented 9 months ago

What do you mean by autogenerated files?

The files in https://github.com/11ty/11ty-website/tree/main/src/_data/community are generated by a GH action from the "Build With 11ty" issues.

uncenter commented 9 months ago

Ah, strange. Well, we can just run the format command after that step in the workflow.

uncenter commented 9 months ago

...where is that workflow?

uncenter commented 9 months ago

I think you are confusing this repo with https://github.com/11ty/11ty-community/tree/main/built-with-eleventy maybe?

Snapstromegon commented 9 months ago

I think you are confusing this repo with https://github.com/11ty/11ty-community/tree/main/built-with-eleventy maybe?

Ah yes, my mistake

uncenter commented 9 months ago

Is there anything else I need to do for this PR? I've ignored that one directory I mentioned that Prettier didn't like, so the command passes now.

uncenter commented 9 months ago

FYI, the formatting config files (.prettierrc.json, .editorconfig) that I've included here are directly copied from the core @11ty/eleventy repository. So there isn't anything Zach hasn't already approved, technically.

Snapstromegon commented 9 months ago

I think that these configs have to be seen in the context of a project/repo. E.g. editorconfig settings can vary depending on the project. I do not expect Zach to oppose this change, but it makes me more comfortable to have his approval for now.

uncenter commented 4 weeks ago

@zachleat would you be able to take a look at this? Have some small & incremental improvements in mind for the docs that I'd love to test out but I'd like to have uniform formatting to make for minimal diffs if possible.

uncenter commented 4 weeks ago

FYI - I've just gone through and compared each of the modified/related files to formatting in this branch and the main branch of the 11ty/eleventy repo and they are (still) consistent.