{"record":{"id":"cf247f7dd35796d3","repo":"oxc-project/oxc","slug":"unexpected-emoji-modifier-in-character-class","errorCode":null,"errorMessage":"Unexpected emoji modifier in character class.","messagePattern":"Unexpected emoji modifier in character class\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/eslint/no_misleading_character_class.rs","lineNumber":48,"sourceCode":"    OxcDiagnostic::warn(\"Unexpected surrogate pair in character class.\")\n        .with_help(\"Use Unicode code point escapes (e.g., \\\\u{1F44D}) instead of surrogate pairs.\")\n        .with_label(span)\n}\n\nfn surrogate_pair_without_flag_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected surrogate pair in character class.\")\n        .with_help(\"Add the Unicode flag 'u'.\")\n        .with_label(span)\n}\n\nfn combining_class_diagnostic(span: Span) -> OxcDiagnostic {\n    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)]","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/eslint/no_misleading_character_class.rs#L30-L66","documentation":"Lint diagnostic from eslint/no-misleading-character-class (emoji_modifier_sequences): a regex character class contains an emoji modifier sequence (base + skin-tone modifier). Without the u flag such characters are treated as lone UTF-16 code units, so the class matches fragments of the intended emoji rather than the sequence.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/eslint/no_misleading_character_class.rs:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use Unicode code point escapes such as \\u{1F3FB} for the modifier","Add the u flag to the regex so modifiers are matched as complete code points","Move the emoji sequence outside the character class if matching the full sequence"],"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"}