{"record":{"id":"4ad7e6ebb92563d0","repo":"oxc-project/oxc","slug":"unexpected-joined-character-sequence-in-character","errorCode":null,"errorMessage":"Unexpected joined character sequence in character class.","messagePattern":"Unexpected joined character sequence in character class\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/eslint/no_misleading_character_class.rs","lineNumber":60,"sourceCode":"    OxcDiagnostic::warn(\"Unexpected combining class in character class.\")\n        .with_help(\"Replace the character with its normalized form (NFC) or use Unicode code point escapes instead of combining sequences.\")\n        .with_label(span)\n}\n\nfn emoji_modifiers_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected emoji modifier in character class.\")\n        .with_help(\"Use Unicode code point escapes (e.g., \\\\u{1F3FB} for the light skin tone modifier) instead of emoji modifier sequences in character classes.\")\n        .with_label(span)\n}\n\nfn regional_indicator_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected regional indicator in character class.\")\n        .with_help(\"Use Unicode code point escapes (e.g., \\\\u{1F1EF} for the regional indicator symbol for 'J') instead of regional indicator symbol pairs in character classes.\")\n        .with_label(span)\n}\n\nfn zwj_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected joined character sequence in character class.\")\n        .with_help(\"Use Unicode code point escapes (e.g., \\\\u{1F468}\\\\u200D\\\\u{1F469} for '👨‍👩') instead of zero-width joiner sequences in character classes.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone, JsonSchema, Deserialize)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct NoMisleadingCharacterClass {\n    /// When set to `true`, the rule allows any grouping of code points\n    /// inside a character class as long as they are written using escape sequences.\n    ///\n    /// Examples of **incorrect** code for this rule with `{ \"allowEscape\": true }`:\n    /// ```javascript\n    /// /[\\uD83D]/; // backslash can be omitted\n    /// new RegExp(\"[\\ud83d\" + \"\\udc4d]\");\n    /// ```\n    ///\n    /// Examples of **correct** code for this rule with `{ \"allowEscape\": true }`:\n    /// ```javascript","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/eslint/no_misleading_character_class.rs#L42-L78","documentation":"Lint diagnostic from eslint/no-misleading-character-class (zwj_sequences): a character class contains characters joined by ZWJ (U+200D), such as family or rainbow-flag emoji. A character class matches only the individual atoms, never the joined sequence as a whole, so the regex silently fails to match the intended emoji.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/eslint/no_misleading_character_class.rs:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use Unicode code point escapes (e.g. \\u{1F468}\\u{200D}\\u{1F469}) for the full joined sequence","Move the ZWJ sequence out of the character class into the pattern"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}