Skip to content

Commit

Permalink
remove useObjectHasOwn rule in favor of noPrototypeBuiltins enhan…
Browse files Browse the repository at this point in the history
…cements
  • Loading branch information
kaioduarte committed Sep 24, 2024
1 parent df43317 commit 7c37f2e
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 1,267 deletions.

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

40 changes: 10 additions & 30 deletions crates/biome_configuration/src/analyzer/linter/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3376,10 +3376,6 @@ pub struct Nursery {
#[serde(skip_serializing_if = "Option::is_none")]
pub use_import_restrictions:
Option<RuleConfiguration<biome_js_analyze::options::UseImportRestrictions>>,
#[doc = "Disallow use of Object.prototype.hasOwnProperty.call() and prefer use of Object.hasOwn()"]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_object_has_own:
Option<RuleFixConfiguration<biome_js_analyze::options::UseObjectHasOwn>>,
#[doc = "Enforce the sorting of CSS utility classes."]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_sorted_classes:
Expand Down Expand Up @@ -3441,7 +3437,6 @@ impl Nursery {
"useDeprecatedReason",
"useExplicitFunctionReturnType",
"useImportRestrictions",
"useObjectHasOwn",
"useSortedClasses",
"useStrictMode",
"useTrimStartEnd",
Expand Down Expand Up @@ -3471,7 +3466,7 @@ impl Nursery {
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21]),
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24]),
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25]),
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]),
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]),
];
const ALL_RULES_AS_FILTERS: &'static [RuleFilter<'static>] = &[
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]),
Expand Down Expand Up @@ -3506,7 +3501,6 @@ impl Nursery {
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]),
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]),
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]),
RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32]),
];
#[doc = r" Retrieves the recommended rules"]
pub(crate) fn is_recommended_true(&self) -> bool {
Expand Down Expand Up @@ -3663,29 +3657,24 @@ impl Nursery {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27]));
}
}
if let Some(rule) = self.use_object_has_own.as_ref() {
if rule.is_enabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28]));
}
}
if let Some(rule) = self.use_sorted_classes.as_ref() {
if rule.is_enabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28]));
}
}
if let Some(rule) = self.use_strict_mode.as_ref() {
if rule.is_enabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]));
}
}
if let Some(rule) = self.use_trim_start_end.as_ref() {
if rule.is_enabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]));
}
}
if let Some(rule) = self.use_valid_autocomplete.as_ref() {
if rule.is_enabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]));
}
}
index_set
Expand Down Expand Up @@ -3832,29 +3821,24 @@ impl Nursery {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27]));
}
}
if let Some(rule) = self.use_object_has_own.as_ref() {
if rule.is_disabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28]));
}
}
if let Some(rule) = self.use_sorted_classes.as_ref() {
if rule.is_disabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28]));
}
}
if let Some(rule) = self.use_strict_mode.as_ref() {
if rule.is_disabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]));
}
}
if let Some(rule) = self.use_trim_start_end.as_ref() {
if rule.is_disabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]));
}
}
if let Some(rule) = self.use_valid_autocomplete.as_ref() {
if rule.is_disabled() {
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32]));
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]));
}
}
index_set
Expand Down Expand Up @@ -4005,10 +3989,6 @@ impl Nursery {
.use_import_restrictions
.as_ref()
.map(|conf| (conf.level(), conf.get_options())),
"useObjectHasOwn" => self
.use_object_has_own
.as_ref()
.map(|conf| (conf.level(), conf.get_options())),
"useSortedClasses" => self
.use_sorted_classes
.as_ref()
Expand Down Expand Up @@ -5691,7 +5671,7 @@ pub struct Suspicious {
#[doc = "Disallow direct use of Object.prototype builtins."]
#[serde(skip_serializing_if = "Option::is_none")]
pub no_prototype_builtins:
Option<RuleConfiguration<biome_js_analyze::options::NoPrototypeBuiltins>>,
Option<RuleFixConfiguration<biome_js_analyze::options::NoPrototypeBuiltins>>,
#[doc = "Prevents React-specific JSX properties from being used."]
#[serde(skip_serializing_if = "Option::is_none")]
pub no_react_specific_props:
Expand Down
1 change: 0 additions & 1 deletion crates/biome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ define_categories! {
"lint/nursery/useExplicitFunctionReturnType": "https://biomejs.dev/linter/rules/use-explicit-function-return-type",
"lint/nursery/useImportRestrictions": "https://biomejs.dev/linter/rules/use-import-restrictions",
"lint/nursery/useJsxCurlyBraceConvention": "https://biomejs.dev/linter/rules/use-jsx-curly-brace-convention",
"lint/nursery/useObjectHasOwn": "https://biomejs.dev/linter/rules/use-object-has-own",
"lint/nursery/useSortedClasses": "https://biomejs.dev/linter/rules/use-sorted-classes",
"lint/nursery/useStrictMode": "https://biomejs.dev/linter/rules/use-strict-mode",
"lint/nursery/useTrimStartEnd": "https://biomejs.dev/linter/rules/use-trim-start-end",
Expand Down
2 changes: 0 additions & 2 deletions crates/biome_js_analyze/src/lint/nursery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub mod use_consistent_curly_braces;
pub mod use_consistent_member_accessibility;
pub mod use_explicit_function_return_type;
pub mod use_import_restrictions;
pub mod use_object_has_own;
pub mod use_sorted_classes;
pub mod use_strict_mode;
pub mod use_trim_start_end;
Expand Down Expand Up @@ -54,7 +53,6 @@ declare_lint_group! {
self :: use_consistent_member_accessibility :: UseConsistentMemberAccessibility ,
self :: use_explicit_function_return_type :: UseExplicitFunctionReturnType ,
self :: use_import_restrictions :: UseImportRestrictions ,
self :: use_object_has_own :: UseObjectHasOwn ,
self :: use_sorted_classes :: UseSortedClasses ,
self :: use_strict_mode :: UseStrictMode ,
self :: use_trim_start_end :: UseTrimStartEnd ,
Expand Down
204 changes: 0 additions & 204 deletions crates/biome_js_analyze/src/lint/nursery/use_object_has_own.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/biome_js_analyze/src/options.rs

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

Loading

0 comments on commit 7c37f2e

Please sign in to comment.