diff --git a/apps/oxlint/fixtures/tsgolint_rule_options/.oxlintrc.json b/apps/oxlint/fixtures/tsgolint_rule_options/.oxlintrc.json index 4e0d468b2d2d5..0da3e6afe6a67 100644 --- a/apps/oxlint/fixtures/tsgolint_rule_options/.oxlintrc.json +++ b/apps/oxlint/fixtures/tsgolint_rule_options/.oxlintrc.json @@ -49,7 +49,6 @@ { "allowConstantLoopConditions": true, "checkTypePredicates": false, - "allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing": false } ], "typescript/only-throw-error": [ diff --git a/crates/oxc_linter/src/rules/typescript/no_unnecessary_boolean_literal_compare.rs b/crates/oxc_linter/src/rules/typescript/no_unnecessary_boolean_literal_compare.rs index e22531aae0624..6516f89a92382 100644 --- a/crates/oxc_linter/src/rules/typescript/no_unnecessary_boolean_literal_compare.rs +++ b/crates/oxc_linter/src/rules/typescript/no_unnecessary_boolean_literal_compare.rs @@ -16,10 +16,6 @@ pub struct NoUnnecessaryBooleanLiteralCompareConfig { /// Whether to allow comparing nullable boolean expressions to `true`. /// When false, `x === true` where x is `boolean | null` will be flagged. pub allow_comparing_nullable_booleans_to_true: bool, - /// Whether to allow this rule to run without `strictNullChecks` enabled. - /// This is not recommended as the rule may produce incorrect results. - #[schemars(skip)] - pub allow_rule_to_run_without_strict_null_checks_i_know_what_i_am_doing: bool, } impl Default for NoUnnecessaryBooleanLiteralCompareConfig { @@ -27,7 +23,6 @@ impl Default for NoUnnecessaryBooleanLiteralCompareConfig { Self { allow_comparing_nullable_booleans_to_false: true, allow_comparing_nullable_booleans_to_true: true, - allow_rule_to_run_without_strict_null_checks_i_know_what_i_am_doing: false, } } } diff --git a/crates/oxc_linter/src/rules/typescript/no_unnecessary_condition.rs b/crates/oxc_linter/src/rules/typescript/no_unnecessary_condition.rs index 545db3524dded..38161e407dceb 100644 --- a/crates/oxc_linter/src/rules/typescript/no_unnecessary_condition.rs +++ b/crates/oxc_linter/src/rules/typescript/no_unnecessary_condition.rs @@ -40,9 +40,6 @@ pub struct NoUnnecessaryConditionConfig { pub allow_constant_loop_conditions: AllowConstantLoopConditions, /// Whether to check type predicate functions. pub check_type_predicates: bool, - /// DEPRECATED: Allow this rule to run without `strictNullChecks` enabled. - #[schemars(skip)] - pub allow_rule_to_run_without_strict_null_checks_i_know_what_i_am_doing: bool, } declare_oxc_lint!( diff --git a/crates/oxc_linter/src/rules/typescript/prefer_nullish_coalescing.rs b/crates/oxc_linter/src/rules/typescript/prefer_nullish_coalescing.rs index 24f7779901406..b6c002f4e5a59 100644 --- a/crates/oxc_linter/src/rules/typescript/prefer_nullish_coalescing.rs +++ b/crates/oxc_linter/src/rules/typescript/prefer_nullish_coalescing.rs @@ -42,14 +42,8 @@ impl Default for IgnorePrimitives { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase", default, deny_unknown_fields)] +#[expect(clippy::struct_field_names)] pub struct PreferNullishCoalescingConfig { - /// Unless this is set to `true`, the rule will error on every file whose - /// `tsconfig.json` does _not_ have the `strictNullChecks` compiler option - /// (or `strict`) set to `true`. - /// - /// It is _not_ recommended to enable this config option. - #[schemars(skip)] - pub allow_rule_to_run_without_strict_null_checks_i_know_what_i_am_doing: bool, /// Whether to ignore arguments to the `Boolean` constructor. pub ignore_boolean_coercion: bool, /// Whether to ignore cases that are located within a conditional test. @@ -70,7 +64,6 @@ pub struct PreferNullishCoalescingConfig { impl Default for PreferNullishCoalescingConfig { fn default() -> Self { Self { - allow_rule_to_run_without_strict_null_checks_i_know_what_i_am_doing: false, ignore_boolean_coercion: false, ignore_conditional_tests: true, ignore_if_statements: false, diff --git a/crates/oxc_linter/src/rules/typescript/strict_boolean_expressions.rs b/crates/oxc_linter/src/rules/typescript/strict_boolean_expressions.rs index 484f416fa910e..48aa48cd82a78 100644 --- a/crates/oxc_linter/src/rules/typescript/strict_boolean_expressions.rs +++ b/crates/oxc_linter/src/rules/typescript/strict_boolean_expressions.rs @@ -26,10 +26,6 @@ pub struct StrictBooleanExpressionsConfig { pub allow_string: bool, /// Whether to allow number types in boolean contexts (checks for non-zero numbers). pub allow_number: bool, - /// Whether to allow this rule to run without `strictNullChecks` enabled. - /// This is not recommended as the rule may produce incorrect results. - #[schemars(skip)] - pub allow_rule_to_run_without_strict_null_checks_i_know_what_i_am_doing: bool, } impl Default for StrictBooleanExpressionsConfig { @@ -43,7 +39,6 @@ impl Default for StrictBooleanExpressionsConfig { allow_nullable_object: true, allow_string: true, allow_number: true, - allow_rule_to_run_without_strict_null_checks_i_know_what_i_am_doing: false, } } }