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

chore(formatting): Apply default printWidth for JS / CSS #2648

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Oct 31, 2023

Description

  • Remove 120 char printWidth configuration in .prettierrc.json
    • excluding HTML & markdown files for now. Checking removal of these in a follow-up.
  • In parallel: use example.com for domains where possible instead of real domains

Motivation

JS and CSS examples should follow the same formatting as in mdn/content

Additional details

Types of changes and summary:

For the following files, here's my personal opinion of whether the changes are acceptable or not:

  • live-examples/css-examples/color/color-adjust.css -> not used in content
  • live-examples/css-examples/fonts/font-synthesis.css -> non-visible change
  • live-examples/css-examples/fonts/font-variant-east-asian.css -> non-visible change
  • live-examples/css-examples/fragmentation/break.js -> non-visible change
  • live-examples/css-examples/motion-path/offset-anchor.css -> non-visible change
  • live-examples/css-examples/rhythm/line-height-step.css -> non-visible change
  • live-examples/css-examples/shapes/shape-image-threshold.css -> non-visible change
  • live-examples/html-examples/content-sectioning/css/article.css -> non-visible change
  • live-examples/html-examples/forms/css/button.css -> non-visible change
  • live-examples/html-examples/global-attributes/js/attribute-is.js -> not used in content
  • live-examples/html-examples/input/css/button.css -> non-visible change
  • live-examples/js-examples/array/array-at.js -> modified to fit line wrap
  • live-examples/js-examples/array/array-filter.js -> modified to fit line wrap
  • live-examples/js-examples/array/array-reduce-right.js -> adds line breaks, neutral change
  • live-examples/js-examples/array/array-reduce.js -> adds line breaks, neutral change
  • live-examples/js-examples/bigint/bigint-asintn.js -> adds line breaks, notable improvement
  • live-examples/js-examples/bigint/bigint-tolocalestring.js -> adds line breaks, neutral change
  • live-examples/js-examples/classes/classes-extends.js -> adds line breaks, neutral change
  • live-examples/js-examples/date/date-tolocaledatestring.js -> adds line breaks, improvement
  • live-examples/js-examples/finalizationregistry/finalizationregistry.js -> modified to fit line wrap
  • live-examples/js-examples/intl/intl-collator.js -> adds line breaks, neutral change
  • live-examples/js-examples/intl/intl-datetimeformat-prototype-format.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-datetimeformat-prototype-formatrange.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-datetimeformat-prototype-formattoparts.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-datetimeformat.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-displaynames.js -> adds line breaks, neutral change
  • live-examples/js-examples/intl/intl-listformat-prototype-formattoparts.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-listformat.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-locale-prototype-tostring.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-numberformat.js -> adds line breaks, improvement
  • live-examples/js-examples/intl/intl-segmenter-prototype-segment.js -> adds line breaks, improvement
  • live-examples/js-examples/json/json-stringify.js -> adds line breaks, improvement
  • live-examples/js-examples/map/map-groupby.js -> adds line breaks, improvement
  • live-examples/js-examples/promise/promise-allsettled.js -> adds line breaks, improvement
  • live-examples/js-examples/reflect/reflect-apply.js -> adds line breaks, improvement
  • live-examples/js-examples/statement/statement-async-for-in.js -> not used in content
  • live-examples/js-examples/string/string-at.js -> modified to fit line wrap
  • live-examples/js-examples/string/string-charcodeat.js -> modified, still wraps but is acceptable
  • live-examples/js-examples/string/string-includes.js -> adds line breaks, neutral change
  • live-examples/js-examples/string/string-indexof.js -> adds line breaks, neutral change
  • live-examples/js-examples/string/string-lastindexof.js -> adds line breaks, neutral change
  • live-examples/js-examples/string/string-replace.js -> adds line breaks, neutral change
  • live-examples/js-examples/string/string-replaceall.js -> adds line breaks, neutral change
  • live-examples/js-examples/string/string-search.js -> adds line breaks, neutral change
  • live-examples/js-examples/symbol/symbol-split.js -> adds line breaks, neutral change
  • live-examples/js-examples/typedarray/typedarray-at.js -> modified to fit line wrap
  • live-examples/js-examples/typedarray/typedarray-reduceright.js -> adds line breaks, improvement
  • live-examples/js-examples/typedarray/typedarray-tolocalestring.js -> adds line breaks, improvement
  • live-examples/js-examples/weakref/weakref.js -> modified to fit line wrap
  • live-examples/wat-examples/numeric/and.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/clz.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/ctz.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/or.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/popcnt.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/rotl.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/rotr.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/shl.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/shr.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/numeric/xor.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/wat-examples/statements/block.js -> adds indentation fix, wrapping / readability improvement
  • live-examples/webapi-examples/url/url-prototype-password.js -> not used in content, using example.com domain
  • live-examples/webapi-examples/url/url-prototype-search.js -> not used in content, using example.com domain
  • live-examples/webapi-examples/url/url-prototype-searchparams.js -> not used in content, using example.com domain
  • live-examples/webapi-examples/url/url-prototype-username.js -> not used in content, using example.com domain

Related issues and pull requests

@bsmth bsmth requested review from a team as code owners October 31, 2023 10:27
@bsmth bsmth requested review from estelle, Josh-Cena, hamishwillee and dipikabh and removed request for a team October 31, 2023 10:27
Comment on lines +5 to +8
const sumWithInitial = array1.reduce(
(accumulator, currentValue) => accumulator + currentValue,
initialValue,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should fix #2632.

@@ -1,4 +1,4 @@
const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
const words = ['spray', 'elite', 'exuberant', 'destruction', 'present'];
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that I manually removed this to fit to 80 chars max line length

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.

None yet

3 participants