Skip to content

Change Request: autoformat docs #17504

@Zamiell

Description

@Zamiell

What problem do you want to solve?

In my last PR, I noticed that the documentation rules pages (i.e. Markdown) have inconsistent formatting. Rules randomly have either 1, 2, 3, or 5 newlines after the frontmatter.

This kind of thing is sloppy, and makes it more difficult for people to contribute, as it makes finding the proper style non-trivial.

One option I considered was to inquire about the correct number of newlines in this situation, and then do another PR to standardize it. But personally, it seems much more productive to simply propose that the docs be autoformatted, which would automatically solve this issue and related issues without having to waste time discussing trivial formatting.

Note that I am only proposing that Markdown files are auto-formatted, not all of the JavaScript. (Which would obviously be a more controversial proposal.)

The two most popular solutions in this space seem to be using Prettier or dprint. (While both are primarily code formatters, they also auto-format Markdown documents.) For example, I believe that typescript-eslint project uses Prettier for this purpose.

Participation

  • I am willing to submit a pull request for this change.
    (But this is probably something that should be done by a core maintainer, since it involves e.g. editing CI.)

Metadata

Metadata

Assignees

Labels

coreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions