diff --git a/Cargo.lock b/Cargo.lock index 835638cade0a6..8735acb5900f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1692,23 +1692,24 @@ dependencies = [ [[package]] name = "oxc-miette" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31cfb121c9d3e0f9082856927f5cff9594279c91b544f4436e4bc971563caa60" +checksum = "2d5495f6099fa0b25fa25755c1d59ed79ffa64dda80f5366a4cdfc8fc20f5932" dependencies = [ "cfg-if", "owo-colors", "oxc-miette-derive", "textwrap", "thiserror", + "unicode-segmentation", "unicode-width", ] [[package]] name = "oxc-miette-derive" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6eabb57f935b454fbe0552ea0abaaf9eb0019b5fa05a7bbe7efd5bd8c765085" +checksum = "9dbbc96af6e37c35f2303b2bedbf8ce9cc563e4fbbf7776be6f0803cb0095652" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index f30dffc90dc7d..e8c000d37aeb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -197,7 +197,7 @@ lazy-regex = "3.4.1" log = "0.4.27" markdown = "1.0.0" memchr = "2.7.5" -miette = { package = "oxc-miette", version = "2.4.0", features = ["fancy-no-syscall"] } +miette = { package = "oxc-miette", version = "2.5.0", features = ["fancy-no-syscall"] } mimalloc-safe = "0.1.54" nonmax = "0.5.5" num-bigint = "0.4.6" diff --git a/crates/oxc_linter/src/snapshots/eslint_no_irregular_whitespace.snap b/crates/oxc_linter/src/snapshots/eslint_no_irregular_whitespace.snap index 9aa9bae946fb0..951a2b0d9bcd3 100644 --- a/crates/oxc_linter/src/snapshots/eslint_no_irregular_whitespace.snap +++ b/crates/oxc_linter/src/snapshots/eslint_no_irregular_whitespace.snap @@ -177,7 +177,7 @@ source: crates/oxc_linter/src/tester.rs ╭─[no_irregular_whitespace.tsx:2:14] 1 │ var any   = 'thing', other   = 'thing'; 2 │ var third   = 'thing'; - · ── + · ─ ╰──── help: Try to remove the irregular whitespace @@ -237,7 +237,7 @@ source: crates/oxc_linter/src/tester.rs ╭─[no_irregular_whitespace.tsx:2:13] 1 │ ` multiline 2 │ template`  - · ── + · ─ ╰──── help: Try to remove the irregular whitespace @@ -245,7 +245,7 @@ source: crates/oxc_linter/src/tester.rs ╭─[no_irregular_whitespace.tsx:2:4] 1 │ ` template` 2 │   - · ── + · ─ ╰──── help: Try to remove the irregular whitespace @@ -253,7 +253,7 @@ source: crates/oxc_linter/src/tester.rs ╭─[no_irregular_whitespace.tsx:3:4] 2 │ template` 3 │   - · ── + · ─ ╰──── help: Try to remove the irregular whitespace @@ -281,7 +281,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(no-irregular-whitespace): Unexpected irregular whitespace ╭─[no_irregular_whitespace.tsx:1:12] 1 │ var foo = bar; - · ─ + · ─ ╰──── help: Try to remove the irregular whitespace @@ -295,7 +295,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(no-irregular-whitespace): Unexpected irregular whitespace ╭─[no_irregular_whitespace.tsx:1:12] 1 │ var foo = bar; - · ─ + · ─ ╰──── help: Try to remove the irregular whitespace @@ -309,7 +309,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(no-irregular-whitespace): Unexpected irregular whitespace ╭─[no_irregular_whitespace.tsx:1:13] 1 │ var foo = bar; - · ─ + · ─ ╰──── help: Try to remove the irregular whitespace @@ -323,7 +323,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(no-irregular-whitespace): Unexpected irregular whitespace ╭─[no_irregular_whitespace.tsx:1:15] 1 │ var foo = bar ; - · ─ + · ─ ╰──── help: Try to remove the irregular whitespace @@ -376,7 +376,7 @@ source: crates/oxc_linter/src/tester.rs ╭─[no_irregular_whitespace.tsx:2:10] 1 │ var foo = 2 │ bar - · ─ + · ─ 3 │ ; ╰──── help: Try to remove the irregular whitespace @@ -385,7 +385,7 @@ source: crates/oxc_linter/src/tester.rs ╭─[no_irregular_whitespace.tsx:2:11] 1 │ var foo = 2 │ bar - · ─ + · ─ 3 │ ; ╰──── help: Try to remove the irregular whitespace diff --git a/crates/oxc_linter/src/snapshots/eslint_no_useless_escape.snap b/crates/oxc_linter/src/snapshots/eslint_no_useless_escape.snap index c53f61eb20fb1..5ca00c0839ecd 100644 --- a/crates/oxc_linter/src/snapshots/eslint_no_useless_escape.snap +++ b/crates/oxc_linter/src/snapshots/eslint_no_useless_escape.snap @@ -437,14 +437,14 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(no-useless-escape): Unnecessary escape character '\u{85}' ╭─[no_useless_escape.tsx:1:40] 1 │ var stringLiteralWithNextLine = "line 1\…line 2"; - · ─ + · ── ╰──── help: Replace `\…` with `…`. ⚠ eslint(no-useless-escape): Unnecessary escape character '\u{85}' ╭─[no_useless_escape.tsx:1:40] 1 │ var stringLiteralWithNextLine = `line 1\…line 2`; - · ─ + · ── ╰──── help: Replace `\…` with `…`. diff --git a/crates/oxc_linter/src/snapshots/eslint_prefer_numeric_literals.snap b/crates/oxc_linter/src/snapshots/eslint_prefer_numeric_literals.snap index 01d4edf57fd39..5476f9cf6d113 100644 --- a/crates/oxc_linter/src/snapshots/eslint_prefer_numeric_literals.snap +++ b/crates/oxc_linter/src/snapshots/eslint_prefer_numeric_literals.snap @@ -64,7 +64,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(prefer-numeric-literals): Use hexadecimal literals instead of parseInt(). ╭─[prefer_numeric_literals.tsx:1:1] 1 │ parseInt('1️⃣3️⃣3️⃣7️⃣', 16); - · ──────────────────── + · ──────────────────────── ╰──── ⚠ eslint(prefer-numeric-literals): Use octal literals instead of parseInt(). @@ -88,7 +88,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(prefer-numeric-literals): Use hexadecimal literals instead of parseInt(). ╭─[prefer_numeric_literals.tsx:1:1] 1 │ Number.parseInt('1️⃣3️⃣3️⃣7️⃣', 16); - · ─────────────────────────── + · ─────────────────────────────── ╰──── ⚠ eslint(prefer-numeric-literals): Use binary literals instead of parseInt(). diff --git a/crates/oxc_linter/src/snapshots/eslint_prefer_object_has_own.snap b/crates/oxc_linter/src/snapshots/eslint_prefer_object_has_own.snap index 41fb0fa9e8a15..7bf5f6d0ac8d8 100644 --- a/crates/oxc_linter/src/snapshots/eslint_prefer_object_has_own.snap +++ b/crates/oxc_linter/src/snapshots/eslint_prefer_object_has_own.snap @@ -234,6 +234,6 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(prefer-object-has-own): Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`. ╭─[prefer_object_has_own.tsx:1:3] 1 │ …Object.prototype.hasOwnProperty.call(C,x); - · ───────────────────────────────────────── + · ───────────────────────────────────────── ╰──── help: Replace `Object.prototype.hasOwnProperty.call` with ` Object.hasOwn`. diff --git a/crates/oxc_linter/src/snapshots/eslint_prefer_template.snap b/crates/oxc_linter/src/snapshots/eslint_prefer_template.snap index d38f60525fba4..e8a95eba59fa5 100644 --- a/crates/oxc_linter/src/snapshots/eslint_prefer_template.snap +++ b/crates/oxc_linter/src/snapshots/eslint_prefer_template.snap @@ -214,7 +214,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(prefer-template): Unexpected string concatenation. ╭─[prefer_template.tsx:1:1] 1 │ foo + '8' - · ───────── + · ────────── ╰──── help: Use template literals instead of string concatenation. @@ -228,7 +228,7 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint(prefer-template): Unexpected string concatenation. ╭─[prefer_template.tsx:1:1] 1 │ foo + '' - · ──────── + · ───────── ╰──── help: Use template literals instead of string concatenation. diff --git a/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap b/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap index 6ae0c1d33fce3..f102779c519db 100644 --- a/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap +++ b/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap @@ -194,8 +194,8 @@ source: crates/oxc_linter/src/tester.rs ⚠ eslint-plugin-react(jsx-curly-brace-presence): Curly braces are required here. ╭─[jsx_curly_brace_presence.tsx:1:14] 1 │ foo bar - · ────┬──── - · ╰── Wrap this value in curly braces + · ─────┬──── + · ╰── Wrap this value in curly braces ╰──── help: Wrap this value in curly braces diff --git a/crates/oxc_linter/src/snapshots/typescript_consistent_type_definitions.snap b/crates/oxc_linter/src/snapshots/typescript_consistent_type_definitions.snap index 5cca6defdcf60..b0489c1b8f04e 100644 --- a/crates/oxc_linter/src/snapshots/typescript_consistent_type_definitions.snap +++ b/crates/oxc_linter/src/snapshots/typescript_consistent_type_definitions.snap @@ -150,27 +150,27 @@ source: crates/oxc_linter/src/tester.rs ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` ╭─[consistent_type_definitions.tsx:1:10] 1 │ declare…type S={} - · ──── + · ──── ╰──── help: Use an `interface` instead of a `type` ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` ╭─[consistent_type_definitions.tsx:1:10] 1 │ declare…interface S {} - · ───────── + · ───────── ╰──── help: Use an `type` instead of a `interface` ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` ╭─[consistent_type_definitions.tsx:1:17] 1 │ export declare…type S={} - · ──── + · ──── ╰──── help: Use an `interface` instead of a `type` ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` ╭─[consistent_type_definitions.tsx:1:17] 1 │ export declare…interface S {} - · ───────── + · ───────── ╰──── help: Use an `type` instead of a `interface` diff --git a/tasks/coverage/snapshots/parser_babel.snap b/tasks/coverage/snapshots/parser_babel.snap index 921ab550a9390..81fb167d026a4 100644 --- a/tasks/coverage/snapshots/parser_babel.snap +++ b/tasks/coverage/snapshots/parser_babel.snap @@ -2169,7 +2169,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc × Unexpected token ╭─[babel/packages/babel-parser/test/fixtures/core/uncategorised/436/input.js:2:1] 1 │ ] - · ─ + · ─ ╰──── × Unexpected token @@ -2182,7 +2182,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc × Unexpected token ╭─[babel/packages/babel-parser/test/fixtures/core/uncategorised/438/input.js:3:1] 2 │ ] - · ─ + · ─ ╰──── × Unexpected token @@ -2195,7 +2195,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc × Unexpected token ╭─[babel/packages/babel-parser/test/fixtures/core/uncategorised/440/input.js:3:1] 2 │ ] - · ─ + · ─ ╰──── × Unterminated regular expression @@ -2228,7 +2228,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc × Unexpected token ╭─[babel/packages/babel-parser/test/fixtures/core/uncategorised/444/input.js:3:3] 2 │ */] - · ─ + · ─ ╰──── × Unexpected token @@ -11174,7 +11174,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc × Unexpected token ╭─[babel/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0156/input.js:3:1] 2 │ ] - · ─ + · ─ ╰──── × Unterminated regular expression @@ -11207,7 +11207,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc × Unexpected token ╭─[babel/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0160/input.js:3:3] 2 │ */] - · ─ + · ─ ╰──── × Unexpected token diff --git a/tasks/coverage/snapshots/parser_test262.snap b/tasks/coverage/snapshots/parser_test262.snap index 15226cc59581a..f72c08b0a7a8d 100644 --- a/tasks/coverage/snapshots/parser_test262.snap +++ b/tasks/coverage/snapshots/parser_test262.snap @@ -21411,7 +21411,7 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm × Expected a semicolon or an implicit semicolon after a statement, but found none ╭─[test262/test/language/line-terminators/invalid-comment-single-cr.js:18:6] 17 │ // this text is not included in the single-line comment that precedes it - · ▲ + · ▲ ╰──── help: Try insert a semicolon here @@ -21441,14 +21441,14 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm ╭─[test262/test/language/line-terminators/invalid-regexp-cr.js:18:1] 17 │ 18 │ / / - · ─ + · ── ╰──── × Unexpected token ╭─[test262/test/language/line-terminators/invalid-regexp-cr.js:18:1] 17 │ 18 │ / / - · ─── + · ──── ╰──── × Unterminated regular expression @@ -21498,7 +21498,7 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm ╭─[test262/test/language/line-terminators/invalid-string-cr.js:17:1] 16 │ 17 │ ' ' - · ─ + · ── ╰──── × Unterminated string diff --git a/tasks/coverage/snapshots/parser_typescript.snap b/tasks/coverage/snapshots/parser_typescript.snap index bb03c60f6f639..67a2d9591a633 100644 --- a/tasks/coverage/snapshots/parser_typescript.snap +++ b/tasks/coverage/snapshots/parser_typescript.snap @@ -11818,7 +11818,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc ╭─[typescript/tests/cases/compiler/regularExpressionCharacterClassRangeOrder.ts:7:8] 6 │ const regexes: RegExp[] = [ 7 │ /[𝘈-𝘡][𝘡-𝘈]/, - · ── + · ─ 8 │ /[𝘈-𝘡][𝘡-𝘈]/u, ╰──── @@ -11826,7 +11826,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc ╭─[typescript/tests/cases/compiler/regularExpressionCharacterClassRangeOrder.ts:8:19] 7 │ /[𝘈-𝘡][𝘡-𝘈]/, 8 │ /[𝘈-𝘡][𝘡-𝘈]/u, - · ── + · ─ 9 │ /[𝘈-𝘡][𝘡-𝘈]/v, ╰──── @@ -11834,7 +11834,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc ╭─[typescript/tests/cases/compiler/regularExpressionCharacterClassRangeOrder.ts:9:15] 8 │ /[𝘈-𝘡][𝘡-𝘈]/u, 9 │ /[𝘈-𝘡][𝘡-𝘈]/v, - · ─── + · ─ 10 │ ╰────