Skip to content
Merged
  •  
  •  
  •  
33 changes: 27 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ biome_module_graph = { version = "0.0.1", path = "./crates/biome_modul
biome_plugin_loader = { version = "0.0.1", path = "./crates/biome_plugin_loader" }
biome_project_layout = { version = "0.0.1", path = "./crates/biome_project_layout" }
biome_resolver = { version = "0.1.0", path = "./crates/biome_resolver" }
biome_rule_options = { version = "0.0.1", path = "./crates/biome_rule_options" }
biome_ungrammar = { version = "0.3.1", path = "./crates/biome_ungrammar" }
biome_yaml_factory = { version = "0.0.1", path = "./crates/biome_yaml_factory" }
biome_yaml_parser = { version = "0.0.1", path = "./crates/biome_yaml_parser" }
Expand Down
1 change: 1 addition & 0 deletions crates/biome_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ biome_lsp = { workspace = true }
biome_migrate = { workspace = true }
biome_resolver = { workspace = true }
biome_rowan = { workspace = true }
biome_rule_options = { workspace = true }
biome_service = { workspace = true }
biome_text_edit = { workspace = true }
bpaf = { workspace = true, features = ["bright-color"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_cli/src/execute/migrate/eslint_eslint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ pub struct NoConsoleOptions {
/// Allowed calls on the console object.
pub allow: Box<[Box<str>]>,
}
impl From<NoConsoleOptions> for biome_js_analyze::lint::suspicious::no_console::NoConsoleOptions {
impl From<NoConsoleOptions> for biome_rule_options::no_console::NoConsoleOptions {
fn from(val: NoConsoleOptions) -> Self {
Self { allow: val.allow }
}
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_cli/src/execute/migrate/eslint_jsxa11y.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
///
/// Also, the module includes implementation to convert rule options to Biome's rule options.
use biome_deserialize_macros::Deserializable;
use biome_js_analyze::lint::a11y::use_valid_aria_role;
use biome_rule_options::use_valid_aria_role;

#[derive(Debug, Default, Deserializable)]
pub(crate) struct AriaRoleOptions {
allowed_invalid_roles: Box<[Box<str>]>,
#[deserializable(rename = "ignoreNonDOM")]
ignore_non_dom: bool,
}
impl From<AriaRoleOptions> for use_valid_aria_role::ValidAriaRoleOptions {
impl From<AriaRoleOptions> for use_valid_aria_role::UseValidAriaRoleOptions {
fn from(val: AriaRoleOptions) -> Self {
Self {
allow_invalid_roles: val.allowed_invalid_roles,
Expand Down
12 changes: 6 additions & 6 deletions crates/biome_cli/src/execute/migrate/eslint_to_biome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use biome_configuration::{self as biome_config};
use biome_console::markup;
use biome_deserialize::Merge;
use biome_diagnostics::Location;
use biome_js_analyze::lint::style::no_restricted_globals;
use biome_rule_options::no_restricted_globals;
use rustc_hash::FxHashMap;

/// This modules includes implementations for converting an ESLint config to a Biome config.
Expand Down Expand Up @@ -489,7 +489,7 @@ fn migrate_eslint_rule(
biome_config::RuleWithFixOptions {
level: severity.into(),
fix: None,
options: Box::new((*rule_options).into()),
options: *Box::new((*rule_options).into()),
},
));
}
Expand All @@ -516,8 +516,8 @@ fn migrate_eslint_rule(
Some(biome_config::RuleConfiguration::WithOptions(
biome_config::RuleWithOptions {
level: severity.into(),
options: Box::new(
no_restricted_globals::RestrictedGlobalsOptions {
options: *Box::new(
no_restricted_globals::NoRestrictedGlobalsOptions {
denied_globals: globals.collect::<FxHashMap<_, _>>(),
},
),
Expand All @@ -536,7 +536,7 @@ fn migrate_eslint_rule(
biome_config::RuleWithFixOptions {
level: severity.into(),
fix: None,
options: Box::new((*rule_options).into()),
options: *Box::new((*rule_options).into()),
},
));
}
Expand Down Expand Up @@ -620,7 +620,7 @@ fn migrate_eslint_rule(
Some(biome_config::RuleConfiguration::WithOptions(
biome_config::RuleWithOptions {
level: conf.severity().into(),
options: Box::new(conf.option_or_default().into()),
options: conf.option_or_default().into(),
},
));
}
Expand Down
23 changes: 10 additions & 13 deletions crates/biome_cli/src/execute/migrate/eslint_typescript.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
use std::{cmp::Ordering, str::FromStr};

use super::eslint_eslint;
/// Configuration related to [TypeScript Eslint](https://typescript-eslint.io/).
///
/// Also, the module includes implementation to convert rule options to Biome's rule options.
use biome_deserialize::Deserializable;
use biome_deserialize_macros::Deserializable;
use biome_js_analyze::{
lint::{
style::use_consistent_member_accessibility,
style::{use_consistent_array_type, use_import_type, use_naming_convention},
},
utils::restricted_regex::RestrictedRegex,
use biome_rule_options::restricted_regex::RestrictedRegex;
use biome_rule_options::{
use_consistent_array_type, use_consistent_member_accessibility, use_import_type,
use_naming_convention,
};

use super::eslint_eslint;

#[derive(Debug, Default, Deserializable)]
pub(crate) struct ArrayTypeOptions {
default: ArrayType,
readonly: Option<ArrayType>,
}
impl From<ArrayTypeOptions> for use_consistent_array_type::ConsistentArrayTypeOptions {
impl From<ArrayTypeOptions> for use_consistent_array_type::UseConsistentArrayTypeOptions {
fn from(val: ArrayTypeOptions) -> Self {
Self {
syntax: val.default.into(),
Expand Down Expand Up @@ -51,7 +48,7 @@ pub(crate) struct ConsistentTypeImportsOptions {
#[deserializable(rename = "fixStyle")]
fix_style: Option<FixStyle>,
}
impl From<ConsistentTypeImportsOptions> for use_import_type::ImportTypeOptions {
impl From<ConsistentTypeImportsOptions> for use_import_type::UseImportTypeOptions {
fn from(val: ConsistentTypeImportsOptions) -> Self {
Self {
style: val
Expand Down Expand Up @@ -83,7 +80,7 @@ pub(crate) struct ExplicitMemberAccessibilityOptions {
accessibility: Option<AccessibilityLevel>,
}
impl From<ExplicitMemberAccessibilityOptions>
for use_consistent_member_accessibility::ConsistentMemberAccessibilityOptions
for use_consistent_member_accessibility::UseConsistentMemberAccessibilityOptions
{
fn from(value: ExplicitMemberAccessibilityOptions) -> Self {
Self {
Expand Down Expand Up @@ -119,7 +116,7 @@ impl NamingConventionOptions {
Self(inner)
}
}
impl From<NamingConventionOptions> for use_naming_convention::NamingConventionOptions {
impl From<NamingConventionOptions> for use_naming_convention::UseNamingConventionOptions {
fn from(val: NamingConventionOptions) -> Self {
let mut conventions = Vec::new();
for selection in val.0 {
Expand Down Expand Up @@ -234,7 +231,7 @@ impl NamingConventionSelection {

fn selectors(&self) -> Vec<use_naming_convention::Selector> {
let mut result = Vec::new();
let modifiers: use_naming_convention::Modifiers = self
let modifiers: use_naming_convention::RestrictedModifiers = self
.modifiers
.iter()
.flatten()
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_cli/src/execute/migrate/eslint_unicorn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// ALso, the module includes implementation to convert rule options to Biome's rule options.
use biome_deserialize_macros::Deserializable;
use biome_js_analyze::lint::style::use_filenaming_convention;
use biome_rule_options::use_filenaming_convention;
use smallvec::SmallVec;

#[derive(Clone, Debug, Default, Deserializable)]
Expand All @@ -13,7 +13,7 @@ pub(crate) struct FilenameCaseOptions {
ignore: Vec<String>,
multiple_file_extensions: bool,
}
impl From<FilenameCaseOptions> for use_filenaming_convention::FilenamingConventionOptions {
impl From<FilenameCaseOptions> for use_filenaming_convention::UseFilenamingConventionOptions {
fn from(val: FilenameCaseOptions) -> Self {
let filename_cases: Option<use_filenaming_convention::FilenameCases> = val.cases.into();
Self {
Expand Down
14 changes: 3 additions & 11 deletions crates/biome_configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,21 @@ version = "0.0.1"
[dependencies]
biome_analyze = { workspace = true, features = ["serde"] }
biome_console = { workspace = true }
biome_css_analyze = { workspace = true }
biome_css_syntax = { workspace = true }
biome_deserialize = { workspace = true }
biome_deserialize_macros = { workspace = true }
biome_diagnostics = { workspace = true }
biome_flags = { workspace = true }
biome_formatter = { workspace = true, features = ["serde"] }
biome_glob = { workspace = true }
biome_graphql_analyze = { workspace = true }
biome_graphql_syntax = { workspace = true }
biome_glob = { workspace = true, features = ["schema"] }
biome_html_formatter = { workspace = true, features = ["serde"] }
biome_html_syntax = { workspace = true }
biome_js_analyze = { workspace = true }
biome_js_formatter = { workspace = true, features = ["serde"] }
biome_json_analyze = { workspace = true }
biome_json_formatter = { workspace = true, features = ["serde"] }
biome_json_parser = { workspace = true }
biome_json_syntax = { workspace = true }
biome_resolver = { workspace = true }
biome_rowan = { workspace = true, features = ["serde"] }
biome_rule_options = { workspace = true }
bpaf = { workspace = true }
camino = { workspace = true }
regex = { workspace = true }
Expand All @@ -45,17 +40,14 @@ serde = { workspace = true, features = ["derive"] }
[features]
schema = [
"dep:schemars",
"biome_js_analyze/schema",
"biome_css_analyze/schema",
"biome_formatter/schema",
"biome_json_syntax/schema",
"biome_css_syntax/schema",
"biome_graphql_syntax/schema",
"biome_html_formatter/schema",
"biome_html_syntax/schema",
"biome_analyze/schema",
"biome_json_formatter/schema",
"biome_js_formatter/schema",
"biome_rule_options/schema",
]

[dev-dependencies]
Expand Down
21 changes: 14 additions & 7 deletions crates/biome_configuration/src/analyzer/assist/actions.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 0 additions & 36 deletions crates/biome_configuration/src/analyzer/assists/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/biome_configuration/src/analyzer/linter/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[rustfmt::skip]
mod rules;

use crate::bool::Bool;
Expand Down
Loading