Skip to content

HDDS-9570. [Website v2] Integrate eslint and run it in github actions#307

Closed
yuriipalam wants to merge 6 commits intoapache:HDDS-9225-website-v2from
yuriipalam:HDDS-9570
Closed

HDDS-9570. [Website v2] Integrate eslint and run it in github actions#307
yuriipalam wants to merge 6 commits intoapache:HDDS-9225-website-v2from
yuriipalam:HDDS-9570

Conversation

@yuriipalam
Copy link
Contributor

@yuriipalam yuriipalam commented Jan 30, 2026

What changes were proposed in this pull request?

Integrate ESLint and Prettier into the project, updated the CI respectively.

ESLint is a static code analyzer, so now we have analyzer during the development.
Prettier is a formatting tool, so the code style is consistent across the files.

Both tools were integrated, as well as relevant extensions to them, e.g., Docusaurus ESLint plugin
They were also added to the CI pipeline, so they run in github actions.

Fixed all the issues that the code analyzers found.

Introduced new commands:

  • pnpm run lint runs checks only (no files are modified).
  • pnpm run lint:fix applies auto-fixes from ESLint, markdownlint, and Prettier.

In the project we also have markdownlint, but it has a conflict rule with Prettier. Prettier uses _underscores_ for emphasis, while markdownlint is configured to require *asterisks*. To keep markdownlint as the source of truth for Markdown emphasis, we run markdownlint after Prettier.

Strongly recommend you to check eslint.config.mjs, since it sets up the code rules for the project. I also added a custom rule that enforces the license header.

I also updated CONTRIBUTE.MD accordingly, the "Quick Start" and a new "Linting and Formatting" sections.

What is the link to the Apache Jira?

HDDS-9570

How was this patch tested?

Check off which of the following tests were done on this change. If additional testing was done, please elaborate here as well.

  • The CI checks on my fork are passing
  • I verified the rendered content using a local preview
  • I manually verified the steps provided in this change work as described

Copy link
Contributor

@errose28 errose28 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @yuriipalam. Can we do these changes incrementally? Between prettier, eslint, and markdownlint, it's difficult to figure which one is responsible for which changes. Let's make this three PRs:

  • First PR to add lint and lint:fix commands for existing linting checks from markdownlint and yamllint.
    • This shouldn't require reformatting any website content since these checks are being run already.
  • Second PR to add eslint and its docusaurus plugin to this command.
    • lint:fix will need to be run to commit any violations in existing javascript.
  • Third PR to add prettier
    • I'm currently not sure that prettier is providing us much benefit on top of the other two changes so it would be good to see the affects of this isolated to their own PR.

@yuriipalam
Copy link
Contributor Author

Thanks for the review @errose28

Sure, we can do that.

In my opinion, Prettier does provide us much benefit, especially when it comes to markdown formatting. We have markdownlint, but it doesn't format the markdown files, rather analyzes for errors/structure issues. With prettier we can actually standardize the formatting across all markdown files in the project.

For example, tables formatting:

Before

|Name|Age|City|
|--|---|----|
|Alice|25|Berlin|
|Bob|3|NY|

After

| Name  | Age | City   |
| ----- | --- | ------ |
| Alice | 25  | Berlin |
| Bob   | 3   | NY     |

And there are much more examples which can be seen in the updated markdown files.

@errose28
Copy link
Contributor

errose28 commented Feb 2, 2026

Sounds good, thanks for starting to split this into smaller PRs. I'm going to close this for now since we are continuing reviews in #318, but the changes will still be here for reference.

@errose28 errose28 closed this Feb 2, 2026
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.

2 participants