Skip to content

Conversation

kirkwaiblinger
Copy link
Contributor

@kirkwaiblinger kirkwaiblinger commented Mar 31, 2025

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

fixes #19589

It looks like these deprecation links were introduced in #19238.

For thoroughness, I looked through all of the deprecation URLs, and noticed that prefer-reflect had the same problem, so I changed that is well, but the rest looked good.

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 31, 2025
@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Mar 31, 2025
@github-actions github-actions bot added the rule Relates to ESLint's core rules label Mar 31, 2025
@kirkwaiblinger kirkwaiblinger changed the title fix: ensure "learn more" deprecation links point to useful resource docs: ensure "learn more" deprecation links point to useful resource Mar 31, 2025
@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Mar 31, 2025
Copy link

netlify bot commented Mar 31, 2025

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 0504805
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/67f7081c11b2b00008527165

@kirkwaiblinger kirkwaiblinger marked this pull request as ready for review March 31, 2025 18:59
@kirkwaiblinger kirkwaiblinger requested a review from a team as a code owner March 31, 2025 18:59
@amareshsm amareshsm added the accepted There is consensus among the team that this change meets the criteria for inclusion label Mar 31, 2025
@amareshsm amareshsm moved this from Needs Triage to Second Review Needed in Triage Mar 31, 2025
amareshsm
amareshsm previously approved these changes Mar 31, 2025
Copy link
Member

@amareshsm amareshsm left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

This reverts commit e6d0c70.
@kirkwaiblinger
Copy link
Contributor Author

I'm not sure exactly how the website generated files are supposed to work. Running npm run build:site commits my absolute path, which is surely wrong, see e6d0c70. But without it CI won't build the deploy preview because it thinks nothing has changed.

@amareshsm amareshsm moved this from Second Review Needed to Implementing in Triage Mar 31, 2025
@amareshsm
Copy link
Member

I'm not sure exactly how the website generated files are supposed to work. Running npm run build:site commits my absolute path, which is surely wrong, see e6d0c70. But without it CI won't build the deploy preview because it thinks nothing has changed.

The command you need to use is build:rules-index.

@kirkwaiblinger
Copy link
Contributor Author

@amareshsm Ah, great, thanks! It looks like there's a few unrelated changes in the rules_meta file, I'm guessing this just didn't synced in a previous commit.

message:
"The original assumption of the rule no longer holds true because of engine optimization.",
url: "https://eslint.org/docs/latest/rules/no-return-await",
url: "https://github.com/eslint/eslint/issues/17345",
Copy link
Member

Choose a reason for hiding this comment

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

This was a link to the docs page for this rule because the explanation of the deprecation is on that page. It just looks weird when the URL is used from the page itself. Maybe we could add logic to hide the "Learn more" link in these cases?

(the same for prefer-reflect).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Slight pushback - personally, the reason I clicked the "learn more" link is exactly because I was looking for the deprecation issue (#17345), which contains much more info than the the rule page. So I find the deprecation issue quite a bit more useful than no link to "learn more" at.

But I'll look into the hiding the link unless I hear otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

I think most people would prefer to see a summary rather than search through the issue discussions to understand the reasons. Perhaps we could add a link to the issue on the rule page? (and keep this URL and hide "Learn more").

@nzakas what do you think?

Copy link
Contributor Author

@kirkwaiblinger kirkwaiblinger Apr 1, 2025

Choose a reason for hiding this comment

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

Is the deprecation url used somewhere other than the rule page?

Copy link
Member

Choose a reason for hiding this comment

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

Is the deprecation url used somewhere other than the rule page?

I believe we're not using it anywhere else in eslint, but since it's in rule meta, it can be used in other tools (e.g., IDEs).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. For now implemented it such that the link is optional... I'd think if tooling consumes it, they can reasonably default it with deprecated.url ?? docs.url.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure people care why a rule was deprecated in most cases. If there's a notable reason why it was deprecated then I think that should go directly into the documentation page. In either case, "Learn More" isn't needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to be sure we're aligned, is the solution of omitting deprecated.url satisfactory, or is there a different action requested?

mdjermanovic
mdjermanovic previously approved these changes Apr 4, 2025
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Would like a second review before merging.

Co-authored-by: Francesco Trotta <[email protected]>
Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@fasttime fasttime merged commit 865dbfe into eslint:main Apr 10, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Apr 10, 2025
@kirkwaiblinger kirkwaiblinger deleted the 19589-fix-learn-more-links branch April 10, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly documentation Relates to ESLint's documentation rule Relates to ESLint's core rules

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Docs: [no-return-await] "learn more" deprecation link just links to current page

5 participants