Skip to content

Commit

Permalink
Support max_line_length=off when parsing .editorconfig (prettier#…
Browse files Browse the repository at this point in the history
…14516)

This fixes prettier#14514 by
upgrading `editorconfig-to-prettier` with the fix from josephfrazier/editorconfig-to-prettier#10
  • Loading branch information
josephfrazier authored and medikoo committed Jan 4, 2024
1 parent 165d0da commit 5e0b26e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
21 changes: 21 additions & 0 deletions 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).

<!-- prettier-ignore -->
```html
<!-- Input -->
<div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}/>

<!-- Prettier stable -->
<div
className="HelloWorld"
title={`You are visitor number ${num}`}
onMouseOver={onMouseOver}
/>;

<!-- Prettier main -->
<div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver} />;
```
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -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"
Expand Down

0 comments on commit 5e0b26e

Please sign in to comment.