Skip to content

Update bad-min-max-func.md#317

Closed
Sheraff wants to merge 1 commit intooxc-project:mainfrom
Sheraff:patch-1
Closed

Update bad-min-max-func.md#317
Sheraff wants to merge 1 commit intooxc-project:mainfrom
Sheraff:patch-1

Conversation

@Sheraff
Copy link

@Sheraff Sheraff commented Mar 14, 2025

I think there's a typo in this rule's explanation. A correct clamp should have the upper bound in the min call, and the lower bound in the max call.


This PR updates the .md file directly, but I just realized that there is a code comment very similar to this .md file directly in the rule's source

https://github.com/oxc-project/oxc/blob/b9ab60bde696d2742d3c5781084ee3c7bb99821e/crates/oxc_linter/src/rules/oxc/bad_min_max_func.rs#L22-L51

Is there some some automated build step that extracts those code comment into this .md file? (In which case my change would get overwritten and I should actually change the code comment instead).

@netlify
Copy link

netlify bot commented Mar 14, 2025

Deploy Preview for oxc-project ready!

Name Link
🔨 Latest commit ad87a69
🔍 Latest deploy log https://app.netlify.com/sites/oxc-project/deploys/67d488180aad3f0008bf3d74
😎 Deploy Preview https://deploy-preview-317--oxc-project.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.

@camchenry
Copy link
Member

@Sheraff You're correct: there is automation that generates the website's documentation directly from the source. This file is autogenerated, so you'll need to update it here directly: https://github.com/oxc-project/oxc/blob/22f18ac144ed79aad0172bf7040d4815dcdf34cc/crates/oxc_linter/src/rules/oxc/bad_min_max_func.rs#L22-L51. The changes will appear on the website with the next oxlint release after it is merged.

@Sheraff
Copy link
Author

Sheraff commented Mar 14, 2025

Thanks for the clarification. Here's the correct change then oxc-project/oxc#9791

@Sheraff Sheraff deleted the patch-1 branch March 14, 2025 21:05
shulaoda pushed a commit to oxc-project/oxc that referenced this pull request Mar 14, 2025
I think there's a typo in this rule's explanation. A correct clamp
should have the upper bound in the min call, and the lower bound in the
max call.

I initially opened a PR directly on the .md file but it turns out to be
generated from source
oxc-project/website#317
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