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

Support max_line_length=off when parsing .editorconfig #14516

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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