From e7b383b570db0f5b792887aa87e7b090f43125cb Mon Sep 17 00:00:00 2001 From: Joseph Frazier <1212jtraceur@gmail.com> Date: Sat, 18 Mar 2023 12:55:30 -0400 Subject: [PATCH] Support `max_line_length=off` when parsing `.editorconfig` (#14516) This fixes https://github.com/prettier/prettier/issues/14514 by upgrading `editorconfig-to-prettier` with the fix from https://github.com/josephfrazier/editorconfig-to-prettier/pull/10 --- changelog_unreleased/misc/14516.md | 21 +++++++++++++++++++++ package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 changelog_unreleased/misc/14516.md diff --git a/changelog_unreleased/misc/14516.md b/changelog_unreleased/misc/14516.md new file mode 100644 index 000000000000..e05195a64298 --- /dev/null +++ b/changelog_unreleased/misc/14516.md @@ -0,0 +1,21 @@ +#### Support `max_line_length=off` when parsing `.editorconfig` (#14516 by @josephfrazier) + +If an .editorconfig file is in your project and it sets `max_line_length=off` for the file you're formatting, +it will be interpreted as a `printWidth` of `Infinity` rather than being ignored +(which previously resulted in the default `printWidth` of 80 being applied, if not overridden by Prettier-specific configuration). + + +```html + +
+ + +
; + + +
; +``` diff --git a/package.json b/package.json index 2dc3c339bb08..f117713ee841 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "dashify": "2.0.0", "diff": "5.0.0", "editorconfig": "0.15.3", - "editorconfig-to-prettier": "0.2.0", + "editorconfig-to-prettier": "1.0.0", "escape-string-regexp": "5.0.0", "espree": "9.4.1", "esutils": "2.0.3", diff --git a/yarn.lock b/yarn.lock index 420681276328..2d4857916544 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2917,10 +2917,10 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" -editorconfig-to-prettier@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/editorconfig-to-prettier/-/editorconfig-to-prettier-0.2.0.tgz#db4f4e96796c746673c863ccac881377ea83dbe8" - integrity sha512-tOcbAuPyYE9zOA1HF2xI9Xqm2TW7BE9E2lhwbz69ngtaJrBWQwL6akzyWA+UPx8jRss91KXMChyjHNpqaYFWuQ== +editorconfig-to-prettier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/editorconfig-to-prettier/-/editorconfig-to-prettier-1.0.0.tgz#f2bccca5877be9dea8a8022b93bcc6aba582a31c" + integrity sha512-WkBQRWxQOat9zBBhrnV0eoCRRMj0fMc/OIwTs+R3pvjsBD2fhTjGLLToGwalUwug3L5K4NvTTMfVRRHT6Hmorg== editorconfig@0.15.3: version "0.15.3"