Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec-ant committed Jun 30, 2024
1 parent 80db420 commit ddaf359
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 48 deletions.
12 changes: 2 additions & 10 deletions crates/biome_js_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,7 @@ mod tests {
}
";

let parsed = parse(
SOURCE,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let parsed = parse(SOURCE, JsFileSource::js_module(), JsParseOptions::default());

let mut lint_ranges: Vec<TextRange> = Vec::new();
let mut parse_ranges: Vec<TextRange> = Vec::new();
Expand Down Expand Up @@ -391,11 +387,7 @@ mod tests {
a == b;
";

let parsed = parse(
SOURCE,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let parsed = parse(SOURCE, JsFileSource::js_module(), JsParseOptions::default());

let filter = AnalysisFilter {
categories: RuleCategoriesBuilder::default().with_syntax().build(),
Expand Down
24 changes: 4 additions & 20 deletions crates/biome_js_analyze/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ mod test {
#[test]
fn find_variable_position_matches_on_left() {
let source = "(a) + b";
let parsed = parse(
source,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let parsed = parse(source, JsFileSource::js_module(), JsParseOptions::default());

let binary_expression = parsed
.syntax()
Expand All @@ -145,11 +141,7 @@ mod test {
#[test]
fn find_variable_position_matches_on_right() {
let source = "a + b";
let parsed = parse(
source,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let parsed = parse(source, JsFileSource::js_module(), JsParseOptions::default());

let binary_expression = parsed
.syntax()
Expand All @@ -168,11 +160,7 @@ mod test {
#[test]
fn find_variable_position_not_match() {
let source = "a + b";
let parsed = parse(
source,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let parsed = parse(source, JsFileSource::js_module(), JsParseOptions::default());

let binary_expression = parsed
.syntax()
Expand All @@ -191,11 +179,7 @@ mod test {
#[test]
fn find_variable_position_when_the_operator_has_no_spaces_around() {
let source = "l-c";
let parsed = parse(
source,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let parsed = parse(source, JsFileSource::js_module(), JsParseOptions::default());

let binary_expression = parsed
.syntax()
Expand Down
18 changes: 3 additions & 15 deletions crates/biome_js_analyze/src/utils/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ use std::{any::type_name, fmt::Debug};
/// Search and renames alls bindings where the name contains "a" replacing it to "b".
/// Asserts the renaming worked.
pub fn assert_rename_binding_a_to_b_ok(before: &str, expected: &str) {
let r = biome_js_parser::parse(
before,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let r = biome_js_parser::parse(before, JsFileSource::js_module(), JsParseOptions::default());
let model = semantic_model(&r.tree(), SemanticModelOptions::default());

let bindings: Vec<JsIdentifierBinding> = r
Expand Down Expand Up @@ -77,11 +73,7 @@ pub fn assert_rename_ts_binding_a_to_b_ok(before: &str, expected: &str) {
/// Search and renames one binding named "a" to "b".
/// Asserts the renaming fails.
pub fn assert_rename_binding_a_to_b_nok(before: &str) {
let r = biome_js_parser::parse(
before,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let r = biome_js_parser::parse(before, JsFileSource::js_module(), JsParseOptions::default());
let model = semantic_model(&r.tree(), SemanticModelOptions::default());

let binding_a = r
Expand All @@ -101,11 +93,7 @@ pub fn assert_remove_identifier_a_ok<Anc: AstNode<Language = JsLanguage> + Debug
before: &str,
expected: &str,
) {
let r = biome_js_parser::parse(
before,
JsFileSource::js_module(),
JsParseOptions::default(),
);
let r = biome_js_parser::parse(before, JsFileSource::js_module(), JsParseOptions::default());

let identifiers_a: Vec<JsSyntaxNode> = r
.syntax()
Expand Down
7 changes: 4 additions & 3 deletions crates/biome_service/src/file_handlers/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@ impl ServiceLanguage for JsLanguage {

if let (Some(overrides), Some(global)) = (overrides, global) {
jsx_runtime = Some(
match overrides
.to_override_jsx_runtime(path, global.languages.javascript.environment.jsx_runtime)
{
match overrides.to_override_jsx_runtime(
path,
global.languages.javascript.environment.jsx_runtime,
) {
// In the future, we may wish to map an `Auto` variant to a concrete
// analyzer value for easy access by the analyzer.
JsxRuntime::Transparent => biome_analyze::options::JsxRuntime::Transparent,
Expand Down

0 comments on commit ddaf359

Please sign in to comment.