{"record":{"id":"524a7dd455e9a413","repo":"oxc-project/oxc","slug":"unexpected-exponential-notation-in-uppercase","errorCode":null,"errorMessage":"Unexpected exponential notation in uppercase.","messagePattern":"Unexpected exponential notation in uppercase\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/unicorn/number_literal_case.rs","lineNumber":16,"sourceCode":"use cow_utils::CowUtils;\nuse oxc_ast::AstKind;\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\n\nuse crate::{AstNode, context::LintContext, rule::Rule};\n\nfn uppercase_prefix(span: Span, prefix: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected number literal prefix in uppercase.\")\n        .with_help(format!(\"Use lowercase for the number literal prefix `{prefix}`.\"))\n        .with_label(span)\n}\n\nfn uppercase_exponential_notation(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected exponential notation in uppercase.\")\n        .with_help(\"Use lowercase for `e` in exponential notations.\")\n        .with_label(span)\n}\n\nfn lowercase_hexadecimal_digits(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected hexadecimal digits in lowercase.\")\n        .with_help(\"Use uppercase for hexadecimal digits.\")\n        .with_label(span)\n}\n\nfn uppercase_prefix_and_lowercase_hexadecimal_digits(span: Span, prefix: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\n        \"Unexpected number literal prefix in uppercase and hexadecimal digits in lowercase.\",\n    )\n    .with_help(format!(\n        \"Use lowercase for the number literal prefix `{prefix}` and uppercase for hexadecimal digits.\"\n    ))\n    .with_label(span)","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/unicorn/number_literal_case.rs#L1-L34","documentation":"Lint diagnostic from oxlint's `unicorn/number-literal-case` rule. The rule normalizes numeric literal casing; this variant fires when exponential (scientific) notation uses an uppercase `E`, as in `1E5` or `2.5E-3`, which the rule wants written as `1e5` and `2.5e-3`. It is purely stylistic — both forms parse to the same number.","triggerScenarios":"Any `NumericLiteral` with an exponent whose `E` marker is uppercase: `const speedOfLight = 3E8;`, `const tiny = 1E-7;`. Reported during oxlint runs when the unicorn plugin is active.","commonSituations":"Developers switching from editors/formatters that do not normalize exponent case, or code pasted from scientific sources that use uppercase `E`. Shows up as a wave of warnings when the `unicorn` category is turned on in `.oxlintrc.json`.","solutions":["Lowercase the exponent marker: `3E8` -> `3e8`.","Run `oxlint --fix` to autofix every occurrence in the project.","Suppress once with `// oxlint-disable-next-line unicorn/number-literal-case` if the literal must stay as-is (e.g. in a generated file).","Turn the rule off globally via `\"unicorn/number-literal-case\": \"off\"` if lowercase-e style is not wanted."],"exampleFix":"// before\nconst avogadro = 6.02E23;\n\n// after\nconst avogadro = 6.02e23;","handlingStrategy":"validation","validationCode":"// oxlint --fix .   (normalizes 1E5 -> 1e5)\n// CI gate:\n// oxlint --deny-warnings .","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write exponent markers lowercase by habit (`1e9`, `6.02e23`).","Enable oxlint in editor (LSP) to catch uppercase `E` while typing.","Add `oxlint --fix` to format-on-save or pre-commit."],"tags":["oxlint","unicorn","style","numeric-literal","exponent","autofix"],"backgroundTag":"lint-rule-violation","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}