From acdfad4db68405d0f0e077a2436ab4e472cba494 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Mon, 20 Oct 2025 21:16:09 -0600 Subject: [PATCH 1/2] docs(linter): Update no-invalid-regexp rule to expose documentation for config options. --- crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs b/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs index a156ae59da87f..292d9c0dfd0a3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs +++ b/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs @@ -6,6 +6,7 @@ use oxc_regular_expression::{ConstructorParser, Options}; use oxc_span::Span; use rustc_hash::FxHashSet; use serde::Deserialize; +use schemars::JsonSchema; use crate::{AstNode, context::LintContext, rule::Rule}; @@ -54,12 +55,13 @@ declare_oxc_lint!( NoInvalidRegexp, eslint, correctness, + config = NoInvalidRegexpConfig, ); -#[derive(Debug, Clone, Deserialize, Default)] +#[derive(Debug, Clone, Deserialize, Default, JsonSchema)] +#[serde(rename_all = "camelCase", default)] struct NoInvalidRegexpConfig { - #[serde(default, rename = "allowConstructorFlags")] - /// Case-sensitive array of flags. + /// Case-sensitive array of flags that will be allowed. allow_constructor_flags: Vec, } From 4fa7e8ea4796cea6ad9bf329d05ac022ac61c3cd Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 03:18:25 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs b/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs index 292d9c0dfd0a3..4087c70e0db4b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs +++ b/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs @@ -5,8 +5,8 @@ use oxc_macros::declare_oxc_lint; use oxc_regular_expression::{ConstructorParser, Options}; use oxc_span::Span; use rustc_hash::FxHashSet; -use serde::Deserialize; use schemars::JsonSchema; +use serde::Deserialize; use crate::{AstNode, context::LintContext, rule::Rule};