diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bb80042a7c1..f64c3d32f79e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom ### Formatter +#### New features + +- Add a new option [`--line-ending`](https://biomejs.dev/reference/configuration/#formatterlineending). This option allows changing the type of line endings. Contributed by @SuperchupuDev + #### Bug fixes - Fix [#301](https://github.com/biomejs/biome/issues/301), the formatter should not break before the `in` keyword. Contributed by @ematipico diff --git a/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap b/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap index 39624fcafe4a..62196411ca6c 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap @@ -26,6 +26,7 @@ The configuration that is contained inside the file `biome.json` --indent-style= The indent style. --indent-size=NUMBER The size of the indentation, 2 by default (deprecated, use `indent-width`) --indent-width=NUMBER The size of the indentation, 2 by default + --line-ending= The type of line ending. --line-width=NUMBER What's the max width of a line. Defaults to 80. --quote-style= The type of quotes used in JavaScript code. Defaults to double. --jsx-quote-style= The type of quotes used in JSX. Defaults to double. @@ -44,7 +45,9 @@ The configuration that is contained inside the file `biome.json` (and its super languages) files. Default to 2. --javascript-formatter-indent-width=NUMBER The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. - --javascript-formatter-line-width=NUMBER What's the max width of a line, applied to JavaScript + --javascript-formatter-line-ending= The type of line ending applied to JavaScript + (and its super languages) files. + --javascript-formatter-line-width=NUMBER What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. --json-formatter-enabled= Control the formatter for JSON (and its super languages) files. @@ -54,8 +57,10 @@ The configuration that is contained inside the file `biome.json` languages) files. Default to 2. --json-formatter-indent-size=NUMBER The size of the indentation applied to JSON (and its super languages) files. Default to 2. - --json-formatter-line-width=NUMBER What's the max width of a line, applied to JSON (and its - super languages) files. Defaults to 80. + --json-formatter-line-ending= The type of line ending applied to JSON (and its super + languages) files. + --json-formatter-line-width=NUMBER What's the max width of a line applied to JSON (and its super + languages) files. Defaults to 80. Global options applied to all commands --colors= Set the formatting mode for markup: "off" prints everything as plain text, diff --git a/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap b/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap index 6b0140c8b0e5..c809f32b6cf5 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap @@ -28,6 +28,7 @@ The configuration that is contained inside the file `biome.json` --indent-style= The indent style. --indent-size=NUMBER The size of the indentation, 2 by default (deprecated, use `indent-width`) --indent-width=NUMBER The size of the indentation, 2 by default + --line-ending= The type of line ending. --line-width=NUMBER What's the max width of a line. Defaults to 80. --quote-style= The type of quotes used in JavaScript code. Defaults to double. --jsx-quote-style= The type of quotes used in JSX. Defaults to double. @@ -46,7 +47,9 @@ The configuration that is contained inside the file `biome.json` (and its super languages) files. Default to 2. --javascript-formatter-indent-width=NUMBER The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. - --javascript-formatter-line-width=NUMBER What's the max width of a line, applied to JavaScript + --javascript-formatter-line-ending= The type of line ending applied to JavaScript + (and its super languages) files. + --javascript-formatter-line-width=NUMBER What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. --json-formatter-enabled= Control the formatter for JSON (and its super languages) files. @@ -56,8 +59,10 @@ The configuration that is contained inside the file `biome.json` languages) files. Default to 2. --json-formatter-indent-size=NUMBER The size of the indentation applied to JSON (and its super languages) files. Default to 2. - --json-formatter-line-width=NUMBER What's the max width of a line, applied to JSON (and its - super languages) files. Defaults to 80. + --json-formatter-line-ending= The type of line ending applied to JSON (and its super + languages) files. + --json-formatter-line-width=NUMBER What's the max width of a line applied to JSON (and its super + languages) files. Defaults to 80. Global options applied to all commands --colors= Set the formatting mode for markup: "off" prints everything as plain text, diff --git a/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap b/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap index ab3bc4886e43..41228e0ed607 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap @@ -13,6 +13,7 @@ Generic options applied to all files --indent-style= The indent style. --indent-size=NUMBER The size of the indentation, 2 by default (deprecated, use `indent-width`) --indent-width=NUMBER The size of the indentation, 2 by default + --line-ending= The type of line ending. --line-width=NUMBER What's the max width of a line. Defaults to 80. Formatting options specific to the JavaScript files @@ -33,7 +34,9 @@ Formatting options specific to the JavaScript files (and its super languages) files. Default to 2. --javascript-formatter-indent-width=NUMBER The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. - --javascript-formatter-line-width=NUMBER What's the max width of a line, applied to JavaScript + --javascript-formatter-line-ending= The type of line ending applied to JavaScript + (and its super languages) files. + --javascript-formatter-line-width=NUMBER What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. Set of properties to integrate Biome with a VCS software. @@ -90,8 +93,10 @@ Available options: languages) files. Default to 2. --json-formatter-indent-size=NUMBER The size of the indentation applied to JSON (and its super languages) files. Default to 2. - --json-formatter-line-width=NUMBER What's the max width of a line, applied to JSON (and its - super languages) files. Defaults to 80. + --json-formatter-line-ending= The type of line ending applied to JSON (and its super + languages) files. + --json-formatter-line-width=NUMBER What's the max width of a line applied to JSON (and its super + languages) files. Defaults to 80. --stdin-file-path=PATH Use this option when you want to format code piped from `stdin`, and print the output to `stdout`. The file doesn't need to exist on disk, what matters is the extension of diff --git a/crates/biome_formatter/src/format_element/document.rs b/crates/biome_formatter/src/format_element/document.rs index cd7a765c84b8..33d2c1055c96 100644 --- a/crates/biome_formatter/src/format_element/document.rs +++ b/crates/biome_formatter/src/format_element/document.rs @@ -2,11 +2,10 @@ use super::tag::Tag; use crate::format_element::tag::DedentMode; use crate::prelude::tag::GroupMode; use crate::prelude::*; -use crate::printer::LineEnding; use crate::{format, write}; use crate::{ BufferExtensions, Format, FormatContext, FormatElement, FormatOptions, FormatResult, Formatter, - IndentStyle, IndentWidth, LineWidth, PrinterOptions, TransformSourceMap, + IndentStyle, IndentWidth, LineEnding, LineWidth, PrinterOptions, TransformSourceMap, }; use biome_rowan::TextSize; use rustc_hash::FxHashMap; @@ -163,11 +162,15 @@ impl FormatOptions for IrFormatOptions { LineWidth::default() } + fn line_ending(&self) -> LineEnding { + LineEnding::Lf + } + fn as_print_options(&self) -> PrinterOptions { PrinterOptions { indent_width: self.indent_width(), print_width: self.line_width().into(), - line_ending: LineEnding::LineFeed, + line_ending: LineEnding::Lf, indent_style: IndentStyle::Space, } } diff --git a/crates/biome_formatter/src/lib.rs b/crates/biome_formatter/src/lib.rs index e3ff034eecbc..c9a6330605cf 100644 --- a/crates/biome_formatter/src/lib.rs +++ b/crates/biome_formatter/src/lib.rs @@ -52,7 +52,7 @@ use crate::printed_tokens::PrintedTokens; use crate::printer::{Printer, PrinterOptions}; pub use arguments::{Argument, Arguments}; use biome_deserialize::{ - Deserializable, DeserializableValue, DeserializationDiagnostic, TextNumber, + Deserializable, DeserializableValue, DeserializationDiagnostic, Text, TextNumber, }; pub use buffer::{ Buffer, BufferExtensions, BufferSnapshot, Inspect, PreambleBuffer, RemoveSoftLinesBuffer, @@ -125,6 +125,96 @@ impl std::fmt::Display for IndentStyle { } } +#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)] +#[cfg_attr( + feature = "serde", + derive(serde::Serialize, serde::Deserialize, schemars::JsonSchema), + serde(rename_all = "camelCase") +)] +#[derive(Default)] +pub enum LineEnding { + /// Line Feed only (\n), common on Linux and macOS as well as inside git repos + #[default] + Lf, + + /// Carriage Return + Line Feed characters (\r\n), common on Windows + Crlf, + + /// Carriage Return character only (\r), used very rarely + Cr, +} + +impl LineEnding { + #[inline] + pub const fn as_str(&self) -> &'static str { + match self { + LineEnding::Lf => "\n", + LineEnding::Crlf => "\r\n", + LineEnding::Cr => "\r", + } + } + + /// Returns `true` if this is a [LineEnding::Lf]. + pub const fn is_line_feed(&self) -> bool { + matches!(self, LineEnding::Lf) + } + + /// Returns `true` if this is a [LineEnding::Crlf]. + pub const fn is_carriage_return_line_feed(&self) -> bool { + matches!(self, LineEnding::Crlf) + } + + /// Returns `true` if this is a [LineEnding::Cr]. + pub const fn is_carriage_return(&self) -> bool { + matches!(self, LineEnding::Cr) + } +} + +impl FromStr for LineEnding { + type Err = &'static str; + + fn from_str(s: &str) -> Result { + match s { + "lf" => Ok(Self::Lf), + "crlf" => Ok(Self::Crlf), + "cr" => Ok(Self::Cr), + // TODO: replace this error with a diagnostic + _ => Err("Value not supported for LineEnding"), + } + } +} + +impl std::fmt::Display for LineEnding { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + LineEnding::Lf => std::write!(f, "LF"), + LineEnding::Crlf => std::write!(f, "CRLF"), + LineEnding::Cr => std::write!(f, "CR"), + } + } +} + +impl Deserializable for LineEnding { + fn deserialize( + value: &impl DeserializableValue, + name: &str, + diagnostics: &mut Vec, + ) -> Option { + let value_text = Text::deserialize(value, name, diagnostics)?; + if let Ok(value) = value_text.parse::() { + Some(value) + } else { + const ALLOWED_VARIANTS: &[&str] = &["lf", "crlf", "cr"]; + diagnostics.push(DeserializationDiagnostic::new_unknown_value( + &value_text, + value.range(), + ALLOWED_VARIANTS, + )); + None + } + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[cfg_attr( feature = "serde", @@ -292,6 +382,9 @@ pub trait FormatOptions { /// What's the max width of a line. Defaults to 80. fn line_width(&self) -> LineWidth; + /// The type of line ending. + fn line_ending(&self) -> LineEnding; + /// Derives the print options from the these format options fn as_print_options(&self) -> PrinterOptions; } @@ -339,6 +432,7 @@ pub struct SimpleFormatOptions { pub indent_style: IndentStyle, pub indent_width: IndentWidth, pub line_width: LineWidth, + pub line_ending: LineEnding, } impl FormatOptions for SimpleFormatOptions { @@ -354,11 +448,16 @@ impl FormatOptions for SimpleFormatOptions { self.line_width } + fn line_ending(&self) -> LineEnding { + self.line_ending + } + fn as_print_options(&self) -> PrinterOptions { PrinterOptions::default() .with_indent_style(self.indent_style) .with_indent_width(self.indent_width) .with_print_width(self.line_width.into()) + .with_line_ending(self.line_ending) } } diff --git a/crates/biome_formatter/src/printer/mod.rs b/crates/biome_formatter/src/printer/mod.rs index 0a8962f22ce3..864ca0749338 100644 --- a/crates/biome_formatter/src/printer/mod.rs +++ b/crates/biome_formatter/src/printer/mod.rs @@ -1260,7 +1260,8 @@ struct FitsState { #[cfg(test)] mod tests { use crate::prelude::*; - use crate::printer::{LineEnding, PrintWidth, Printer, PrinterOptions}; + use crate::printer::{PrintWidth, Printer, PrinterOptions}; + use crate::LineEnding; use crate::{format_args, write, Document, FormatState, IndentStyle, Printed, VecBuffer}; fn format(root: &dyn Format) -> Printed { @@ -1269,6 +1270,7 @@ mod tests { PrinterOptions { indent_style: IndentStyle::Space, indent_width: 2.into(), + line_ending: LineEnding::Lf, ..PrinterOptions::default() }, ) @@ -1331,7 +1333,7 @@ a"#, #[test] fn it_converts_line_endings() { let options = PrinterOptions { - line_ending: LineEnding::CarriageReturnLineFeed, + line_ending: LineEnding::Crlf, ..PrinterOptions::default() }; diff --git a/crates/biome_formatter/src/printer/printer_options/mod.rs b/crates/biome_formatter/src/printer/printer_options/mod.rs index bd270212eddc..0597a009ebf4 100644 --- a/crates/biome_formatter/src/printer/printer_options/mod.rs +++ b/crates/biome_formatter/src/printer/printer_options/mod.rs @@ -1,4 +1,4 @@ -use crate::{FormatOptions, IndentStyle, IndentWidth, LineWidth}; +use crate::{FormatOptions, IndentStyle, IndentWidth, LineEnding, LineWidth}; /// Options that affect how the [crate::Printer] prints the format tokens #[derive(Clone, Debug, Eq, PartialEq)] @@ -53,6 +53,7 @@ where .with_indent_style(options.indent_style()) .with_indent_width(options.indent_width()) .with_print_width(options.line_width().into()) + .with_line_ending(options.line_ending()) } } @@ -74,6 +75,12 @@ impl PrinterOptions { self } + pub fn with_line_ending(mut self, line_ending: LineEnding) -> Self { + self.line_ending = line_ending; + + self + } + pub(crate) fn indent_style(&self) -> IndentStyle { self.indent_style } @@ -82,29 +89,10 @@ impl PrinterOptions { pub(super) const fn indent_width(&self) -> IndentWidth { self.indent_width } -} -#[allow(dead_code)] -#[derive(Clone, Debug, Eq, PartialEq)] -pub enum LineEnding { - /// Line Feed only (\n), common on Linux and macOS as well as inside git repos - LineFeed, - - /// Carriage Return + Line Feed characters (\r\n), common on Windows - CarriageReturnLineFeed, - - /// Carriage Return character only (\r), used very rarely - CarriageReturn, -} - -impl LineEnding { - #[inline] - pub const fn as_str(&self) -> &'static str { - match self { - LineEnding::LineFeed => "\n", - LineEnding::CarriageReturnLineFeed => "\r\n", - LineEnding::CarriageReturn => "\r", - } + #[allow(dead_code)] + pub(super) const fn line_ending(&self) -> LineEnding { + self.line_ending } } @@ -114,7 +102,7 @@ impl Default for PrinterOptions { indent_width: 2.into(), print_width: PrintWidth::default(), indent_style: Default::default(), - line_ending: LineEnding::LineFeed, + line_ending: LineEnding::Lf, } } } diff --git a/crates/biome_formatter_test/src/spec.rs b/crates/biome_formatter_test/src/spec.rs index 968e093e043e..e0d08edb9a46 100644 --- a/crates/biome_formatter_test/src/spec.rs +++ b/crates/biome_formatter_test/src/spec.rs @@ -220,10 +220,20 @@ where .deserialize_format_options(options_path.get_buffer_from_file().as_str()); for (index, options) in test_options.into_iter().enumerate() { - let (output_code, printed) = self.formatted(&parsed, options.clone()); + let (mut output_code, printed) = self.formatted(&parsed, options.clone()); let max_width = options.line_width().get() as usize; + // There are some logs that print different line endings, and we can't snapshot those + // otherwise we risk automatically having them replaced with LF by git. + // + // This is a workaround, and it might not work for all cases. + const CRLF_PATTERN: &str = "\r\n"; + const CR_PATTERN: &str = "\r"; + output_code = output_code + .replace(CRLF_PATTERN, "\n") + .replace(CR_PATTERN, "\n"); + snapshot_builder = snapshot_builder .with_output_and_options( SnapshotOutput::new(&output_code).with_index(index + 2), diff --git a/crates/biome_js_formatter/src/context.rs b/crates/biome_js_formatter/src/context.rs index 0cc0d0a1266b..f49e33f8a152 100644 --- a/crates/biome_js_formatter/src/context.rs +++ b/crates/biome_js_formatter/src/context.rs @@ -5,7 +5,7 @@ use biome_formatter::printer::PrinterOptions; use biome_formatter::token::string::Quote; use biome_formatter::{ CstFormatContext, FormatContext, FormatElement, FormatOptions, IndentStyle, IndentWidth, - LineWidth, TransformSourceMap, + LineEnding, LineWidth, TransformSourceMap, }; use biome_js_syntax::{AnyJsFunctionBody, JsFileSource, JsLanguage}; use std::fmt; @@ -138,6 +138,9 @@ pub struct JsFormatOptions { /// The indent width. indent_width: IndentWidth, + /// The type of line ending. + line_ending: LineEnding, + /// What's the max width of a line. Defaults to 80. line_width: LineWidth, @@ -169,6 +172,7 @@ impl JsFormatOptions { source_type, indent_style: IndentStyle::default(), indent_width: IndentWidth::default(), + line_ending: LineEnding::default(), line_width: LineWidth::default(), quote_style: QuoteStyle::default(), jsx_quote_style: QuoteStyle::default(), @@ -194,6 +198,11 @@ impl JsFormatOptions { self } + pub fn with_line_ending(mut self, line_ending: LineEnding) -> Self { + self.line_ending = line_ending; + self + } + pub fn with_line_width(mut self, line_width: LineWidth) -> Self { self.line_width = line_width; self @@ -236,6 +245,10 @@ impl JsFormatOptions { self.indent_width = indent_width; } + pub fn set_line_ending(&mut self, line_ending: LineEnding) { + self.line_ending = line_ending; + } + pub fn set_line_width(&mut self, line_width: LineWidth) { self.line_width = line_width; } @@ -306,6 +319,10 @@ impl FormatOptions for JsFormatOptions { self.line_width } + fn line_ending(&self) -> LineEnding { + self.line_ending + } + fn as_print_options(&self) -> PrinterOptions { PrinterOptions::from(self) } @@ -315,6 +332,7 @@ impl fmt::Display for JsFormatOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { writeln!(f, "Indent style: {}", self.indent_style)?; writeln!(f, "Indent width: {}", self.indent_width.value())?; + writeln!(f, "Line ending: {}", self.line_ending)?; writeln!(f, "Line width: {}", self.line_width.get())?; writeln!(f, "Quote style: {}", self.quote_style)?; writeln!(f, "JSX quote style: {}", self.jsx_quote_style)?; diff --git a/crates/biome_js_formatter/tests/language.rs b/crates/biome_js_formatter/tests/language.rs index 1a32f1f8fe26..8dbca596d039 100644 --- a/crates/biome_js_formatter/tests/language.rs +++ b/crates/biome_js_formatter/tests/language.rs @@ -1,4 +1,6 @@ -use biome_formatter::{FormatContext, FormatResult, Formatted, IndentStyle, LineWidth, Printed}; +use biome_formatter::{ + FormatContext, FormatResult, Formatted, IndentStyle, LineEnding, LineWidth, Printed, +}; use biome_formatter_test::TestFormatLanguage; use biome_js_formatter::context::trailing_comma::TrailingComma; use biome_js_formatter::context::{ @@ -91,6 +93,29 @@ impl From for IndentStyle { } } +#[derive(Debug, Eq, PartialEq, Clone, Copy, Deserialize, Serialize, Default)] +pub enum JsSerializableLineEnding { + /// Line Feed only (\n), common on Linux and macOS as well as inside git repos + #[default] + Lf, + + /// Carriage Return + Line Feed characters (\r\n), common on Windows + Crlf, + + /// Carriage Return character only (\r), used very rarely + Cr, +} + +impl From for LineEnding { + fn from(test: JsSerializableLineEnding) -> Self { + match test { + JsSerializableLineEnding::Lf => LineEnding::Lf, + JsSerializableLineEnding::Crlf => LineEnding::Crlf, + JsSerializableLineEnding::Cr => LineEnding::Cr, + } + } +} + #[derive(Debug, Eq, PartialEq, Clone, Copy, Deserialize, Serialize)] pub enum JsSerializableQuoteStyle { Double, @@ -176,6 +201,9 @@ pub struct JsSerializableFormatOptions { /// The indent width. pub indent_width: Option, + /// The type of line ending. + pub line_ending: Option, + /// What's the max width of a line. Defaults to 80. pub line_width: Option, @@ -207,6 +235,7 @@ impl JsSerializableFormatOptions { .map(|value| value.into()) .unwrap_or_default(), ) + .with_line_ending(self.line_ending.unwrap_or_default().into()) .with_line_width( self.line_width .and_then(|width| LineWidth::try_from(width).ok()) diff --git a/crates/biome_js_formatter/tests/specs/js/module/array/array_nested.js.snap b/crates/biome_js_formatter/tests/specs/js/module/array/array_nested.js.snap index 309068bba467..46adc2388e7f 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/array/array_nested.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/array/array_nested.js.snap @@ -60,6 +60,7 @@ let o1 = [{ a, b }, { a, b, c }]; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/array/binding_pattern.js.snap b/crates/biome_js_formatter/tests/specs/js/module/array/binding_pattern.js.snap index c7a78f1a3a96..5688adc2dd54 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/array/binding_pattern.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/array/binding_pattern.js.snap @@ -22,6 +22,7 @@ let [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,...cccccccccc ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/array/empty_lines.js.snap b/crates/biome_js_formatter/tests/specs/js/module/array/empty_lines.js.snap index 9177381d6385..5fa3b23d2b53 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/array/empty_lines.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/array/empty_lines.js.snap @@ -31,6 +31,7 @@ let a = [ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/array/spaces.js.snap b/crates/biome_js_formatter/tests/specs/js/module/array/spaces.js.snap index 0e9beef3d7ae..038c712a8a05 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/array/spaces.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/array/spaces.js.snap @@ -24,6 +24,7 @@ let e = [2,2,1,3]; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/array/spread.js.snap b/crates/biome_js_formatter/tests/specs/js/module/array/spread.js.snap index afa13dade9dc..dd2e81dd3f40 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/array/spread.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/array/spread.js.snap @@ -24,6 +24,7 @@ let a = [...baaaaaaaaaaaaaaaaaaaaaaaaaaaaa,...bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,... ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/array/trailing-comma/array_trailing_comma.js.snap b/crates/biome_js_formatter/tests/specs/js/module/array/trailing-comma/array_trailing_comma.js.snap index 8950e0199357..f3e5efc2c413 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/array/trailing-comma/array_trailing_comma.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/array/trailing-comma/array_trailing_comma.js.snap @@ -29,6 +29,7 @@ const a = [ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -58,6 +59,7 @@ const a = [ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -87,6 +89,7 @@ const a = [ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow-comments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow-comments.js.snap index 4901039f1459..2da96b88c898 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow-comments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow-comments.js.snap @@ -40,6 +40,7 @@ multiline`; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -77,6 +78,7 @@ multiline`; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_chain_comments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_chain_comments.js.snap index c2bc96457870..62eb28d21092 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_chain_comments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_chain_comments.js.snap @@ -28,6 +28,7 @@ x2 = (a) => ((askTrovenaBeenaDependsRowans1, askTrovenaBeenaDependsRowans2, askT ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -61,6 +62,7 @@ x2 = ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_function.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_function.js.snap index c13a607b6367..2c472af27e1b 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_function.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_function.js.snap @@ -25,6 +25,7 @@ async () => {} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -52,6 +53,7 @@ async () => {}; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_nested.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_nested.js.snap index 0db5a2278741..1412160bfce1 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_nested.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_nested.js.snap @@ -46,6 +46,7 @@ runtimeAgent.getProperties( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -89,6 +90,7 @@ runtimeAgent.getProperties( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_test_callback.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_test_callback.js.snap index b4ceccd5a8c4..8b9f93aa9ccc 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_test_callback.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/arrow_test_callback.js.snap @@ -23,6 +23,7 @@ it('should have the default duration when using the onClose arguments', done => ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -49,6 +50,7 @@ it("should have the default duration when using the onClose arguments", (done) = ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/call.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/call.js.snap index 1fc668ea14fa..8014fd38cc22 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/call.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/call.js.snap @@ -63,6 +63,7 @@ romise.then(result => result.veryLongVariable.veryLongPropertyName > someOtherVa ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -133,6 +134,7 @@ romise.then((result) => ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/currying.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/currying.js.snap index 55a3450c4f2c..a3560befb70c 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/currying.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/currying.js.snap @@ -36,6 +36,7 @@ const middleware = options => (req, res, next) => { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -70,6 +71,7 @@ const middleware = (options) => (req, res, next) => { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/arrow/params.js.snap b/crates/biome_js_formatter/tests/specs/js/module/arrow/params.js.snap index 73bd988ff48e..3ab34f94d9bd 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/arrow/params.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/arrow/params.js.snap @@ -345,6 +345,7 @@ export default (element) => async (Component, props, slotted, { client }) => { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -669,6 +670,7 @@ export default (element) => ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/assignment/array-assignment-holes.js.snap b/crates/biome_js_formatter/tests/specs/js/module/assignment/array-assignment-holes.js.snap index 818b2afe9430..0f9e8c4b3ec5 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/assignment/array-assignment-holes.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/assignment/array-assignment-holes.js.snap @@ -21,6 +21,7 @@ let a, b; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment.js.snap b/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment.js.snap index 7893265c3588..54d2f4871202 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment.js.snap @@ -181,6 +181,7 @@ function* f() { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment_ignore.js.snap b/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment_ignore.js.snap index a870fd7658c0..873a6c57bbdd 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment_ignore.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/assignment/assignment_ignore.js.snap @@ -23,6 +23,7 @@ let { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/binding/array-binding-holes.js.snap b/crates/biome_js_formatter/tests/specs/js/module/binding/array-binding-holes.js.snap index 2f77f17dbf24..4a3ce3381aca 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/binding/array-binding-holes.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/binding/array-binding-holes.js.snap @@ -20,6 +20,7 @@ function foo([foo, /* not used */, /* not used */]) { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/binding/array_binding.js.snap b/crates/biome_js_formatter/tests/specs/js/module/binding/array_binding.js.snap index 5218de8fd212..0954eefba216 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/binding/array_binding.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/binding/array_binding.js.snap @@ -22,6 +22,7 @@ let [aaaaaaaaaaaaaaaaaaaa=bbbbbbbbbbbbbbbbbbbb,cccccccccccccccccccc=dddddddddddd ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/binding/identifier_binding.js.snap b/crates/biome_js_formatter/tests/specs/js/module/binding/identifier_binding.js.snap index 99c69ffc79f2..396f02daf95d 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/binding/identifier_binding.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/binding/identifier_binding.js.snap @@ -22,6 +22,7 @@ let abcde = "very long value that will cause a line break", fghij = "this should ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/binding/object_binding.js.snap b/crates/biome_js_formatter/tests/specs/js/module/binding/object_binding.js.snap index c9da97b2c238..11296280fdcf 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/binding/object_binding.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/binding/object_binding.js.snap @@ -23,6 +23,7 @@ let {aaaaaaaaaaaaaaaaaaaa,bbbbbbbbbbbbbbbbbbbb=cccccccccccccccccccc,dddddddddddd ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/bom_character.js.snap b/crates/biome_js_formatter/tests/specs/js/module/bom_character.js.snap index e6db25bb959e..9d42f62bbcea 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/bom_character.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/bom_character.js.snap @@ -19,6 +19,7 @@ info: js/module/bom_character.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/call_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/call_expression.js.snap index 12c9ce8dc3b3..bd1566355656 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/call_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/call_expression.js.snap @@ -66,6 +66,7 @@ test.expect(t => { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/class/class.js.snap b/crates/biome_js_formatter/tests/specs/js/module/class/class.js.snap index 31bf230fdf03..4c8e9c71c8e2 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/class/class.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/class/class.js.snap @@ -89,6 +89,7 @@ export class Task { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/class/class_comments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/class/class_comments.js.snap index 10c742f6f010..4c2f5dc5d59f 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/class/class_comments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/class/class_comments.js.snap @@ -25,6 +25,7 @@ class A extends B { // leading comment ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/class/private_method.js.snap b/crates/biome_js_formatter/tests/specs/js/module/class/private_method.js.snap index 731dd3a66efc..3ceba7f64122 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/class/private_method.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/class/private_method.js.snap @@ -35,6 +35,7 @@ class Foo { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/comments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/comments.js.snap index c9530e64a5c2..35f876779ae3 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/comments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/comments.js.snap @@ -97,6 +97,7 @@ statement /* comment */; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/declarations/variable_declaration.js.snap b/crates/biome_js_formatter/tests/specs/js/module/declarations/variable_declaration.js.snap index 35e80409bb6b..26f26712bae2 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/declarations/variable_declaration.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/declarations/variable_declaration.js.snap @@ -284,6 +284,7 @@ const a ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_call_decorator.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_call_decorator.js.snap index 31811ce2329e..7fffc61ac10c 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_call_decorator.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_call_decorator.js.snap @@ -111,6 +111,7 @@ class Foo { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_mixed.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_mixed.js.snap index 6a92b25ad1b1..9dee153259b9 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_mixed.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_mixed.js.snap @@ -111,6 +111,7 @@ class Foo { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_simple.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_simple.js.snap index 933a44e2da20..21899f4829b9 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_simple.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_members_simple.js.snap @@ -111,6 +111,7 @@ class Foo { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple.js.snap index 01ff3a50c38a..11f3967e7ad2 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple.js.snap @@ -67,6 +67,7 @@ export @dec1 @dec2 @dec3 @dec4 class My {} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple_call_decorator.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple_call_decorator.js.snap index 3720a72650d0..e8e0d4e1a5a6 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple_call_decorator.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/class_simple_call_decorator.js.snap @@ -67,6 +67,7 @@ export @decorator.method(value) @decorator2.method(value) @decorator3.method(va ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_1.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_1.js.snap index 2407480b417f..552602fc3e97 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_1.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_1.js.snap @@ -20,6 +20,7 @@ info: js/module/decorators/export_default_1.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_2.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_2.js.snap index 7cfc9fd82aa6..f4cd10ff2c3f 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_2.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_2.js.snap @@ -20,6 +20,7 @@ info: js/module/decorators/export_default_2.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_3.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_3.js.snap index de72862ab86d..ba86e504f745 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_3.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_3.js.snap @@ -20,6 +20,7 @@ info: js/module/decorators/export_default_3.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_4.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_4.js.snap index 47afac6a5d24..5bb7b80a16e6 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_4.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/export_default_4.js.snap @@ -20,6 +20,7 @@ info: js/module/decorators/export_default_4.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/expression.js.snap index f98054f08e8f..39221c07c6b2 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/expression.js.snap @@ -40,6 +40,7 @@ class Foo extends (@deco class {}){} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/decorators/multiline.js.snap b/crates/biome_js_formatter/tests/specs/js/module/decorators/multiline.js.snap index ba5ec0dfc5ee..874e3354df5d 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/decorators/multiline.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/decorators/multiline.js.snap @@ -35,6 +35,7 @@ class Foo { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/each/each.js.snap b/crates/biome_js_formatter/tests/specs/js/module/each/each.js.snap index cc6d67d96305..89f3db33cc58 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/each/each.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/each/each.js.snap @@ -85,6 +85,7 @@ ${2} | ${1} | ${3}` ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/class_clause.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/class_clause.js.snap index 9b2118eb02a4..8370ed552d12 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/class_clause.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/class_clause.js.snap @@ -28,6 +28,7 @@ B {} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/expression_clause.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/expression_clause.js.snap index 1ba3b068baf9..5220be410977 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/expression_clause.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/expression_clause.js.snap @@ -19,6 +19,7 @@ export default (1 - 43); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/from_clause.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/from_clause.js.snap index cc649a607ae7..1a3d34ebb3c8 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/from_clause.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/from_clause.js.snap @@ -23,6 +23,7 @@ export * as something_bad_will_happen from "something_bad_might_not_happen" asse ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/function_clause.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/function_clause.js.snap index e766496831c8..7d9068557d27 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/function_clause.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/function_clause.js.snap @@ -27,6 +27,7 @@ export default function ff() { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/named_clause.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/named_clause.js.snap index c55628cc6b32..91d29049cd8c 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/named_clause.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/named_clause.js.snap @@ -25,6 +25,7 @@ export { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/named_from_clause.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/named_from_clause.js.snap index 12929ae9026d..0afaa8cbcb7d 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/named_from_clause.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/named_from_clause.js.snap @@ -38,6 +38,7 @@ export { a as b } from "looooooooooooooooooooooooooooooooooooooooooooooooooooooo ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/trailing-comma/export_trailing_comma.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/trailing-comma/export_trailing_comma.js.snap index eb577708c9f4..52e06579815f 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/trailing-comma/export_trailing_comma.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/trailing-comma/export_trailing_comma.js.snap @@ -24,6 +24,7 @@ export { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -46,6 +47,7 @@ export { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -68,6 +70,7 @@ export { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/export/variable_declaration.js.snap b/crates/biome_js_formatter/tests/specs/js/module/export/variable_declaration.js.snap index ec24afcf4d4d..a7a302d5487c 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/export/variable_declaration.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/export/variable_declaration.js.snap @@ -21,6 +21,7 @@ export const foofoofoofoofoofoofoo = "ahah", barbarbarbarbarbarbar = {}, loremlo ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/binary_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/binary_expression.js.snap index aa511e0d95b7..161ce3204488 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/binary_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/binary_expression.js.snap @@ -53,6 +53,7 @@ a + b + 4 + ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/binary_range_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/binary_range_expression.js.snap index c5c89c12a656..7f03c9c07c33 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/binary_range_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/binary_range_expression.js.snap @@ -20,6 +20,7 @@ info: js/module/expression/binary_range_expression.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/binaryish_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/binaryish_expression.js.snap index ea7855ab89a6..cf05d857a265 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/binaryish_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/binaryish_expression.js.snap @@ -19,6 +19,7 @@ info: js/module/expression/binaryish_expression.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/computed-member-expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/computed-member-expression.js.snap index d96a0fa17e5b..be9a5b300c1c 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/computed-member-expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/computed-member-expression.js.snap @@ -20,6 +20,7 @@ a["test"][5 + 5][call()]; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/conditional_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/conditional_expression.js.snap index 12b2cd9de9a3..619b730daca5 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/conditional_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/conditional_expression.js.snap @@ -28,6 +28,7 @@ somethingThatsAReallyLongPropName ? somethingThatsAReallyLongPropName : somethin ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/import_meta_expression/import_meta_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/import_meta_expression/import_meta_expression.js.snap index db61d414ace1..cf9e1a139e1d 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/import_meta_expression/import_meta_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/import_meta_expression/import_meta_expression.js.snap @@ -22,6 +22,7 @@ import.meta.aReallyLongVariableName.andAnotherReallyLongVariableName.andAnotherR ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -49,6 +50,7 @@ import.meta.aReallyLongVariableName.andAnotherReallyLongVariableName ----- Indent style: Space Indent width: 4 +Line ending: LF Line width: 120 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/literal_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/literal_expression.js.snap index f282a92128b2..08045b3253bd 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/literal_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/literal_expression.js.snap @@ -25,6 +25,7 @@ null ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/logical_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/logical_expression.js.snap index 2c033692b125..0f122321c69a 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/logical_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/logical_expression.js.snap @@ -131,6 +131,7 @@ veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongFoo instanceof String && ver ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/complex_arguments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/complex_arguments.js.snap index 37bcc947f421..fa916be38fa5 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/complex_arguments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/complex_arguments.js.snap @@ -24,6 +24,7 @@ client.execute( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/computed.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/computed.js.snap index 7c74b35c705c..7ca38d236894 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/computed.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/computed.js.snap @@ -24,6 +24,7 @@ nock(/test/) ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/inline-merge.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/inline-merge.js.snap index f23ad2f1abb4..f4086f0cfb4a 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/inline-merge.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/inline-merge.js.snap @@ -31,6 +31,7 @@ Object ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/static_member_regex.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/static_member_regex.js.snap index ba5ab783a3f0..3abb004faf9a 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/static_member_regex.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/member-chain/static_member_regex.js.snap @@ -43,6 +43,7 @@ const a = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/new_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/new_expression.js.snap index 96151ad105fe..7db085ee86f5 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/new_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/new_expression.js.snap @@ -22,6 +22,7 @@ new c(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,cccccccccccc ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/post_update_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/post_update_expression.js.snap index 20afb453f893..af485b70decb 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/post_update_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/post_update_expression.js.snap @@ -23,6 +23,7 @@ x = y-- ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/pre_update_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/pre_update_expression.js.snap index e966bea475ae..f207a84ef935 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/pre_update_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/pre_update_expression.js.snap @@ -23,6 +23,7 @@ x = --y ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/sequence_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/sequence_expression.js.snap index 0700a64c86ef..2f0b8257267a 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/sequence_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/sequence_expression.js.snap @@ -52,6 +52,7 @@ aLongIdentifierName, ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/static_member_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/static_member_expression.js.snap index 868a19ca782e..cf7ac2b3f384 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/static_member_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/static_member_expression.js.snap @@ -39,6 +39,7 @@ some.member.with. ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/this_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/this_expression.js.snap index 5a1acc3df264..9f642d687f55 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/this_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/this_expression.js.snap @@ -20,6 +20,7 @@ this ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression.js.snap index a0f4895eff81..347e70cf89f5 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression.js.snap @@ -33,6 +33,7 @@ x = !aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression_verbatim_argument.js.snap b/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression_verbatim_argument.js.snap index be07d900cfa0..cf1d8edec01d 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression_verbatim_argument.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/expression/unary_expression_verbatim_argument.js.snap @@ -27,6 +27,7 @@ info: js/module/expression/unary_expression_verbatim_argument.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/function/function.js.snap b/crates/biome_js_formatter/tests/specs/js/module/function/function.js.snap index 7ab6a3bd8e3d..2187b539fc3e 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/function/function.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/function/function.js.snap @@ -51,6 +51,7 @@ function directives() { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/function/function_args.js.snap b/crates/biome_js_formatter/tests/specs/js/module/function/function_args.js.snap index e01c89ae8da3..cb324b73f85e 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/function/function_args.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/function/function_args.js.snap @@ -21,6 +21,7 @@ function foo(someotherlongvariableshould1, someotherlongvariableshould2, someoth ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/function/function_comments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/function/function_comments.js.snap index b9d4f8a04de3..cd104dabb938 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/function/function_comments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/function/function_comments.js.snap @@ -35,6 +35,7 @@ function c( //some comment ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/ident.js.snap b/crates/biome_js_formatter/tests/specs/js/module/ident.js.snap index 9633d1aefc67..89b9175dd27e 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/ident.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/ident.js.snap @@ -20,6 +20,7 @@ x ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/import/bare_import.js.snap b/crates/biome_js_formatter/tests/specs/js/module/import/bare_import.js.snap index aa4a06c5ba52..a90d5ea086d8 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/import/bare_import.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/import/bare_import.js.snap @@ -42,6 +42,7 @@ import "very_long_import_very_long_import_very" assert { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/import/default_import.js.snap b/crates/biome_js_formatter/tests/specs/js/module/import/default_import.js.snap index e5e7f482d920..889c197b1089 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/import/default_import.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/import/default_import.js.snap @@ -30,6 +30,7 @@ import a, * as b from "foo" ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/import/import_call.js.snap b/crates/biome_js_formatter/tests/specs/js/module/import/import_call.js.snap index 669c5506281d..bd4faf2533a3 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/import/import_call.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/import/import_call.js.snap @@ -22,6 +22,7 @@ import(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/import/import_specifiers.js.snap b/crates/biome_js_formatter/tests/specs/js/module/import/import_specifiers.js.snap index 0810a623be2a..71860ac4d3a9 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/import/import_specifiers.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/import/import_specifiers.js.snap @@ -51,6 +51,7 @@ import a, { loooooooooooooooooooooong } from "looooooooooooooooooooooooooooooooo ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/import/namespace_import.js.snap b/crates/biome_js_formatter/tests/specs/js/module/import/namespace_import.js.snap index aac66abe9e42..6d31f3d8e735 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/import/namespace_import.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/import/namespace_import.js.snap @@ -19,6 +19,7 @@ import * as all from "all" ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/import/trailing-comma/import_trailing_comma.js.snap b/crates/biome_js_formatter/tests/specs/js/module/import/trailing-comma/import_trailing_comma.js.snap index 0aedd7c1dabc..ce31565d5cec 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/import/trailing-comma/import_trailing_comma.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/import/trailing-comma/import_trailing_comma.js.snap @@ -49,6 +49,7 @@ wrap(import(/* Hello */ "something")); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -106,6 +107,7 @@ wrap(import(/* Hello */ "something")); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -163,6 +165,7 @@ wrap(import(/* Hello */ "something")); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-1.js.snap b/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-1.js.snap index 8ce08f458289..9f7dd44af291 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-1.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-1.js.snap @@ -22,6 +22,7 @@ function foo() { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -42,6 +43,7 @@ function foo() { ----- Indent style: Tab Indent width: 4 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -68,6 +70,7 @@ function foo() { ----- Indent style: Tab Indent width: 8 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-2.js.snap b/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-2.js.snap index 4c89429a72c8..c9481cfe8a1b 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-2.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/indent-width/example-2.js.snap @@ -36,6 +36,7 @@ function foo() { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -70,6 +71,7 @@ function foo() { ----- Indent style: Tab Indent width: 4 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -104,6 +106,7 @@ function foo() { ----- Indent style: Tab Indent width: 8 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/interpreter-with-trailing-spaces.js.snap b/crates/biome_js_formatter/tests/specs/js/module/interpreter-with-trailing-spaces.js.snap index d71d6e41a228..68e935f8ec77 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/interpreter-with-trailing-spaces.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/interpreter-with-trailing-spaces.js.snap @@ -21,6 +21,7 @@ console.log(1) ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/interpreter.js.snap b/crates/biome_js_formatter/tests/specs/js/module/interpreter.js.snap index a378ee46311e..f6db8fbc0c8d 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/interpreter.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/interpreter.js.snap @@ -22,6 +22,7 @@ console.log(1) ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/interpreter_with_empty_line.js.snap b/crates/biome_js_formatter/tests/specs/js/module/interpreter_with_empty_line.js.snap index 008afabb840e..45ec604655d9 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/interpreter_with_empty_line.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/interpreter_with_empty_line.js.snap @@ -22,6 +22,7 @@ console.log(1) ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/invalid/block_stmt_err.js.snap b/crates/biome_js_formatter/tests/specs/js/module/invalid/block_stmt_err.js.snap index 0c34275b0080..d44bf7befeb8 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/invalid/block_stmt_err.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/invalid/block_stmt_err.js.snap @@ -29,6 +29,7 @@ let recovered = "no" ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/invalid/if_stmt_err.js.snap b/crates/biome_js_formatter/tests/specs/js/module/invalid/if_stmt_err.js.snap index c065e51d7df0..acbc44b2e46b 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/invalid/if_stmt_err.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/invalid/if_stmt_err.js.snap @@ -35,6 +35,7 @@ if (false) { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/line-ending/line_ending.js b/crates/biome_js_formatter/tests/specs/js/module/line-ending/line_ending.js new file mode 100644 index 000000000000..7fb76bd2e0d5 --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/js/module/line-ending/line_ending.js @@ -0,0 +1,17 @@ +// Original file in LF +// just some random code +export const env = createEnv({ + DISCORD_TOKEN: { type: 'string' }, + TOPGG_TOKEN: { type: 'string' }, + + GUILD_LOGS: { type: 'string' }, + GLOBAL_DETECTOR_LOGS: { type: 'string' }, + TEST_GUILD: { type: 'string' }, + + SUPPORT_INVITE: { type: 'string' }, + GAS_INVITE: { type: 'string' }, + + DOCS_LINK: { type: 'string' }, + + NODE_ENV: { type: 'string' }, +}); diff --git a/crates/biome_js_formatter/tests/specs/js/module/line-ending/line_ending.js.snap b/crates/biome_js_formatter/tests/specs/js/module/line-ending/line_ending.js.snap new file mode 100644 index 000000000000..63d89d801144 --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/js/module/line-ending/line_ending.js.snap @@ -0,0 +1,139 @@ +--- +source: crates/biome_formatter_test/src/snapshot_builder.rs +info: "js\\module\\line-ending\\line_ending.js" +--- + +# Input + +```js +// Original file in LF +// just some random code +export const env = createEnv({ + DISCORD_TOKEN: { type: 'string' }, + TOPGG_TOKEN: { type: 'string' }, + + GUILD_LOGS: { type: 'string' }, + GLOBAL_DETECTOR_LOGS: { type: 'string' }, + TEST_GUILD: { type: 'string' }, + + SUPPORT_INVITE: { type: 'string' }, + GAS_INVITE: { type: 'string' }, + + DOCS_LINK: { type: 'string' }, + + NODE_ENV: { type: 'string' }, +}); + +``` + + +============================= + +# Outputs + +## Output 1 + +----- +Indent style: Tab +Indent width: 2 +Line ending: LF +Line width: 80 +Quote style: Double Quotes +JSX quote style: Double Quotes +Quote properties: As needed +Trailing comma: All +Semicolons: Always +Arrow parentheses: Always +----- + +```js +// Original file in LF +// just some random code +export const env = createEnv({ + DISCORD_TOKEN: { type: "string" }, + TOPGG_TOKEN: { type: "string" }, + + GUILD_LOGS: { type: "string" }, + GLOBAL_DETECTOR_LOGS: { type: "string" }, + TEST_GUILD: { type: "string" }, + + SUPPORT_INVITE: { type: "string" }, + GAS_INVITE: { type: "string" }, + + DOCS_LINK: { type: "string" }, + + NODE_ENV: { type: "string" }, +}); +``` + +## Output 2 + +----- +Indent style: Tab +Indent width: 2 +Line ending: CRLF +Line width: 80 +Quote style: Double Quotes +JSX quote style: Double Quotes +Quote properties: As needed +Trailing comma: All +Semicolons: Always +Arrow parentheses: Always +----- + +```js +// Original file in LF +// just some random code +export const env = createEnv({ + DISCORD_TOKEN: { type: "string" }, + TOPGG_TOKEN: { type: "string" }, + + GUILD_LOGS: { type: "string" }, + GLOBAL_DETECTOR_LOGS: { type: "string" }, + TEST_GUILD: { type: "string" }, + + SUPPORT_INVITE: { type: "string" }, + GAS_INVITE: { type: "string" }, + + DOCS_LINK: { type: "string" }, + + NODE_ENV: { type: "string" }, +}); +``` + +## Output 3 + +----- +Indent style: Tab +Indent width: 2 +Line ending: CR +Line width: 80 +Quote style: Double Quotes +JSX quote style: Double Quotes +Quote properties: As needed +Trailing comma: All +Semicolons: Always +Arrow parentheses: Always +----- + +```js +// Original file in LF +// just some random code +export const env = createEnv({ + DISCORD_TOKEN: { type: "string" }, + TOPGG_TOKEN: { type: "string" }, + + GUILD_LOGS: { type: "string" }, + GLOBAL_DETECTOR_LOGS: { type: "string" }, + TEST_GUILD: { type: "string" }, + + SUPPORT_INVITE: { type: "string" }, + GAS_INVITE: { type: "string" }, + + DOCS_LINK: { type: "string" }, + + NODE_ENV: { type: "string" }, +}); +``` + + diff --git a/crates/biome_js_formatter/tests/specs/js/module/line-ending/options.json b/crates/biome_js_formatter/tests/specs/js/module/line-ending/options.json new file mode 100644 index 000000000000..ac7b733395bd --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/js/module/line-ending/options.json @@ -0,0 +1,10 @@ +{ + "cases": [ + { + "line_ending": "Crlf" + }, + { + "line_ending": "Cr" + } + ] +} diff --git a/crates/biome_js_formatter/tests/specs/js/module/newlines.js.snap b/crates/biome_js_formatter/tests/specs/js/module/newlines.js.snap index 43f45311de81..417a87555027 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/newlines.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/newlines.js.snap @@ -97,6 +97,7 @@ const object = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/no-semi/class.js.snap b/crates/biome_js_formatter/tests/specs/js/module/no-semi/class.js.snap index b7c68bd06b75..98f0507063c9 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/no-semi/class.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/no-semi/class.js.snap @@ -137,6 +137,7 @@ class G4 { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -270,6 +271,7 @@ class G4 { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/no-semi/issue2006.js.snap b/crates/biome_js_formatter/tests/specs/js/module/no-semi/issue2006.js.snap index 877000e0c2a7..c7b50549f800 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/no-semi/issue2006.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/no-semi/issue2006.js.snap @@ -27,6 +27,7 @@ var c = a.e; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -52,6 +53,7 @@ var c = a.e; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/no-semi/no-semi.js.snap b/crates/biome_js_formatter/tests/specs/js/module/no-semi/no-semi.js.snap index 017d6a650c28..60d42de31253 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/no-semi/no-semi.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/no-semi/no-semi.js.snap @@ -99,6 +99,7 @@ aReallyLongLine012345678901234567890123456789012345678901234567890123456789 * ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -207,6 +208,7 @@ aReallyLongLine012345678901234567890123456789012345678901234567890123456789 * ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/no-semi/private-field.js.snap b/crates/biome_js_formatter/tests/specs/js/module/no-semi/private-field.js.snap index 0ee33e29462a..9ca21beb38a4 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/no-semi/private-field.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/no-semi/private-field.js.snap @@ -23,6 +23,7 @@ class C { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -44,6 +45,7 @@ class C { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons-asi.js.snap b/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons-asi.js.snap index ea5c07f21fad..14778440ee83 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons-asi.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons-asi.js.snap @@ -20,6 +20,7 @@ info: js/module/no-semi/semicolons-asi.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -38,6 +39,7 @@ Arrow parentheses: Always ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons_range.js.snap b/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons_range.js.snap index 153b2838e222..651b1446ecb8 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons_range.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/no-semi/semicolons_range.js.snap @@ -22,6 +22,7 @@ statement_3() ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -42,6 +43,7 @@ statement_3() ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/number/number.js.snap b/crates/biome_js_formatter/tests/specs/js/module/number/number.js.snap index 64ebd180c409..1643652c7f40 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/number/number.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/number/number.js.snap @@ -21,6 +21,7 @@ info: js/module/number/number.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/number/number_with_space.js.snap b/crates/biome_js_formatter/tests/specs/js/module/number/number_with_space.js.snap index 2d42606c837e..6ab8ff6b1aa0 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/number/number_with_space.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/number/number_with_space.js.snap @@ -25,6 +25,7 @@ info: js/module/number/number_with_space.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/computed_member.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/computed_member.js.snap index 40b38443182c..485773c56078 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/computed_member.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/computed_member.js.snap @@ -38,6 +38,7 @@ a[("test")] ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/getter_setter.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/getter_setter.js.snap index 92e8bde946c4..1514334bf745 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/getter_setter.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/getter_setter.js.snap @@ -25,6 +25,7 @@ let b = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/numeric-property.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/numeric-property.js.snap index 944633c25953..1602c92db879 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/numeric-property.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/numeric-property.js.snap @@ -56,6 +56,7 @@ const x = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/object.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/object.js.snap index 9310da72151e..0f4d64597d40 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/object.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/object.js.snap @@ -51,6 +51,7 @@ const y = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/object_comments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/object_comments.js.snap index e8e4a4038710..35468fd05cbf 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/object_comments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/object_comments.js.snap @@ -22,6 +22,7 @@ let a = { // leading comment ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/octal_literals_key.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/octal_literals_key.js.snap index 493fef6765a1..392553ebaf45 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/octal_literals_key.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/octal_literals_key.js.snap @@ -25,6 +25,7 @@ const x = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/property_key.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/property_key.js.snap index 8c53024784da..e75dd749ab70 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/property_key.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/property_key.js.snap @@ -27,6 +27,7 @@ const foo = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/property_object_member.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/property_object_member.js.snap index b34da04b75b5..23c95513693b 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/property_object_member.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/property_object_member.js.snap @@ -107,6 +107,7 @@ const fluidObject = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/object/trailing-comma/object_trailing_comma.js.snap b/crates/biome_js_formatter/tests/specs/js/module/object/trailing-comma/object_trailing_comma.js.snap index 5d4ba6948478..f0785dcb915d 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/object/trailing-comma/object_trailing_comma.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/object/trailing-comma/object_trailing_comma.js.snap @@ -28,6 +28,7 @@ const { adsadasdasdasdasdasdasdasdasdasdas, ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -56,6 +57,7 @@ const { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -84,6 +86,7 @@ const { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/parentheses/parentheses.js.snap b/crates/biome_js_formatter/tests/specs/js/module/parentheses/parentheses.js.snap index 0c850895570a..3522294b48c4 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/parentheses/parentheses.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/parentheses/parentheses.js.snap @@ -42,6 +42,7 @@ const a = () => ({}?.() && a); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/parentheses/range_parentheses_binary.js.snap b/crates/biome_js_formatter/tests/specs/js/module/parentheses/range_parentheses_binary.js.snap index c36cf2745da1..21950149fb81 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/parentheses/range_parentheses_binary.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/parentheses/range_parentheses_binary.js.snap @@ -20,6 +20,7 @@ import React from 'react'; function test() { const AppShelled = () => (1 + 2) } ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/prettier-differences/fill-array-comments.js.snap b/crates/biome_js_formatter/tests/specs/js/module/prettier-differences/fill-array-comments.js.snap index ab8cac733ce5..a911acbbb70a 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/prettier-differences/fill-array-comments.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/prettier-differences/fill-array-comments.js.snap @@ -27,6 +27,7 @@ info: js/module/prettier-differences/fill-array-comments.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol.js.snap b/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol.js.snap index 23afa94ad782..18ad9af15c69 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol.js.snap @@ -29,6 +29,7 @@ console.log("🚀".length); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol_1.js.snap b/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol_1.js.snap index b2263c6590c4..b4917f5a2a2e 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol_1.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/range/range_parenthesis_after_semicol_1.js.snap @@ -27,6 +27,7 @@ console.log("🚀".length);("Jan 1, 2018 – Jan 1, 2019"); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/script.js.snap b/crates/biome_js_formatter/tests/specs/js/module/script.js.snap index bc7f0e84aad9..9e3de3a36636 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/script.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/script.js.snap @@ -23,6 +23,7 @@ var express = require("express") ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/block_statement.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/block_statement.js.snap index 11a8936d380b..f3b43cb4f652 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/block_statement.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/block_statement.js.snap @@ -28,6 +28,7 @@ if (true) { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/do_while.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/do_while.js.snap index 7cbb7231ed64..99590a294692 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/do_while.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/do_while.js.snap @@ -33,6 +33,7 @@ do; while(true); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/empty_blocks.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/empty_blocks.js.snap index 092d1da411ff..f6ceefd46359 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/empty_blocks.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/empty_blocks.js.snap @@ -48,6 +48,7 @@ do {} while (true); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/for_in.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/for_in.js.snap index d0042e1d8d47..98a47bfccf7c 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/for_in.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/for_in.js.snap @@ -25,6 +25,7 @@ for (a in b) { // trailing ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/for_loop.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/for_loop.js.snap index e7ffee0eb0b2..6e03f54dc906 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/for_loop.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/for_loop.js.snap @@ -36,6 +36,7 @@ for(let aVeryLongVariableNameToEnforceLineBreaks = 0; aVeryLongVariableNameToEnf ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/for_of.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/for_of.js.snap index 582c87c89882..5daa01897a36 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/for_of.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/for_of.js.snap @@ -27,6 +27,7 @@ for await ( const a of b ) {} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/if_chain.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/if_chain.js.snap index 4aae0e53189c..c19924194f53 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/if_chain.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/if_chain.js.snap @@ -22,6 +22,7 @@ if(very_long_condition_1) very_long_statement_1(); else if (very_long_condition_ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/if_else.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/if_else.js.snap index 56f643031d7b..93b7fa55ab23 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/if_else.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/if_else.js.snap @@ -88,6 +88,7 @@ true && false ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/return.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/return.js.snap index 2e8d940f95d3..e3dd3c8cebc9 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/return.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/return.js.snap @@ -25,6 +25,7 @@ function f2() { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/return_verbatim_argument.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/return_verbatim_argument.js.snap index d921f983e43d..782a683a4b62 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/return_verbatim_argument.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/return_verbatim_argument.js.snap @@ -44,6 +44,7 @@ function supported3(){ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/statement.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/statement.js.snap index 793efd487c76..4f10bf27e03f 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/statement.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/statement.js.snap @@ -21,6 +21,7 @@ debugger ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/switch.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/switch.js.snap index 2041bdbcafbc..f238baedecbc 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/switch.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/switch.js.snap @@ -38,6 +38,7 @@ switch ("test") { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/throw.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/throw.js.snap index 76e760822962..9d23fb17deaf 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/throw.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/throw.js.snap @@ -22,6 +22,7 @@ throw false ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/try_catch_finally.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/try_catch_finally.js.snap index 2a86877ee0ac..2d2b95955207 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/try_catch_finally.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/try_catch_finally.js.snap @@ -45,6 +45,7 @@ try { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/statement/while_loop.js.snap b/crates/biome_js_formatter/tests/specs/js/module/statement/while_loop.js.snap index 04b8d2fe1a78..0d5793a43687 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/statement/while_loop.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/statement/while_loop.js.snap @@ -45,6 +45,7 @@ tour: while (true) { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/string/directives.js.snap b/crates/biome_js_formatter/tests/specs/js/module/string/directives.js.snap index 9efe6022431a..93908e3cac68 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/string/directives.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/string/directives.js.snap @@ -22,6 +22,7 @@ info: js/module/string/directives.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -43,6 +44,7 @@ Arrow parentheses: Always ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Single Quotes JSX quote style: Double Quotes @@ -64,6 +66,7 @@ Arrow parentheses: Always ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/string/parentheses_token.js.snap b/crates/biome_js_formatter/tests/specs/js/module/string/parentheses_token.js.snap index 42bb6968cd47..0adac1c88ae6 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/string/parentheses_token.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/string/parentheses_token.js.snap @@ -20,6 +20,7 @@ info: js/module/string/parentheses_token.js ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -38,6 +39,7 @@ Arrow parentheses: Always ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Single Quotes JSX quote style: Double Quotes @@ -56,6 +58,7 @@ Arrow parentheses: Always ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/string/properties_quotes.js.snap b/crates/biome_js_formatter/tests/specs/js/module/string/properties_quotes.js.snap index d8c45312aece..7db99ef96dd9 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/string/properties_quotes.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/string/properties_quotes.js.snap @@ -62,6 +62,7 @@ const x = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -123,6 +124,7 @@ const x = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Single Quotes JSX quote style: Double Quotes @@ -184,6 +186,7 @@ const x = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/string/string.js.snap b/crates/biome_js_formatter/tests/specs/js/module/string/string.js.snap index 7bfefd97cb03..689300f0d754 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/string/string.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/string/string.js.snap @@ -76,6 +76,7 @@ export * as something_bad_will_happen from "something_bad_might_not_happen" asse ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -161,6 +162,7 @@ export * as something_bad_will_happen from "something_bad_might_not_happen" asse ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Single Quotes JSX quote style: Double Quotes @@ -246,6 +248,7 @@ export * as something_bad_will_happen from 'something_bad_might_not_happen' asse ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/suppression.js.snap b/crates/biome_js_formatter/tests/specs/js/module/suppression.js.snap index 8360e65da78f..2117714b23ae 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/suppression.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/suppression.js.snap @@ -47,6 +47,7 @@ function () {} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/template/template.js.snap b/crates/biome_js_formatter/tests/specs/js/module/template/template.js.snap index 5aaa54309038..7b437eb7b70c 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/template/template.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/template/template.js.snap @@ -66,6 +66,7 @@ ExampleStory.getFragment('story')} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/module/with.js.snap b/crates/biome_js_formatter/tests/specs/js/module/with.js.snap index 993ab5252c38..853eb811314e 100644 --- a/crates/biome_js_formatter/tests/specs/js/module/with.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/module/with.js.snap @@ -24,6 +24,7 @@ with ( b) ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/script/script.js.snap b/crates/biome_js_formatter/tests/specs/js/script/script.js.snap index d2eef4654acf..e960dbe4b42c 100644 --- a/crates/biome_js_formatter/tests/specs/js/script/script.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/script/script.js.snap @@ -23,6 +23,7 @@ var express = require("express") ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/script/script_with_bom.js.snap b/crates/biome_js_formatter/tests/specs/js/script/script_with_bom.js.snap index 4d2040408b02..bb8ee9cad4f0 100644 --- a/crates/biome_js_formatter/tests/specs/js/script/script_with_bom.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/script/script_with_bom.js.snap @@ -23,6 +23,7 @@ var express = require("express") ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/js/script/with.js.snap b/crates/biome_js_formatter/tests/specs/js/script/with.js.snap index 4dcdcbde634f..dd787af994d9 100644 --- a/crates/biome_js_formatter/tests/specs/js/script/with.js.snap +++ b/crates/biome_js_formatter/tests/specs/js/script/with.js.snap @@ -25,6 +25,7 @@ with({}) {} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/jsx/arrow_function.jsx.snap b/crates/biome_js_formatter/tests/specs/jsx/arrow_function.jsx.snap index 7db780a0b495..3297e1ac3086 100644 --- a/crates/biome_js_formatter/tests/specs/jsx/arrow_function.jsx.snap +++ b/crates/biome_js_formatter/tests/specs/jsx/arrow_function.jsx.snap @@ -48,6 +48,7 @@ function ArrowBodyIsJsxWithComment({ action }) { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/jsx/attributes.jsx.snap b/crates/biome_js_formatter/tests/specs/jsx/attributes.jsx.snap index e042742a77c2..9a369cad0447 100644 --- a/crates/biome_js_formatter/tests/specs/jsx/attributes.jsx.snap +++ b/crates/biome_js_formatter/tests/specs/jsx/attributes.jsx.snap @@ -95,6 +95,7 @@ const a = ; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/jsx/conditional.jsx.snap b/crates/biome_js_formatter/tests/specs/jsx/conditional.jsx.snap index 16d5b2191906..23fae4c3f7e3 100644 --- a/crates/biome_js_formatter/tests/specs/jsx/conditional.jsx.snap +++ b/crates/biome_js_formatter/tests/specs/jsx/conditional.jsx.snap @@ -68,6 +68,7 @@ info: jsx/conditional.jsx ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/jsx/element.jsx.snap b/crates/biome_js_formatter/tests/specs/jsx/element.jsx.snap index 9a2e1115e6c0..427cdb10718d 100644 --- a/crates/biome_js_formatter/tests/specs/jsx/element.jsx.snap +++ b/crates/biome_js_formatter/tests/specs/jsx/element.jsx.snap @@ -349,6 +349,7 @@ function Component() { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/jsx/fragment.jsx.snap b/crates/biome_js_formatter/tests/specs/jsx/fragment.jsx.snap index 7fa4d704670e..3e0ffe736dd2 100644 --- a/crates/biome_js_formatter/tests/specs/jsx/fragment.jsx.snap +++ b/crates/biome_js_formatter/tests/specs/jsx/fragment.jsx.snap @@ -21,6 +21,7 @@ info: jsx/fragment.jsx ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/jsx/new-lines.jsx.snap b/crates/biome_js_formatter/tests/specs/jsx/new-lines.jsx.snap index cc3fe1bfd5e9..e717a90b9460 100644 --- a/crates/biome_js_formatter/tests/specs/jsx/new-lines.jsx.snap +++ b/crates/biome_js_formatter/tests/specs/jsx/new-lines.jsx.snap @@ -69,6 +69,7 @@ let myDiv3 = ReactTestUtils.renderIntoDocument( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/jsx/parentheses_range.jsx.snap b/crates/biome_js_formatter/tests/specs/jsx/parentheses_range.jsx.snap index 602376713976..00460c13c100 100644 --- a/crates/biome_js_formatter/tests/specs/jsx/parentheses_range.jsx.snap +++ b/crates/biome_js_formatter/tests/specs/jsx/parentheses_range.jsx.snap @@ -20,6 +20,7 @@ import React from 'react'; function test() { const AppShelled = () => ( {} ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -62,6 +63,7 @@ Arrow parentheses: Always ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/arrow_chain.ts.snap b/crates/biome_js_formatter/tests/specs/ts/arrow_chain.ts.snap index 6f1652454409..ad8d4378222f 100644 --- a/crates/biome_js_formatter/tests/specs/ts/arrow_chain.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/arrow_chain.ts.snap @@ -30,6 +30,7 @@ const x = a => b => (aLongSequenceExpression, thatContinuesFurtherOnUntilItBrea ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/assignment/as_assignment.ts.snap b/crates/biome_js_formatter/tests/specs/ts/assignment/as_assignment.ts.snap index ed4b47897c59..6c7fd4c71775 100644 --- a/crates/biome_js_formatter/tests/specs/ts/assignment/as_assignment.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/assignment/as_assignment.ts.snap @@ -24,6 +24,7 @@ let binding; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/assignment/assignment.ts.snap b/crates/biome_js_formatter/tests/specs/ts/assignment/assignment.ts.snap index 4e4c4bec6dfc..bfb59880d57f 100644 --- a/crates/biome_js_formatter/tests/specs/ts/assignment/assignment.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/assignment/assignment.ts.snap @@ -32,6 +32,7 @@ const gitBaseExtension = extensions.getExtension( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/assignment/assignment_comments.ts.snap b/crates/biome_js_formatter/tests/specs/ts/assignment/assignment_comments.ts.snap index 2d28e9297090..71ad7bd3b9da 100644 --- a/crates/biome_js_formatter/tests/specs/ts/assignment/assignment_comments.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/assignment/assignment_comments.ts.snap @@ -40,6 +40,7 @@ const e: string // 1 ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/assignment/property_assignment_comments.ts.snap b/crates/biome_js_formatter/tests/specs/ts/assignment/property_assignment_comments.ts.snap index c49b0da21c83..fe1a0697f7b5 100644 --- a/crates/biome_js_formatter/tests/specs/ts/assignment/property_assignment_comments.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/assignment/property_assignment_comments.ts.snap @@ -52,6 +52,7 @@ class Test { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/assignment/type_assertion_assignment.ts.snap b/crates/biome_js_formatter/tests/specs/ts/assignment/type_assertion_assignment.ts.snap index 8831655682aa..cb155dc92cff 100644 --- a/crates/biome_js_formatter/tests/specs/ts/assignment/type_assertion_assignment.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/assignment/type_assertion_assignment.ts.snap @@ -33,6 +33,7 @@ for ( x of []) { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/binding/definite_variable.ts.snap b/crates/biome_js_formatter/tests/specs/ts/binding/definite_variable.ts.snap index aeeec7610035..a5f23247be34 100644 --- a/crates/biome_js_formatter/tests/specs/ts/binding/definite_variable.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/binding/definite_variable.ts.snap @@ -20,6 +20,7 @@ let definiteVariable!: TypeName; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/call_expression.ts.snap b/crates/biome_js_formatter/tests/specs/ts/call_expression.ts.snap index df2d1d7e8ae8..74b9d1fed1d1 100644 --- a/crates/biome_js_formatter/tests/specs/ts/call_expression.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/call_expression.ts.snap @@ -42,6 +42,7 @@ export class Task { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/class/accessor.ts.snap b/crates/biome_js_formatter/tests/specs/ts/class/accessor.ts.snap index 5a97f6829ac3..4a41da254f33 100644 --- a/crates/biome_js_formatter/tests/specs/ts/class/accessor.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/class/accessor.ts.snap @@ -21,6 +21,7 @@ export abstract class C { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/class/assigment_layout.ts.snap b/crates/biome_js_formatter/tests/specs/ts/class/assigment_layout.ts.snap index cd44c8b0efa4..f904221ddd8e 100644 --- a/crates/biome_js_formatter/tests/specs/ts/class/assigment_layout.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/class/assigment_layout.ts.snap @@ -26,6 +26,7 @@ class SourceRemoveUnused extends SourceAction { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/class/constructor_parameter.ts.snap b/crates/biome_js_formatter/tests/specs/ts/class/constructor_parameter.ts.snap index 37bca73f1bc4..bc4533b3f056 100644 --- a/crates/biome_js_formatter/tests/specs/ts/class/constructor_parameter.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/class/constructor_parameter.ts.snap @@ -54,6 +54,7 @@ class C { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/class/implements_clause.ts.snap b/crates/biome_js_formatter/tests/specs/ts/class/implements_clause.ts.snap index 5b2f25fd24af..b48fcaabf483 100644 --- a/crates/biome_js_formatter/tests/specs/ts/class/implements_clause.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/class/implements_clause.ts.snap @@ -21,6 +21,7 @@ class LongClassName implements Interface1, Interface2, Interface3, Interface4, I ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/class/readonly_ambient_property.ts.snap b/crates/biome_js_formatter/tests/specs/ts/class/readonly_ambient_property.ts.snap index e59af9316211..9a7472100927 100644 --- a/crates/biome_js_formatter/tests/specs/ts/class/readonly_ambient_property.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/class/readonly_ambient_property.ts.snap @@ -29,6 +29,7 @@ export class B { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/class/trailing_comma/class_trailing_comma.ts.snap b/crates/biome_js_formatter/tests/specs/ts/class/trailing_comma/class_trailing_comma.ts.snap index 86410a3be059..29e1046773e1 100644 --- a/crates/biome_js_formatter/tests/specs/ts/class/trailing_comma/class_trailing_comma.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/class/trailing_comma/class_trailing_comma.ts.snap @@ -30,6 +30,7 @@ class C< longlonglonglonglonglonglongT1, ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -72,6 +73,7 @@ class C< ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -114,6 +116,7 @@ class C< ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/declaration/class.ts.snap b/crates/biome_js_formatter/tests/specs/ts/declaration/class.ts.snap index e8f7e817d3cf..fd0fc1458c8f 100644 --- a/crates/biome_js_formatter/tests/specs/ts/declaration/class.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/declaration/class.ts.snap @@ -78,6 +78,7 @@ abstract class Test1 { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/declaration/declare_function.ts.snap b/crates/biome_js_formatter/tests/specs/ts/declaration/declare_function.ts.snap index e259c98d6713..6d1f95dda194 100644 --- a/crates/biome_js_formatter/tests/specs/ts/declaration/declare_function.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/declaration/declare_function.ts.snap @@ -22,6 +22,7 @@ declare function looooooooooooooooooooooooooooong_naaaaaame { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/declaration/variable_declaration.ts.snap b/crates/biome_js_formatter/tests/specs/ts/declaration/variable_declaration.ts.snap index 239247282c37..fe3d0932050b 100644 --- a/crates/biome_js_formatter/tests/specs/ts/declaration/variable_declaration.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/declaration/variable_declaration.ts.snap @@ -106,6 +106,7 @@ let looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/declare.ts.snap b/crates/biome_js_formatter/tests/specs/ts/declare.ts.snap index 87cb42cbfc73..2d3d4c39cd48 100644 --- a/crates/biome_js_formatter/tests/specs/ts/declare.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/declare.ts.snap @@ -25,6 +25,7 @@ declare module 'remark-html' { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/decoartors.ts.snap b/crates/biome_js_formatter/tests/specs/ts/decoartors.ts.snap index a9da6f2eebdd..1868de82f8a3 100644 --- a/crates/biome_js_formatter/tests/specs/ts/decoartors.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/decoartors.ts.snap @@ -277,6 +277,7 @@ class Foo { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/decorators/class_members.ts.snap b/crates/biome_js_formatter/tests/specs/ts/decorators/class_members.ts.snap index 00be0e6fe1bb..924dbac3d661 100644 --- a/crates/biome_js_formatter/tests/specs/ts/decorators/class_members.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/decorators/class_members.ts.snap @@ -111,6 +111,7 @@ class Foo { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/enum/enum_trailing_comma.ts.snap b/crates/biome_js_formatter/tests/specs/ts/enum/enum_trailing_comma.ts.snap index c161b646b570..bd7ac7794e28 100644 --- a/crates/biome_js_formatter/tests/specs/ts/enum/enum_trailing_comma.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/enum/enum_trailing_comma.ts.snap @@ -24,6 +24,7 @@ enum A { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -46,6 +47,7 @@ enum A { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -68,6 +70,7 @@ enum A { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/expression/as_expression.ts.snap b/crates/biome_js_formatter/tests/specs/ts/expression/as_expression.ts.snap index da35e8b007a8..575726b48445 100644 --- a/crates/biome_js_formatter/tests/specs/ts/expression/as_expression.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/expression/as_expression.ts.snap @@ -22,6 +22,7 @@ let b = ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/expression/non_null_expression.ts.snap b/crates/biome_js_formatter/tests/specs/ts/expression/non_null_expression.ts.snap index b5a64bf649b6..1c807aab3a6e 100644 --- a/crates/biome_js_formatter/tests/specs/ts/expression/non_null_expression.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/expression/non_null_expression.ts.snap @@ -20,6 +20,7 @@ let b = a !; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/expression/type_assertion_expression.ts.snap b/crates/biome_js_formatter/tests/specs/ts/expression/type_assertion_expression.ts.snap index 07a9a44b9cca..43cb75c3ecca 100644 --- a/crates/biome_js_formatter/tests/specs/ts/expression/type_assertion_expression.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/expression/type_assertion_expression.ts.snap @@ -25,6 +25,7 @@ var d = ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/expression/type_expression.ts.snap b/crates/biome_js_formatter/tests/specs/ts/expression/type_expression.ts.snap index bd9cb2c75bdb..21531b331922 100644 --- a/crates/biome_js_formatter/tests/specs/ts/expression/type_expression.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/expression/type_expression.ts.snap @@ -123,6 +123,7 @@ type Type01 = 0 extends ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/expression/type_member.ts.snap b/crates/biome_js_formatter/tests/specs/ts/expression/type_member.ts.snap index e021cf77cf83..093f0b65b3bb 100644 --- a/crates/biome_js_formatter/tests/specs/ts/expression/type_member.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/expression/type_member.ts.snap @@ -65,6 +65,7 @@ type K = { set something( something_with_long_name: string ) } ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/function/parameters/function_parameters.ts.snap b/crates/biome_js_formatter/tests/specs/ts/function/parameters/function_parameters.ts.snap index f9353a10ab20..9d4d90541a8b 100644 --- a/crates/biome_js_formatter/tests/specs/ts/function/parameters/function_parameters.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/function/parameters/function_parameters.ts.snap @@ -52,6 +52,7 @@ export const queryAuditLog = async ({ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -104,6 +105,7 @@ export const queryAuditLog = async ({ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 100 Quote style: Double Quotes JSX quote style: Double Quotes @@ -153,6 +155,7 @@ export const queryAuditLog = async ({ ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 120 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/function/trailing_comma/function_trailing_comma.ts.snap b/crates/biome_js_formatter/tests/specs/ts/function/trailing_comma/function_trailing_comma.ts.snap index 174509426d85..d07786f26c6a 100644 --- a/crates/biome_js_formatter/tests/specs/ts/function/trailing_comma/function_trailing_comma.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/function/trailing_comma/function_trailing_comma.ts.snap @@ -56,6 +56,7 @@ connect( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -112,6 +113,7 @@ connect( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -168,6 +170,7 @@ connect( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/module/export_clause.ts.snap b/crates/biome_js_formatter/tests/specs/ts/module/export_clause.ts.snap index 3a516f34dce2..5a45baf70c9e 100644 --- a/crates/biome_js_formatter/tests/specs/ts/module/export_clause.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/module/export_clause.ts.snap @@ -41,6 +41,7 @@ export type * as types from "types"; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/module/external_module_reference.ts.snap b/crates/biome_js_formatter/tests/specs/ts/module/external_module_reference.ts.snap index 14a6248846d6..e12eef694578 100644 --- a/crates/biome_js_formatter/tests/specs/ts/module/external_module_reference.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/module/external_module_reference.ts.snap @@ -22,6 +22,7 @@ import name2 = require('other_source') ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/module/module_declaration.ts.snap b/crates/biome_js_formatter/tests/specs/ts/module/module_declaration.ts.snap index de7755a00bc0..750d7d9471b3 100644 --- a/crates/biome_js_formatter/tests/specs/ts/module/module_declaration.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/module/module_declaration.ts.snap @@ -23,6 +23,7 @@ module qualified.name { } ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/module/qualified_module_name.ts.snap b/crates/biome_js_formatter/tests/specs/ts/module/qualified_module_name.ts.snap index 4154bbdba1fb..d8c5db4799fc 100644 --- a/crates/biome_js_formatter/tests/specs/ts/module/qualified_module_name.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/module/qualified_module_name.ts.snap @@ -20,6 +20,7 @@ module a . b . c { } ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/no-semi/class.ts.snap b/crates/biome_js_formatter/tests/specs/ts/no-semi/class.ts.snap index 3035567c4d3a..ea87ca06653b 100644 --- a/crates/biome_js_formatter/tests/specs/ts/no-semi/class.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/no-semi/class.ts.snap @@ -70,6 +70,7 @@ declare module test { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -138,6 +139,7 @@ declare module test { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/no-semi/non-null.ts.snap b/crates/biome_js_formatter/tests/specs/ts/no-semi/non-null.ts.snap index 1439b1232177..f023d1a83c4b 100644 --- a/crates/biome_js_formatter/tests/specs/ts/no-semi/non-null.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/no-semi/non-null.ts.snap @@ -22,6 +22,7 @@ const el = ReactDOM.findDOMNode(ref) ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -42,6 +43,7 @@ const el = ReactDOM.findDOMNode(ref); ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/no-semi/statements.ts.snap b/crates/biome_js_formatter/tests/specs/ts/no-semi/statements.ts.snap index e4f2c468997b..49836b3ee159 100644 --- a/crates/biome_js_formatter/tests/specs/ts/no-semi/statements.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/no-semi/statements.ts.snap @@ -33,6 +33,7 @@ declare let a; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -63,6 +64,7 @@ declare let a; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/no-semi/types.ts.snap b/crates/biome_js_formatter/tests/specs/ts/no-semi/types.ts.snap index 88d0fa880229..bb25a380cfeb 100644 --- a/crates/biome_js_formatter/tests/specs/ts/no-semi/types.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/no-semi/types.ts.snap @@ -32,6 +32,7 @@ type OptionsFlags = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -66,6 +67,7 @@ type OptionsFlags = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/object/object_trailing_comma.ts.snap b/crates/biome_js_formatter/tests/specs/ts/object/object_trailing_comma.ts.snap index 7626b8388be3..86e308978a0e 100644 --- a/crates/biome_js_formatter/tests/specs/ts/object/object_trailing_comma.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/object/object_trailing_comma.ts.snap @@ -41,6 +41,7 @@ const obj = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -79,6 +80,7 @@ const obj = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -117,6 +119,7 @@ const obj = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/parameters/parameters.ts.snap b/crates/biome_js_formatter/tests/specs/ts/parameters/parameters.ts.snap index 8fcad239ed20..694a2b218c6e 100644 --- a/crates/biome_js_formatter/tests/specs/ts/parameters/parameters.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/parameters/parameters.ts.snap @@ -21,6 +21,7 @@ function a( ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/parenthesis.ts.snap b/crates/biome_js_formatter/tests/specs/ts/parenthesis.ts.snap index 4a66cecf151d..3749a62d5e17 100644 --- a/crates/biome_js_formatter/tests/specs/ts/parenthesis.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/parenthesis.ts.snap @@ -28,6 +28,7 @@ type T5 = (keyof typeof obj)['toString']; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/statement/empty_block.ts.snap b/crates/biome_js_formatter/tests/specs/ts/statement/empty_block.ts.snap index 86df76671cd1..ca0c118bec7e 100644 --- a/crates/biome_js_formatter/tests/specs/ts/statement/empty_block.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/statement/empty_block.ts.snap @@ -20,6 +20,7 @@ type X = {}; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/statement/enum_statement.ts.snap b/crates/biome_js_formatter/tests/specs/ts/statement/enum_statement.ts.snap index c0f31f32491e..48028825a76b 100644 --- a/crates/biome_js_formatter/tests/specs/ts/statement/enum_statement.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/statement/enum_statement.ts.snap @@ -31,6 +31,7 @@ const enum C { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/string/parameter_quotes.ts.snap b/crates/biome_js_formatter/tests/specs/ts/string/parameter_quotes.ts.snap index 264018da1991..5e2be2bf7997 100644 --- a/crates/biome_js_formatter/tests/specs/ts/string/parameter_quotes.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/string/parameter_quotes.ts.snap @@ -54,6 +54,7 @@ const Y = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -106,6 +107,7 @@ const Y = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Single Quotes JSX quote style: Double Quotes @@ -158,6 +160,7 @@ const Y = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/suppressions.ts.snap b/crates/biome_js_formatter/tests/specs/ts/suppressions.ts.snap index 921e44b71be5..08edf18eaa46 100644 --- a/crates/biome_js_formatter/tests/specs/ts/suppressions.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/suppressions.ts.snap @@ -25,6 +25,7 @@ interface Suppressions { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/conditional.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/conditional.ts.snap index db0ebd0e83dd..581bc97eb37e 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/conditional.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/conditional.ts.snap @@ -35,6 +35,7 @@ type T4 = test extends string ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/import_type.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/import_type.ts.snap index 6bdd030ce61a..ad9690ffda08 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/import_type.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/import_type.ts.snap @@ -25,6 +25,7 @@ type QualifiedImportType = typeof import('source').Qualified; ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/intersection_type.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/intersection_type.ts.snap index ac0ad085eb81..00ce324c1b94 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/intersection_type.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/intersection_type.ts.snap @@ -77,6 +77,7 @@ type SoftBreakBetweenNotObjectTypeInChain = {} & SomeLongType & { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/mapped_type.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/mapped_type.ts.snap index 4c880157a824..f891028769ef 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/mapped_type.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/mapped_type.ts.snap @@ -26,6 +26,7 @@ export type OmitIndexSignature = { ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/qualified_name.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/qualified_name.ts.snap index 7bbcb1100cd0..d07d96842ebd 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/qualified_name.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/qualified_name.ts.snap @@ -19,6 +19,7 @@ type QualifiedType = A . B . C ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/template_type.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/template_type.ts.snap index 49d8978eca7e..74243538c0ef 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/template_type.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/template_type.ts.snap @@ -22,6 +22,7 @@ type TemplateType = ` ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/trailing-comma/type_trailing_comma.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/trailing-comma/type_trailing_comma.ts.snap index 363f3f242e16..1fc8e60f5aa7 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/trailing-comma/type_trailing_comma.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/trailing-comma/type_trailing_comma.ts.snap @@ -31,6 +31,7 @@ interface C< adsadasdasdasdasdasdasdasdasdasdas, ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -59,6 +60,7 @@ interface C< ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes @@ -87,6 +89,7 @@ interface C< ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/ts/type/union_type.ts.snap b/crates/biome_js_formatter/tests/specs/ts/type/union_type.ts.snap index 5390ebe24a15..8db8fd1ae9bf 100644 --- a/crates/biome_js_formatter/tests/specs/ts/type/union_type.ts.snap +++ b/crates/biome_js_formatter/tests/specs/ts/type/union_type.ts.snap @@ -265,6 +265,7 @@ type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla = ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_js_formatter/tests/specs/tsx/smoke.tsx.snap b/crates/biome_js_formatter/tests/specs/tsx/smoke.tsx.snap index e56b9db449d6..d85b6f753f7f 100644 --- a/crates/biome_js_formatter/tests/specs/tsx/smoke.tsx.snap +++ b/crates/biome_js_formatter/tests/specs/tsx/smoke.tsx.snap @@ -19,6 +19,7 @@ info: tsx/smoke.tsx ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes diff --git a/crates/biome_json_formatter/src/context.rs b/crates/biome_json_formatter/src/context.rs index 434291d8267e..8cd3857446e0 100644 --- a/crates/biome_json_formatter/src/context.rs +++ b/crates/biome_json_formatter/src/context.rs @@ -1,7 +1,8 @@ use crate::JsonCommentStyle; use biome_formatter::{prelude::*, IndentWidth}; use biome_formatter::{ - CstFormatContext, FormatContext, FormatOptions, IndentStyle, LineWidth, TransformSourceMap, + CstFormatContext, FormatContext, FormatOptions, IndentStyle, LineEnding, LineWidth, + TransformSourceMap, }; use crate::comments::{FormatJsonLeadingComment, JsonComments}; @@ -58,6 +59,7 @@ impl CstFormatContext for JsonFormatContext { pub struct JsonFormatOptions { indent_style: IndentStyle, indent_width: IndentWidth, + line_ending: LineEnding, line_width: LineWidth, _file_source: JsonFileSource, } @@ -68,6 +70,7 @@ impl JsonFormatOptions { _file_source: file_source, indent_style: IndentStyle::default(), indent_width: IndentWidth::default(), + line_ending: LineEnding::default(), line_width: LineWidth::default(), } } @@ -82,6 +85,11 @@ impl JsonFormatOptions { self } + pub fn with_line_ending(mut self, line_ending: LineEnding) -> Self { + self.line_ending = line_ending; + self + } + pub fn with_line_width(mut self, line_width: LineWidth) -> Self { self.line_width = line_width; self @@ -95,6 +103,10 @@ impl JsonFormatOptions { self.indent_width = indent_width; } + pub fn set_line_ending(&mut self, line_ending: LineEnding) { + self.line_ending = line_ending; + } + pub fn set_line_width(&mut self, line_width: LineWidth) { self.line_width = line_width; } @@ -109,6 +121,10 @@ impl FormatOptions for JsonFormatOptions { self.indent_width } + fn line_ending(&self) -> LineEnding { + self.line_ending + } + fn line_width(&self) -> LineWidth { self.line_width } @@ -122,6 +138,7 @@ impl fmt::Display for JsonFormatOptions { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!(f, "Indent style: {}", self.indent_style)?; writeln!(f, "Indent width: {}", self.indent_width.value())?; + writeln!(f, "Line ending: {}", self.line_ending)?; writeln!(f, "Line width: {}", self.line_width.get()) } } diff --git a/crates/biome_json_formatter/tests/language.rs b/crates/biome_json_formatter/tests/language.rs index 0ae770e5cb62..b70335d30e76 100644 --- a/crates/biome_json_formatter/tests/language.rs +++ b/crates/biome_json_formatter/tests/language.rs @@ -1,4 +1,6 @@ -use biome_formatter::{FormatContext, FormatResult, Formatted, IndentStyle, LineWidth, Printed}; +use biome_formatter::{ + FormatContext, FormatResult, Formatted, IndentStyle, LineEnding, LineWidth, Printed, +}; use biome_formatter_test::TestFormatLanguage; use biome_json_formatter::context::{JsonFormatContext, JsonFormatOptions}; use biome_json_formatter::{format_node, format_range, JsonFormatLanguage}; @@ -77,6 +79,28 @@ impl From for IndentStyle { } } +#[derive(Debug, Eq, PartialEq, Clone, Copy, Deserialize, Serialize)] +pub enum JsonSerializableLineEnding { + /// Line Feed only (\n), common on Linux and macOS as well as inside git repos + Lf, + + /// Carriage Return + Line Feed characters (\r\n), common on Windows + Crlf, + + /// Carriage Return character only (\r), used very rarely + Cr, +} + +impl From for LineEnding { + fn from(test: JsonSerializableLineEnding) -> Self { + match test { + JsonSerializableLineEnding::Lf => LineEnding::Lf, + JsonSerializableLineEnding::Crlf => LineEnding::Crlf, + JsonSerializableLineEnding::Cr => LineEnding::Cr, + } + } +} + #[derive(Debug, Deserialize, Serialize, Clone, Copy)] pub struct JsonSerializableFormatOptions { /// The indent style. @@ -85,6 +109,9 @@ pub struct JsonSerializableFormatOptions { /// The indent width. pub indent_width: Option, + /// The type of line ending. + pub line_ending: Option, + /// What's the max width of a line. Defaults to 80. pub line_width: Option, } diff --git a/crates/biome_json_formatter/tests/specs/json/array/empty_line.json.snap b/crates/biome_json_formatter/tests/specs/json/array/empty_line.json.snap index 64a402ac3554..a37ea63b5bcd 100644 --- a/crates/biome_json_formatter/tests/specs/json/array/empty_line.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/array/empty_line.json.snap @@ -26,6 +26,7 @@ info: json/array/empty_line.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/array/fill_layout.json.snap b/crates/biome_json_formatter/tests/specs/json/array/fill_layout.json.snap index 27246bd77e52..7442a1e8b526 100644 --- a/crates/biome_json_formatter/tests/specs/json/array/fill_layout.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/array/fill_layout.json.snap @@ -22,6 +22,7 @@ info: json/array/fill_layout.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/array/layout.json.snap b/crates/biome_json_formatter/tests/specs/json/array/layout.json.snap index 7cc9fbcee836..9db0223d7184 100644 --- a/crates/biome_json_formatter/tests/specs/json/array/layout.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/array/layout.json.snap @@ -30,6 +30,7 @@ info: json/array/layout.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/array/multi_line.json.snap b/crates/biome_json_formatter/tests/specs/json/array/multi_line.json.snap index adf3c3cf3eeb..60c8539466a1 100644 --- a/crates/biome_json_formatter/tests/specs/json/array/multi_line.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/array/multi_line.json.snap @@ -26,6 +26,7 @@ info: json/array/multi_line.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/array/nested.json.snap b/crates/biome_json_formatter/tests/specs/json/array/nested.json.snap index a0ca085d174f..0d21d2b59f83 100644 --- a/crates/biome_json_formatter/tests/specs/json/array/nested.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/array/nested.json.snap @@ -22,6 +22,7 @@ info: json/array/nested.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/array/one_per_line_layout.json.snap b/crates/biome_json_formatter/tests/specs/json/array/one_per_line_layout.json.snap index 2988790f8f3a..eb972e2d261f 100644 --- a/crates/biome_json_formatter/tests/specs/json/array/one_per_line_layout.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/array/one_per_line_layout.json.snap @@ -30,6 +30,7 @@ info: json/array/one_per_line_layout.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/array/single_line.json.snap b/crates/biome_json_formatter/tests/specs/json/array/single_line.json.snap index 457c0aa9031f..519500c004b9 100644 --- a/crates/biome_json_formatter/tests/specs/json/array/single_line.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/array/single_line.json.snap @@ -27,6 +27,7 @@ info: json/array/single_line.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/comments/multiline.json.snap b/crates/biome_json_formatter/tests/specs/json/comments/multiline.json.snap index c9b7e609e5d0..1820ce2f24ee 100644 --- a/crates/biome_json_formatter/tests/specs/json/comments/multiline.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/comments/multiline.json.snap @@ -35,6 +35,7 @@ info: json/comments/multiline.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/empty.json.snap b/crates/biome_json_formatter/tests/specs/json/empty.json.snap index d13037774f16..2242c449a75e 100644 --- a/crates/biome_json_formatter/tests/specs/json/empty.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/empty.json.snap @@ -19,6 +19,7 @@ info: json/empty.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/number.json.snap b/crates/biome_json_formatter/tests/specs/json/number.json.snap index 4a0d1c1d197a..5e86cd2bb084 100644 --- a/crates/biome_json_formatter/tests/specs/json/number.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/number.json.snap @@ -46,6 +46,7 @@ info: json/number.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/object/complex.json.snap b/crates/biome_json_formatter/tests/specs/json/object/complex.json.snap index 86b4d859523a..ab5dba656b18 100644 --- a/crates/biome_json_formatter/tests/specs/json/object/complex.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/object/complex.json.snap @@ -26,6 +26,7 @@ info: json/object/complex.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/object/missing_value.json.snap b/crates/biome_json_formatter/tests/specs/json/object/missing_value.json.snap index 29e9fac24550..524d86c6977d 100644 --- a/crates/biome_json_formatter/tests/specs/json/object/missing_value.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/object/missing_value.json.snap @@ -28,6 +28,7 @@ info: json/object/missing_value.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/object/multi_line.json.snap b/crates/biome_json_formatter/tests/specs/json/object/multi_line.json.snap index 2abfa43cbd9e..4fdf735e8dd7 100644 --- a/crates/biome_json_formatter/tests/specs/json/object/multi_line.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/object/multi_line.json.snap @@ -23,6 +23,7 @@ info: json/object/multi_line.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/object/multi_line_long.json.snap b/crates/biome_json_formatter/tests/specs/json/object/multi_line_long.json.snap index dcc320ccd021..6e8255ddb0d1 100644 --- a/crates/biome_json_formatter/tests/specs/json/object/multi_line_long.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/object/multi_line_long.json.snap @@ -23,6 +23,7 @@ info: json/object/multi_line_long.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/object/one_line.json.snap b/crates/biome_json_formatter/tests/specs/json/object/one_line.json.snap index 4a232b3ad196..d6093e8efb49 100644 --- a/crates/biome_json_formatter/tests/specs/json/object/one_line.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/object/one_line.json.snap @@ -20,6 +20,7 @@ info: json/object/one_line.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/object/one_line_long.json.snap b/crates/biome_json_formatter/tests/specs/json/object/one_line_long.json.snap index b0bfe1709747..57b0dcdd4f7c 100644 --- a/crates/biome_json_formatter/tests/specs/json/object/one_line_long.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/object/one_line_long.json.snap @@ -20,6 +20,7 @@ info: json/object/one_line_long.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/object/string.json.snap b/crates/biome_json_formatter/tests/specs/json/object/string.json.snap index c75b1a817a70..23b51b82606a 100644 --- a/crates/biome_json_formatter/tests/specs/json/object/string.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/object/string.json.snap @@ -25,6 +25,7 @@ info: json/object/string.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/smoke.json.snap b/crates/biome_json_formatter/tests/specs/json/smoke.json.snap index d35b6885f33a..249ef1c9b39b 100644 --- a/crates/biome_json_formatter/tests/specs/json/smoke.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/smoke.json.snap @@ -26,6 +26,7 @@ info: json/smoke.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_json_formatter/tests/specs/json/undefined/utf8_bom_empty_object.json.snap b/crates/biome_json_formatter/tests/specs/json/undefined/utf8_bom_empty_object.json.snap index 2675ea551832..f01ed893e354 100644 --- a/crates/biome_json_formatter/tests/specs/json/undefined/utf8_bom_empty_object.json.snap +++ b/crates/biome_json_formatter/tests/specs/json/undefined/utf8_bom_empty_object.json.snap @@ -19,6 +19,7 @@ info: json/undefined/utf8_bom_empty_object.json ----- Indent style: Tab Indent width: 2 +Line ending: LF Line width: 80 ----- diff --git a/crates/biome_service/src/configuration/formatter.rs b/crates/biome_service/src/configuration/formatter.rs index bd990356fd98..bc51bc1034e5 100644 --- a/crates/biome_service/src/configuration/formatter.rs +++ b/crates/biome_service/src/configuration/formatter.rs @@ -3,7 +3,7 @@ use crate::configuration::overrides::OverrideFormatterConfiguration; use crate::settings::{to_matcher, FormatSettings}; use crate::WorkspaceError; use biome_deserialize::StringSet; -use biome_formatter::{IndentStyle, LineWidth}; +use biome_formatter::{IndentStyle, LineEnding, LineWidth}; use bpaf::Bpaf; use serde::{Deserialize, Serialize}; use std::str::FromStr; @@ -37,6 +37,11 @@ pub struct FormatterConfiguration { #[bpaf(long("indent-width"), argument("NUMBER"), optional)] pub indent_width: Option, + /// The type of line ending. + #[serde(skip_serializing_if = "Option::is_none")] + #[bpaf(long("line-ending"), argument("lf|crlf|cr"), optional)] + pub line_ending: Option, + /// What's the max width of a line. Defaults to 80. #[serde( deserialize_with = "deserialize_line_width", @@ -72,6 +77,7 @@ impl Default for FormatterConfiguration { indent_size: Some(2), indent_width: Some(2), indent_style: Some(PlainIndentStyle::default()), + line_ending: Some(LineEnding::default()), line_width: Some(LineWidth::default()), ignore: None, include: None, @@ -102,7 +108,9 @@ impl MergeWith for FormatterConfiguration { if let Some(indent_style) = other.indent_style { self.indent_style = Some(indent_style); } - + if let Some(line_ending) = other.line_ending { + self.line_ending = Some(line_ending); + } if let Some(line_width) = other.line_width { self.line_width = Some(line_width); } @@ -148,6 +156,7 @@ impl TryFrom for FormatSettings { enabled: conf.enabled.unwrap_or_default(), indent_style: Some(indent_style), indent_width: Some(indent_width), + line_ending: conf.line_ending, line_width: conf.line_width, format_with_errors: conf.format_with_errors.unwrap_or_default(), ignored_files: to_matcher(conf.ignore.as_ref())?, @@ -175,6 +184,7 @@ impl TryFrom for FormatSettings { enabled: conf.enabled.unwrap_or_default(), indent_style: Some(indent_style), indent_width: Some(indent_width), + line_ending: conf.line_ending, line_width: conf.line_width, format_with_errors: conf.format_with_errors.unwrap_or_default(), ignored_files: None, diff --git a/crates/biome_service/src/configuration/javascript/formatter.rs b/crates/biome_service/src/configuration/javascript/formatter.rs index b3fe7068c8be..364b2f36d615 100644 --- a/crates/biome_service/src/configuration/javascript/formatter.rs +++ b/crates/biome_service/src/configuration/javascript/formatter.rs @@ -1,7 +1,7 @@ use crate::configuration::PlainIndentStyle; use crate::configuration::{deserialize_line_width, serialize_line_width}; use crate::MergeWith; -use biome_formatter::LineWidth; +use biome_formatter::{LineEnding, LineWidth}; use biome_js_formatter::context::trailing_comma::TrailingComma; use biome_js_formatter::context::{ArrowParentheses, QuoteProperties, QuoteStyle, Semicolons}; use bpaf::Bpaf; @@ -65,7 +65,16 @@ pub struct JavascriptFormatter { )] pub indent_width: Option, - /// What's the max width of a line, applied to JavaScript (and its super languages) files. Defaults to 80. + /// The type of line ending applied to JavaScript (and its super languages) files. + #[serde(skip_serializing_if = "Option::is_none")] + #[bpaf( + long("javascript-formatter-line-ending"), + argument("lf|crlf|cr"), + optional + )] + pub line_ending: Option, + + /// What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. #[serde( deserialize_with = "deserialize_line_width", serialize_with = "serialize_line_width" diff --git a/crates/biome_service/src/configuration/json.rs b/crates/biome_service/src/configuration/json.rs index 506e9774b5cd..56151bf5384c 100644 --- a/crates/biome_service/src/configuration/json.rs +++ b/crates/biome_service/src/configuration/json.rs @@ -1,6 +1,6 @@ use crate::configuration::merge::MergeWith; use crate::configuration::{deserialize_line_width, serialize_line_width, PlainIndentStyle}; -use biome_formatter::LineWidth; +use biome_formatter::{LineEnding, LineWidth}; use bpaf::Bpaf; use serde::{Deserialize, Serialize}; @@ -101,7 +101,12 @@ pub struct JsonFormatter { #[bpaf(long("json-formatter-indent-size"), argument("NUMBER"), optional)] pub indent_size: Option, - /// What's the max width of a line, applied to JSON (and its super languages) files. Defaults to 80. + /// The type of line ending applied to JSON (and its super languages) files. + #[serde(skip_serializing_if = "Option::is_none")] + #[bpaf(long("json-formatter-line-ending"), argument("lf|crlf|cr"), optional)] + pub line_ending: Option, + + /// What's the max width of a line applied to JSON (and its super languages) files. Defaults to 80. #[serde( deserialize_with = "deserialize_line_width", serialize_with = "serialize_line_width" diff --git a/crates/biome_service/src/configuration/overrides.rs b/crates/biome_service/src/configuration/overrides.rs index 59b7920cdb34..8a7a4f097f33 100644 --- a/crates/biome_service/src/configuration/overrides.rs +++ b/crates/biome_service/src/configuration/overrides.rs @@ -10,7 +10,7 @@ use crate::settings::{ }; use crate::{MergeWith, Rules, WorkspaceError}; use biome_deserialize::StringSet; -use biome_formatter::{IndentStyle, LineWidth}; +use biome_formatter::{IndentStyle, LineEnding, LineWidth}; use bpaf::Bpaf; use serde::{Deserialize, Serialize}; use std::str::FromStr; @@ -215,6 +215,11 @@ pub struct OverrideFormatterConfiguration { #[bpaf(long("indent-width"), argument("NUMBER"), optional)] pub indent_width: Option, + /// The type of line ending. + #[serde(skip_serializing_if = "Option::is_none")] + #[bpaf(long("line-ending"), argument("lf|crlf|cr"), optional)] + pub line_ending: Option, + /// What's the max width of a line. Defaults to 80. #[serde( deserialize_with = "deserialize_line_width", @@ -379,6 +384,7 @@ impl TryFrom for OverrideFormatSettings { enabled: conf.enabled, indent_style: Some(indent_style), indent_width: Some(indent_width), + line_ending: conf.line_ending, line_width: conf.line_width, format_with_errors: conf.format_with_errors.unwrap_or_default(), }) diff --git a/crates/biome_service/src/configuration/parse/json/formatter.rs b/crates/biome_service/src/configuration/parse/json/formatter.rs index cda3e6dad9fe..f39c0f2adf22 100644 --- a/crates/biome_service/src/configuration/parse/json/formatter.rs +++ b/crates/biome_service/src/configuration/parse/json/formatter.rs @@ -34,6 +34,7 @@ impl DeserializationVisitor for FormatterConfigurationVisitor { "indentStyle", "indentSize", "indentWidth", + "lineEnding", "lineWidth", "ignore", "include", @@ -70,6 +71,10 @@ impl DeserializationVisitor for FormatterConfigurationVisitor { result.indent_width = Deserializable::deserialize(&value, &key_text, diagnostics); } + "lineEnding" => { + result.line_ending = + Deserializable::deserialize(&value, &key_text, diagnostics); + } "lineWidth" => { result.line_width = Deserializable::deserialize(&value, &key_text, diagnostics); } diff --git a/crates/biome_service/src/configuration/parse/json/javascript/formatter.rs b/crates/biome_service/src/configuration/parse/json/javascript/formatter.rs index afadd21e212a..d08e6618c403 100644 --- a/crates/biome_service/src/configuration/parse/json/javascript/formatter.rs +++ b/crates/biome_service/src/configuration/parse/json/javascript/formatter.rs @@ -38,6 +38,7 @@ impl DeserializationVisitor for JavascriptFormatterVisitor { "indentStyle", "indentSize", "indentWidth", + "lineEnding", "lineWidth", ]; let mut result = Self::Output::default(); @@ -90,6 +91,10 @@ impl DeserializationVisitor for JavascriptFormatterVisitor { result.indent_width = Deserializable::deserialize(&value, &key_text, diagnostics); } + "lineEnding" => { + result.line_ending = + Deserializable::deserialize(&value, &key_text, diagnostics); + } "lineWidth" => { result.line_width = Deserializable::deserialize(&value, &key_text, diagnostics); } diff --git a/crates/biome_service/src/configuration/parse/json/json_impl/mod.rs b/crates/biome_service/src/configuration/parse/json/json_impl/mod.rs index ad259198803c..61dd97ab89f1 100644 --- a/crates/biome_service/src/configuration/parse/json/json_impl/mod.rs +++ b/crates/biome_service/src/configuration/parse/json/json_impl/mod.rs @@ -132,6 +132,7 @@ impl DeserializationVisitor for JsonFormatterVisitor { "indentStyle", "indentSize", "indentWidth", + "lineEnding", "lineWidth", ]; let mut result = Self::Output::default(); @@ -160,6 +161,10 @@ impl DeserializationVisitor for JsonFormatterVisitor { result.indent_width = Deserializable::deserialize(&value, &key_text, diagnostics); } + "lineEnding" => { + result.line_ending = + Deserializable::deserialize(&value, &key_text, diagnostics); + } "lineWidth" => { result.line_width = Deserializable::deserialize(&value, &key_text, diagnostics); } diff --git a/crates/biome_service/src/configuration/parse/json/overrides.rs b/crates/biome_service/src/configuration/parse/json/overrides.rs index ec98b7392a31..0cd80ea615fb 100644 --- a/crates/biome_service/src/configuration/parse/json/overrides.rs +++ b/crates/biome_service/src/configuration/parse/json/overrides.rs @@ -121,6 +121,7 @@ impl DeserializationVisitor for OverrideFormatterConfigurationVisitor { "indentStyle", "indentSize", "indentWidth", + "lineEnding", "lineWidth", ]; let mut result = Self::Output::default(); @@ -149,6 +150,10 @@ impl DeserializationVisitor for OverrideFormatterConfigurationVisitor { result.indent_width = Deserializable::deserialize(&value, &key_text, diagnostics); } + "lineEnding" => { + result.line_ending = + Deserializable::deserialize(&value, &key_text, diagnostics); + } "lineWidth" => { result.line_width = Deserializable::deserialize(&value, &key_text, diagnostics); } diff --git a/crates/biome_service/src/file_handlers/javascript.rs b/crates/biome_service/src/file_handlers/javascript.rs index 945fa95e310a..ebaf3a7e723b 100644 --- a/crates/biome_service/src/file_handlers/javascript.rs +++ b/crates/biome_service/src/file_handlers/javascript.rs @@ -19,7 +19,7 @@ use biome_analyze::{ QueryMatch, RegistryVisitor, RuleCategories, RuleCategory, RuleFilter, RuleGroup, }; use biome_diagnostics::{category, Applicability, Diagnostic, DiagnosticExt, Severity}; -use biome_formatter::{FormatError, IndentStyle, IndentWidth, LineWidth, Printed}; +use biome_formatter::{FormatError, IndentStyle, IndentWidth, LineEnding, LineWidth, Printed}; use biome_fs::RomePath; use biome_js_analyze::utils::rename::{RenameError, RenameSymbolExtensions}; use biome_js_analyze::{ @@ -53,6 +53,7 @@ pub struct JsFormatterSettings { pub trailing_comma: Option, pub semicolons: Option, pub arrow_parentheses: Option, + pub line_ending: Option, pub line_width: Option, pub indent_width: Option, pub indent_style: Option, diff --git a/crates/biome_service/src/file_handlers/json.rs b/crates/biome_service/src/file_handlers/json.rs index 86137839ae74..f54fe4f1f11d 100644 --- a/crates/biome_service/src/file_handlers/json.rs +++ b/crates/biome_service/src/file_handlers/json.rs @@ -17,7 +17,7 @@ use crate::{Configuration, Rules, WorkspaceError}; use biome_analyze::{AnalyzerConfiguration, AnalyzerOptions, ControlFlow, Never, RuleCategories}; use biome_deserialize::json::deserialize_from_json_ast; use biome_diagnostics::{category, Diagnostic, DiagnosticExt, Severity}; -use biome_formatter::{FormatError, IndentStyle, IndentWidth, LineWidth, Printed}; +use biome_formatter::{FormatError, IndentStyle, IndentWidth, LineEnding, LineWidth, Printed}; use biome_fs::{RomePath, BIOME_JSON, ROME_JSON}; use biome_json_analyze::analyze; use biome_json_formatter::context::JsonFormatOptions; @@ -32,6 +32,7 @@ use std::path::{Path, PathBuf}; #[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] pub struct JsonFormatterSettings { + pub line_ending: Option, pub line_width: Option, pub indent_width: Option, pub indent_style: Option, diff --git a/crates/biome_service/src/settings.rs b/crates/biome_service/src/settings.rs index ee3d4ccd1590..24ec2357a05d 100644 --- a/crates/biome_service/src/settings.rs +++ b/crates/biome_service/src/settings.rs @@ -6,7 +6,7 @@ use crate::{ use biome_analyze::{AnalyzerRules, RuleFilter}; use biome_deserialize::StringSet; use biome_diagnostics::Category; -use biome_formatter::{IndentStyle, IndentWidth, LineWidth}; +use biome_formatter::{IndentStyle, IndentWidth, LineEnding, LineWidth}; use biome_fs::RomePath; use biome_js_analyze::metadata; use biome_js_formatter::context::JsFormatOptions; @@ -146,6 +146,7 @@ pub struct FormatSettings { pub format_with_errors: bool, pub indent_style: Option, pub indent_width: Option, + pub line_ending: Option, pub line_width: Option, /// List of ignore paths/files pub ignored_files: Option, @@ -160,6 +161,7 @@ impl Default for FormatSettings { format_with_errors: false, indent_style: Some(IndentStyle::default()), indent_width: Some(IndentWidth::default()), + line_ending: Some(LineEnding::default()), line_width: Some(LineWidth::default()), ignored_files: None, included_files: None, @@ -177,6 +179,7 @@ pub struct OverrideFormatSettings { pub format_with_errors: bool, pub indent_style: Option, pub indent_width: Option, + pub line_ending: Option, pub line_width: Option, } diff --git a/crates/biome_service/tests/invalid/formatter_extraneous_field.json.snap b/crates/biome_service/tests/invalid/formatter_extraneous_field.json.snap index 46b95186618b..09767813aa7f 100644 --- a/crates/biome_service/tests/invalid/formatter_extraneous_field.json.snap +++ b/crates/biome_service/tests/invalid/formatter_extraneous_field.json.snap @@ -20,6 +20,7 @@ formatter_extraneous_field.json:3:3 deserialize ━━━━━━━━━━ - indentStyle - indentSize - indentWidth + - lineEnding - lineWidth - ignore - include diff --git a/crates/biome_service/tests/valid/base_options_inside_javascript.json b/crates/biome_service/tests/valid/base_options_inside_javascript.json index 1accfd53c0c3..7e07a444419a 100644 --- a/crates/biome_service/tests/valid/base_options_inside_javascript.json +++ b/crates/biome_service/tests/valid/base_options_inside_javascript.json @@ -8,6 +8,7 @@ "enabled": true, "indentStyle": "space", "indentSize": 2, + "lineEnding": "lf", "lineWidth": 200 } } diff --git a/crates/biome_service/tests/valid/base_options_inside_json.json b/crates/biome_service/tests/valid/base_options_inside_json.json index e5ce71a2d0b3..302c996d2238 100644 --- a/crates/biome_service/tests/valid/base_options_inside_json.json +++ b/crates/biome_service/tests/valid/base_options_inside_json.json @@ -8,6 +8,7 @@ "enabled": true, "indentStyle": "space", "indentSize": 2, + "lineEnding": "lf", "lineWidth": 200 } } diff --git a/editors/vscode/configuration_schema.json b/editors/vscode/configuration_schema.json index 034f52fec7e5..251e2563b0c0 100644 --- a/editors/vscode/configuration_schema.json +++ b/editors/vscode/configuration_schema.json @@ -757,6 +757,11 @@ "format": "uint8", "minimum": 0.0 }, + "lineEnding": { + "description": "The type of line ending.", + "default": "lf", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { "description": "What's the max width of a line. Defaults to 80.", "default": 80, @@ -867,8 +872,12 @@ "description": "The type of quotes used in JSX. Defaults to double.", "anyOf": [{ "$ref": "#/definitions/QuoteStyle" }, { "type": "null" }] }, + "lineEnding": { + "description": "The type of line ending applied to JavaScript (and its super languages) files.", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { - "description": "What's the max width of a line, applied to JavaScript (and its super languages) files. Defaults to 80.", + "description": "What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80.", "anyOf": [{ "$ref": "#/definitions/LineWidth" }, { "type": "null" }] }, "quoteProperties": { @@ -955,8 +964,12 @@ "format": "uint8", "minimum": 0.0 }, + "lineEnding": { + "description": "The type of line ending applied to JSON (and its super languages) files.", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { - "description": "What's the max width of a line, applied to JSON (and its super languages) files. Defaults to 80.", + "description": "What's the max width of a line applied to JSON (and its super languages) files. Defaults to 80.", "anyOf": [{ "$ref": "#/definitions/LineWidth" }, { "type": "null" }] } }, @@ -977,6 +990,25 @@ }, "additionalProperties": false }, + "LineEnding": { + "oneOf": [ + { + "description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos", + "type": "string", + "enum": ["lf"] + }, + { + "description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows", + "type": "string", + "enum": ["crlf"] + }, + { + "description": "Carriage Return character only (\\r), used very rarely", + "type": "string", + "enum": ["cr"] + } + ] + }, "LineWidth": { "description": "Validated value for the `line_width` formatter options\n\nThe allowed range of values is 1..=320", "type": "integer", @@ -1244,6 +1276,10 @@ "format": "uint8", "minimum": 0.0 }, + "lineEnding": { + "description": "The type of line ending.", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { "description": "What's the max width of a line. Defaults to 80.", "default": 80, diff --git a/packages/@biomejs/backend-jsonrpc/src/workspace.ts b/packages/@biomejs/backend-jsonrpc/src/workspace.ts index d977e2fad5d5..e8426cee9197 100644 --- a/packages/@biomejs/backend-jsonrpc/src/workspace.ts +++ b/packages/@biomejs/backend-jsonrpc/src/workspace.ts @@ -115,6 +115,10 @@ export interface FormatterConfiguration { * The size of the indentation, 2 by default */ indentWidth?: number; + /** + * The type of line ending. + */ + lineEnding?: LineEnding; /** * What's the max width of a line. Defaults to 80. */ @@ -210,6 +214,7 @@ If Biome can't find the configuration, it will attempt to use the current workin useIgnoreFile?: boolean; } export type PlainIndentStyle = "tab" | "space"; +export type LineEnding = "lf" | "crlf" | "cr"; /** * Validated value for the `line_width` formatter options @@ -245,7 +250,11 @@ export interface JavascriptFormatter { */ jsxQuoteStyle?: QuoteStyle; /** - * What's the max width of a line, applied to JavaScript (and its super languages) files. Defaults to 80. + * The type of line ending applied to JavaScript (and its super languages) files. + */ + lineEnding?: LineEnding; + /** + * What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. */ lineWidth?: LineWidth; /** @@ -295,7 +304,11 @@ export interface JsonFormatter { */ indentWidth?: number; /** - * What's the max width of a line, applied to JSON (and its super languages) files. Defaults to 80. + * The type of line ending applied to JSON (and its super languages) files. + */ + lineEnding?: LineEnding; + /** + * What's the max width of a line applied to JSON (and its super languages) files. Defaults to 80. */ lineWidth?: LineWidth; } @@ -1195,6 +1208,10 @@ export interface OverrideFormatterConfiguration { * The size of the indentation, 2 by default */ indentWidth?: number; + /** + * The type of line ending. + */ + lineEnding?: LineEnding; /** * What's the max width of a line. Defaults to 80. */ diff --git a/packages/@biomejs/biome/configuration_schema.json b/packages/@biomejs/biome/configuration_schema.json index 034f52fec7e5..251e2563b0c0 100644 --- a/packages/@biomejs/biome/configuration_schema.json +++ b/packages/@biomejs/biome/configuration_schema.json @@ -757,6 +757,11 @@ "format": "uint8", "minimum": 0.0 }, + "lineEnding": { + "description": "The type of line ending.", + "default": "lf", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { "description": "What's the max width of a line. Defaults to 80.", "default": 80, @@ -867,8 +872,12 @@ "description": "The type of quotes used in JSX. Defaults to double.", "anyOf": [{ "$ref": "#/definitions/QuoteStyle" }, { "type": "null" }] }, + "lineEnding": { + "description": "The type of line ending applied to JavaScript (and its super languages) files.", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { - "description": "What's the max width of a line, applied to JavaScript (and its super languages) files. Defaults to 80.", + "description": "What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80.", "anyOf": [{ "$ref": "#/definitions/LineWidth" }, { "type": "null" }] }, "quoteProperties": { @@ -955,8 +964,12 @@ "format": "uint8", "minimum": 0.0 }, + "lineEnding": { + "description": "The type of line ending applied to JSON (and its super languages) files.", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { - "description": "What's the max width of a line, applied to JSON (and its super languages) files. Defaults to 80.", + "description": "What's the max width of a line applied to JSON (and its super languages) files. Defaults to 80.", "anyOf": [{ "$ref": "#/definitions/LineWidth" }, { "type": "null" }] } }, @@ -977,6 +990,25 @@ }, "additionalProperties": false }, + "LineEnding": { + "oneOf": [ + { + "description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos", + "type": "string", + "enum": ["lf"] + }, + { + "description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows", + "type": "string", + "enum": ["crlf"] + }, + { + "description": "Carriage Return character only (\\r), used very rarely", + "type": "string", + "enum": ["cr"] + } + ] + }, "LineWidth": { "description": "Validated value for the `line_width` formatter options\n\nThe allowed range of values is 1..=320", "type": "integer", @@ -1244,6 +1276,10 @@ "format": "uint8", "minimum": 0.0 }, + "lineEnding": { + "description": "The type of line ending.", + "anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }] + }, "lineWidth": { "description": "What's the max width of a line. Defaults to 80.", "default": 80, diff --git a/website/src/content/docs/internals/changelog.mdx b/website/src/content/docs/internals/changelog.mdx index 17028cb936cc..1426dc3d62d2 100644 --- a/website/src/content/docs/internals/changelog.mdx +++ b/website/src/content/docs/internals/changelog.mdx @@ -35,6 +35,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom ### Formatter +#### New features + +- Add a new option [`--line-ending`](https://biomejs.dev/reference/configuration/#formatterlineending). This option allows changing the type of line endings. Contributed by @SuperchupuDev + #### Bug fixes - Fix [#301](https://github.com/biomejs/biome/issues/301), the formatter should not break before the `in` keyword. Contributed by @ematipico