diff --git a/CHANGELOG.md b/CHANGELOG.md index a5428fa1d2f1..50b79e80b9c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b ### Linter +#### Bug fixes + +- Fix typo by renaming `useConsistentBuiltinInstatiation` to `useConsistentBuiltinInstantiation` + Contributed by @minht11 + ### Parser @@ -81,19 +86,19 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b #### New features -- Add [nusery/noReactSpecificProps](https://biomejs.dev/linter/rules/no-react-specific-props/). +- Add [nursery/noReactSpecificProps](https://biomejs.dev/linter/rules/no-react-specific-props/). Contributed by @marvin-j97 - Add [noUselessUndefinedInitialization](https://biomejs.dev/linter/rules/no-useless-undefined-initialization/). Contributed by @lutaok -- Add [nusery/useArrayLiterals](https://biomejs.dev/linter/rules/use-array-literals/). +- Add [nursery/useArrayLiterals](https://biomejs.dev/linter/rules/use-array-literals/). Contributed by @Kazuhiro-Mimaki -- Add [nusery/useConsistentBuiltinInstatiation](https://biomejs.dev/linter/rules/use-consistent-builtin-instatiation/). +- Add [nursery/useConsistentBuiltinInstatiation](https://biomejs.dev/linter/rules/use-consistent-builtin-instantiation/). Contributed by @minht11 -- Add [nusery/useDefaultSwitchClause](https://biomejs.dev/linter/rules/use-default-switch-clause/). +- Add [nursery/useDefaultSwitchClause](https://biomejs.dev/linter/rules/use-default-switch-clause/). Contributed by @michellocana #### Bug fixes diff --git a/crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs b/crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs index db3085434c7e..3fa7665f6118 100644 --- a/crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs +++ b/crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs @@ -885,7 +885,7 @@ pub(crate) fn migrate_eslint_any_rule( } let group = rules.nursery.get_or_insert_with(Default::default); let rule = group - .use_consistent_builtin_instatiation + .use_consistent_builtin_instantiation .get_or_insert(Default::default()); rule.set_level(rule_severity.into()); } @@ -1271,7 +1271,7 @@ pub(crate) fn migrate_eslint_any_rule( } let group = rules.nursery.get_or_insert_with(Default::default); let rule = group - .use_consistent_builtin_instatiation + .use_consistent_builtin_instantiation .get_or_insert(Default::default()); rule.set_level(rule_severity.into()); } diff --git a/crates/biome_configuration/src/linter/rules.rs b/crates/biome_configuration/src/linter/rules.rs index dfa7e5c76a04..b7d0a0076ae0 100644 --- a/crates/biome_configuration/src/linter/rules.rs +++ b/crates/biome_configuration/src/linter/rules.rs @@ -2714,8 +2714,8 @@ pub struct Nursery { pub use_array_literals: Option>, #[doc = "Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt."] #[serde(skip_serializing_if = "Option::is_none")] - pub use_consistent_builtin_instatiation: - Option>, + pub use_consistent_builtin_instantiation: + Option>, #[doc = "Require the default clause in switch statements."] #[serde(skip_serializing_if = "Option::is_none")] pub use_default_switch_clause: Option>, @@ -2767,7 +2767,7 @@ impl Nursery { "noUnknownUnit", "noUselessUndefinedInitialization", "useArrayLiterals", - "useConsistentBuiltinInstatiation", + "useConsistentBuiltinInstantiation", "useDefaultSwitchClause", "useGenericFontNames", "useImportRestrictions", @@ -2949,7 +2949,7 @@ impl Nursery { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.use_consistent_builtin_instatiation.as_ref() { + if let Some(rule) = self.use_consistent_builtin_instantiation.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } @@ -3083,7 +3083,7 @@ impl Nursery { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.use_consistent_builtin_instatiation.as_ref() { + if let Some(rule) = self.use_consistent_builtin_instantiation.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } @@ -3228,8 +3228,8 @@ impl Nursery { .use_array_literals .as_ref() .map(|conf| (conf.level(), conf.get_options())), - "useConsistentBuiltinInstatiation" => self - .use_consistent_builtin_instatiation + "useConsistentBuiltinInstantiation" => self + .use_consistent_builtin_instantiation .as_ref() .map(|conf| (conf.level(), conf.get_options())), "useDefaultSwitchClause" => self diff --git a/crates/biome_diagnostics_categories/src/categories.rs b/crates/biome_diagnostics_categories/src/categories.rs index c13d7e6ad234..4328b399bff4 100644 --- a/crates/biome_diagnostics_categories/src/categories.rs +++ b/crates/biome_diagnostics_categories/src/categories.rs @@ -134,7 +134,7 @@ define_categories! { "lint/nursery/noUselessUndefinedInitialization": "https://biomejs.dev/linter/rules/no-useless-undefined-initialization", "lint/nursery/noUnknownUnit": "https://biomejs.dev/linter/rules/no-unknown-unit", "lint/nursery/useBiomeSuppressionComment": "https://biomejs.dev/linter/rules/use-biome-suppression-comment", - "lint/nursery/useConsistentBuiltinInstatiation": "https://biomejs.dev/linter/rules/use-consistent-new-builtin", + "lint/nursery/useConsistentBuiltinInstantiation": "https://biomejs.dev/linter/rules/use-consistent-new-builtin", "lint/nursery/useGenericFontNames": "https://biomejs.dev/linter/rules/use-generic-font-names", "lint/nursery/useDefaultSwitchClause": "https://biomejs.dev/linter/rules/use-default-switch-clause", "lint/nursery/useImportRestrictions": "https://biomejs.dev/linter/rules/use-import-restrictions", diff --git a/crates/biome_js_analyze/src/lint/correctness/no_invalid_new_builtin.rs b/crates/biome_js_analyze/src/lint/correctness/no_invalid_new_builtin.rs index 1a53fbe45229..4ab50eda6ece 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_invalid_new_builtin.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_invalid_new_builtin.rs @@ -52,11 +52,11 @@ declare_rule! { pub NoInvalidNewBuiltin { version: "1.3.0", name: "noInvalidNewBuiltin", - // TODO: Remove this source once `useConsistentBuiltinInstatiation` is stable + // TODO: Remove this source once `useConsistentBuiltinInstantiation` is stable sources: &[RuleSource::Eslint("no-new-native-nonconstructor")], recommended: true, - // TODO: Deprecate this source once `useConsistentBuiltinInstatiation` is stable - //deprecated: "Use the rule useConsistentBuiltinInstatiation instead.", + // TODO: Deprecate this source once `useConsistentBuiltinInstantiation` is stable + //deprecated: "Use the rule useConsistentBuiltinInstantiation instead.", fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/lint/nursery.rs b/crates/biome_js_analyze/src/lint/nursery.rs index 1b2576ac7cff..f191e90e5a07 100644 --- a/crates/biome_js_analyze/src/lint/nursery.rs +++ b/crates/biome_js_analyze/src/lint/nursery.rs @@ -15,7 +15,7 @@ pub mod no_restricted_imports; pub mod no_undeclared_dependencies; pub mod no_useless_undefined_initialization; pub mod use_array_literals; -pub mod use_consistent_builtin_instatiation; +pub mod use_consistent_builtin_instantiation; pub mod use_default_switch_clause; pub mod use_import_restrictions; pub mod use_sorted_classes; @@ -37,7 +37,7 @@ declare_group! { self :: no_undeclared_dependencies :: NoUndeclaredDependencies , self :: no_useless_undefined_initialization :: NoUselessUndefinedInitialization , self :: use_array_literals :: UseArrayLiterals , - self :: use_consistent_builtin_instatiation :: UseConsistentBuiltinInstatiation , + self :: use_consistent_builtin_instantiation :: UseConsistentBuiltinInstantiation , self :: use_default_switch_clause :: UseDefaultSwitchClause , self :: use_import_restrictions :: UseImportRestrictions , self :: use_sorted_classes :: UseSortedClasses , diff --git a/crates/biome_js_analyze/src/lint/nursery/use_consistent_builtin_instatiation.rs b/crates/biome_js_analyze/src/lint/nursery/use_consistent_builtin_instantiation.rs similarity index 96% rename from crates/biome_js_analyze/src/lint/nursery/use_consistent_builtin_instatiation.rs rename to crates/biome_js_analyze/src/lint/nursery/use_consistent_builtin_instantiation.rs index b329249ab0a3..39573e27a450 100644 --- a/crates/biome_js_analyze/src/lint/nursery/use_consistent_builtin_instatiation.rs +++ b/crates/biome_js_analyze/src/lint/nursery/use_consistent_builtin_instantiation.rs @@ -97,9 +97,9 @@ declare_rule! { /// ]); /// ``` /// - pub UseConsistentBuiltinInstatiation { + pub UseConsistentBuiltinInstantiation { version: "1.7.2", - name: "useConsistentBuiltinInstatiation", + name: "useConsistentBuiltinInstantiation", sources: &[ RuleSource::EslintUnicorn("new-for-builtins"), RuleSource::Eslint("no-new-wrappers"), @@ -111,9 +111,9 @@ declare_rule! { } } -impl Rule for UseConsistentBuiltinInstatiation { +impl Rule for UseConsistentBuiltinInstantiation { type Query = Semantic; - type State = UseConsistentBuiltinInstatiationState; + type State = UseConsistentBuiltinInstantiationState; type Signals = Option; type Options = (); @@ -130,7 +130,7 @@ impl Rule for UseConsistentBuiltinInstatiation { .is_ok() { return ctx.model().binding(&reference).is_none().then_some( - UseConsistentBuiltinInstatiationState { + UseConsistentBuiltinInstantiationState { name: name_text.to_string(), creation_rule, }, @@ -249,7 +249,7 @@ impl BuiltinCreationRule { } } -pub struct UseConsistentBuiltinInstatiationState { +pub struct UseConsistentBuiltinInstantiationState { name: String, creation_rule: BuiltinCreationRule, } diff --git a/crates/biome_js_analyze/src/options.rs b/crates/biome_js_analyze/src/options.rs index 006d0c376156..bc03d12d5586 100644 --- a/crates/biome_js_analyze/src/options.rs +++ b/crates/biome_js_analyze/src/options.rs @@ -260,7 +260,7 @@ pub type UseButtonType = pub type UseCollapsedElseIf = ::Options; pub type UseConsistentArrayType = < lint :: style :: use_consistent_array_type :: UseConsistentArrayType as biome_analyze :: Rule > :: Options ; -pub type UseConsistentBuiltinInstatiation = < lint :: nursery :: use_consistent_builtin_instatiation :: UseConsistentBuiltinInstatiation as biome_analyze :: Rule > :: Options ; +pub type UseConsistentBuiltinInstantiation = < lint :: nursery :: use_consistent_builtin_instantiation :: UseConsistentBuiltinInstantiation as biome_analyze :: Rule > :: Options ; pub type UseConst = ::Options; pub type UseDefaultParameterLast = < lint :: style :: use_default_parameter_last :: UseDefaultParameterLast as biome_analyze :: Rule > :: Options ; pub type UseDefaultSwitchClause = < lint :: nursery :: use_default_switch_clause :: UseDefaultSwitchClause as biome_analyze :: Rule > :: Options ; diff --git a/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/invalid.js b/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/invalid.js rename to crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/invalid.js.snap b/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/invalid.js.snap similarity index 73% rename from crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/invalid.js.snap index 634832703a5f..c0a50b3663f1 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/invalid.js.snap @@ -52,7 +52,7 @@ function foo() { # Diagnostics ``` -invalid.js:1:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:1:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Object() instead of Object(). @@ -69,7 +69,7 @@ invalid.js:1:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:2:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:2:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Array() instead of Array(). @@ -87,7 +87,7 @@ invalid.js:2:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:3:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:3:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new ArrayBuffer() instead of ArrayBuffer(). @@ -106,7 +106,7 @@ invalid.js:3:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:4:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:4:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new BigInt64Array() instead of BigInt64Array(). @@ -125,7 +125,7 @@ invalid.js:4:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:5:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:5:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new BigUint64Array() instead of BigUint64Array(). @@ -144,7 +144,7 @@ invalid.js:5:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:6:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:6:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new DataView() instead of DataView(). @@ -163,7 +163,7 @@ invalid.js:6:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:7:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:7:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Date() instead of Date(). @@ -182,7 +182,7 @@ invalid.js:7:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:8:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:8:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Error() instead of Error(). @@ -201,7 +201,7 @@ invalid.js:8:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:9:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:9:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Float32Array() instead of Float32Array(). @@ -220,7 +220,7 @@ invalid.js:9:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━ ``` ``` -invalid.js:10:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:10:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Float64Array() instead of Float64Array(). @@ -239,7 +239,7 @@ invalid.js:10:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:11:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:11:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Function() instead of Function(). @@ -258,7 +258,7 @@ invalid.js:11:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:12:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:12:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Int8Array() instead of Int8Array(). @@ -277,7 +277,7 @@ invalid.js:12:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:13:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:13:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Int16Array() instead of Int16Array(). @@ -296,7 +296,7 @@ invalid.js:13:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:14:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:14:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Int32Array() instead of Int32Array(). @@ -315,7 +315,7 @@ invalid.js:14:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:15:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:15:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Map() instead of Map(). @@ -334,7 +334,7 @@ invalid.js:15:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:16:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:16:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new WeakMap() instead of WeakMap(). @@ -353,7 +353,7 @@ invalid.js:16:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:17:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:17:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Set() instead of Set(). @@ -372,7 +372,7 @@ invalid.js:17:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:18:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:18:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new WeakSet() instead of WeakSet(). @@ -391,7 +391,7 @@ invalid.js:18:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:19:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:19:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Promise() instead of Promise(). @@ -410,7 +410,7 @@ invalid.js:19:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:20:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:20:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new RegExp() instead of RegExp(). @@ -429,7 +429,7 @@ invalid.js:20:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:21:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:21:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Uint8Array() instead of Uint8Array(). @@ -448,7 +448,7 @@ invalid.js:21:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:22:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:22:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Uint16Array() instead of Uint16Array(). @@ -467,7 +467,7 @@ invalid.js:22:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:23:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:23:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Uint32Array() instead of Uint32Array(). @@ -486,7 +486,7 @@ invalid.js:23:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:24:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:24:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Uint8ClampedArray() instead of Uint8ClampedArray(). @@ -505,7 +505,7 @@ invalid.js:24:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:25:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:25:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new SharedArrayBuffer() instead of SharedArrayBuffer(). @@ -524,7 +524,7 @@ invalid.js:25:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:26:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:26:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Proxy() instead of Proxy(). @@ -543,7 +543,7 @@ invalid.js:26:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:27:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:27:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new WeakRef() instead of WeakRef(). @@ -562,7 +562,7 @@ invalid.js:27:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:28:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:28:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new FinalizationRegistry() instead of FinalizationRegistry(). @@ -581,7 +581,7 @@ invalid.js:28:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:29:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:29:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Object() instead of Object(). @@ -600,7 +600,7 @@ invalid.js:29:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:30:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:30:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Object() instead of Object(). @@ -619,7 +619,7 @@ invalid.js:30:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:32:25 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:32:25 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use new Object() instead of Object(). @@ -638,7 +638,7 @@ invalid.js:32:25 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:35:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:35:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use Boolean() instead of new Boolean(). @@ -657,7 +657,7 @@ invalid.js:35:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:36:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:36:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use BigInt() instead of new BigInt(). @@ -675,7 +675,7 @@ invalid.js:36:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:37:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:37:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use Number() instead of new Number(). @@ -694,7 +694,7 @@ invalid.js:37:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:38:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:38:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use String() instead of new String(). @@ -713,7 +713,7 @@ invalid.js:38:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:39:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:39:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use Symbol() instead of new Symbol(). @@ -732,7 +732,7 @@ invalid.js:39:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:40:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:40:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use String() instead of new String(). @@ -751,7 +751,7 @@ invalid.js:40:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:41:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:41:1 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use String() instead of new String(). @@ -770,7 +770,7 @@ invalid.js:41:1 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━ ``` ``` -invalid.js:43:25 lint/nursery/useConsistentBuiltinInstatiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:43:25 lint/nursery/useConsistentBuiltinInstantiation FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use String() instead of new String(). diff --git a/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/valid.js b/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/valid.js rename to crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/valid.js.snap b/crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstatiation/valid.js.snap rename to crates/biome_js_analyze/tests/specs/nursery/useConsistentBuiltinInstantiation/valid.js.snap diff --git a/packages/@biomejs/backend-jsonrpc/src/workspace.ts b/packages/@biomejs/backend-jsonrpc/src/workspace.ts index 6700d9a5fbe7..67bfc2b0def4 100644 --- a/packages/@biomejs/backend-jsonrpc/src/workspace.ts +++ b/packages/@biomejs/backend-jsonrpc/src/workspace.ts @@ -999,7 +999,7 @@ export interface Nursery { /** * Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt. */ - useConsistentBuiltinInstatiation?: RuleConfiguration_for_Null; + useConsistentBuiltinInstantiation?: RuleConfiguration_for_Null; /** * Require the default clause in switch statements. */ @@ -2005,7 +2005,7 @@ export type Category = | "lint/nursery/noUselessUndefinedInitialization" | "lint/nursery/noUnknownUnit" | "lint/nursery/useBiomeSuppressionComment" - | "lint/nursery/useConsistentBuiltinInstatiation" + | "lint/nursery/useConsistentBuiltinInstantiation" | "lint/nursery/useGenericFontNames" | "lint/nursery/useDefaultSwitchClause" | "lint/nursery/useImportRestrictions" diff --git a/packages/@biomejs/biome/configuration_schema.json b/packages/@biomejs/biome/configuration_schema.json index 85ed6c6bc86a..e9c85634ec87 100644 --- a/packages/@biomejs/biome/configuration_schema.json +++ b/packages/@biomejs/biome/configuration_schema.json @@ -1584,7 +1584,7 @@ { "type": "null" } ] }, - "useConsistentBuiltinInstatiation": { + "useConsistentBuiltinInstantiation": { "description": "Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" },