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

📝 Graphql """strings""" get formatted with dodgy line breaks on Windows/CRLF #4413

Closed
1 task done
jwhitaker-gridcog opened this issue Oct 29, 2024 · 2 comments · Fixed by #4527
Closed
1 task done
Labels
A-Formatter Area: formatter L-GraphQL Language GraphQL S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@jwhitaker-gridcog
Copy link

jwhitaker-gridcog commented Oct 29, 2024

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.19.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/9.10.0"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Formatter:
  Format with errors:           false
  Indent style:                 Space
  Indent width:                 2
  Line ending:                  Lf
  Line width:                   80
  Attribute position:           Auto
  Bracket spacing:              BracketSpacing(true)
  Ignore:                       []
  Include:                      []

JavaScript Formatter:
  Enabled:                      false
  JSX quote style:              Double
  Quote properties:             AsNeeded
  Trailing commas:              All
  Semicolons:                   Always
  Arrow parentheses:            Always
  Bracket spacing:              BracketSpacing(true)
  Bracket same line:            false
  Quote style:                  Single
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           Auto

JSON Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset

CSS Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Quote style:                  Double

GraphQL Formatter:
  Enabled:                      false
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Bracket spacing:              unset
  Quote style:                  unset

Workspace:
  Open Documents:               0

Configuration

{
	"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
	"organizeImports": {
		"enabled": true
	},
	"linter": {
		"enabled": true,
		"rules": {
			"recommended": true
		}
	},
	"formatter": {
		"lineEnding": "crlf"
	}
}

Playground link

https://github.com/jwhitaker-gridcog/biome-repro-1730160752127

Words

When formatting a graphql file with CRLF line endings, Biome inserts an extra line into multiline strings:

image

In the repro, I've set gitattributes with eol=crlf AND deliberately commited a crlf file to the repo. This is just to make it easier for you to examine. This issue appears with normal lf endings for all Windows users if they have core.autocrlf = true (which is normally the case).

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@jwhitaker-gridcog jwhitaker-gridcog added the S-Needs triage Status: this issue needs to be triaged label Oct 29, 2024
@ematipico ematipico added A-Formatter Area: formatter S-Bug-confirmed Status: report has been confirmed as a valid bug L-GraphQL Language GraphQL and removed S-Needs triage Status: this issue needs to be triaged labels Nov 6, 2024
@ematipico
Copy link
Member

cc @denbezrukov @vohoanglong0107

@jwhitaker-gridcog
Copy link
Author

Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-GraphQL Language GraphQL S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants