Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: array-reduce requiring horizontal scrolling #2633

Closed
wants to merge 3 commits into from
Closed

fix: array-reduce requiring horizontal scrolling #2633

wants to merge 3 commits into from

Conversation

hamirmahal
Copy link
Contributor

fixes #2632.

@hamirmahal hamirmahal requested a review from a team as a code owner October 11, 2023 20:11
@hamirmahal hamirmahal requested review from teoli2003 and removed request for a team October 11, 2023 20:11
@hamirmahal
Copy link
Contributor Author

Without this change

1680x1050

@hamirmahal
Copy link
Contributor Author

With this change (presumably)

printWidth100

@hamirmahal
Copy link
Contributor Author

// so we can extend this repository's default `prettier` configuration.
module.exports = {
...require('../../../.prettierrc.json'),
printWidth: 100,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
printWidth: 100,
// This prevented at least one example from requiring horizontal scrolling.
printWidth: 100,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be worth documenting why we're overriding the base prettier config.

Copy link
Member

@bsmth bsmth Oct 27, 2023

Choose a reason for hiding this comment

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

So it appears I set the print width to 120 which might not even be desirable overall. It looks like the original objection to 80 as a print width was for changes in an .md file (which we can maybe handle with overrides?), not a code example. It might be worth considering getting rid of the printWidth key altogether and using the default which is what we use in content with overrides for html/md. We should check how many files this changes though

edit: It might be good to change the base config only. This is a neat approach, adding an overriding config in a subdir, but it might get confusing with separate config files dotted through the source like this.

@yishengjiang99

This comment was marked as off-topic.

@bsmth
Copy link
Member

bsmth commented Nov 1, 2023

Thanks @hamirmahal - should be fixed now in #2648 🙌🏻

@bsmth bsmth closed this Nov 1, 2023
@hamirmahal
Copy link
Contributor Author

You're welcome, @bsmth! Thanks for the fix.

@hamirmahal hamirmahal deleted the fix/array-reduce-example-not-fitting-in-demo-section branch November 2, 2023 09:01
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.

Array.prototype.reduce() demo requires horizontal scrolling
3 participants