diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.snap index a39f0ac70c7..a04cfa7e43d 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.snap @@ -103,7 +103,7 @@ multiple.js:2:3 parse ━━━━━━━━━━━━━━━━━━━ multiple.js:7:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 5 │ legs: 4, 6 │ @@ -115,7 +115,7 @@ multiple.js:7:3 parse ━━━━━━━━━━━━━━━━━━━ 10 │ eyes: 2 11 │ }; - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. multiple.js:10:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/rome_js_parser/src/syntax/js_parse_error.rs b/crates/rome_js_parser/src/syntax/js_parse_error.rs index 80796c06576..b2dd01ed654 100644 --- a/crates/rome_js_parser/src/syntax/js_parse_error.rs +++ b/crates/rome_js_parser/src/syntax/js_parse_error.rs @@ -284,7 +284,7 @@ pub(crate) fn invalid_decorator_error(p: &JsParser, range: TextRange) -> ParseDi } pub(crate) fn decorators_not_allowed(p: &JsParser, range: TextRange) -> ParseDiagnostic { - p.err_builder("Decorators are not valid here", range).hint( - "Decorators are only valid on class declarations, class expressions, and class methods", + p.err_builder("Decorators are not valid here.", range).hint( + "Decorators are only valid on class declarations, class expressions, and class methods.", ) } diff --git a/crates/rome_js_parser/src/syntax/module.rs b/crates/rome_js_parser/src/syntax/module.rs index 08993f85b96..5b7af1d545f 100644 --- a/crates/rome_js_parser/src/syntax/module.rs +++ b/crates/rome_js_parser/src/syntax/module.rs @@ -214,7 +214,7 @@ pub(crate) fn parse_import_or_import_equals_declaration(p: &mut JsParser) -> Par let start = p.cur_range().start(); let import = p.start(); - p.expect(T![import]); + p.bump(T![import]); debug_assert!(p.state().name_map.is_empty()); p.state_mut().duplicate_binding_parent = Some("import"); @@ -1182,7 +1182,7 @@ fn parse_export_default_clause(p: &mut JsParser) -> ParsedSyntax { let start = p.cur_range().start(); let m = p.start(); - p.expect(T![default]); + p.bump(T![default]); let (clause, default_item_kind) = match p.cur() { T![@] => { diff --git a/crates/rome_js_parser/test_data/inline/err/decorator.rast b/crates/rome_js_parser/test_data/inline/err/decorator.rast index 1baa3890ba1..21eb31746fa 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator.rast @@ -1153,7 +1153,7 @@ decorator.ts:3:2 parse ━━━━━━━━━━━━━━━━━━━ -- decorator.ts:3:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ @'dsads' class MyClass {} 2 │ @1 class MyClass {} @@ -1162,7 +1162,7 @@ decorator.ts:3:1 parse ━━━━━━━━━━━━━━━━━━━ 4 │ @[] in 1 class MyClass {} 5 │ @[] class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:3:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1223,7 +1223,7 @@ decorator.ts:4:2 parse ━━━━━━━━━━━━━━━━━━━ -- decorator.ts:4:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 2 │ @1 class MyClass {} 3 │ @++1 class MyClass {} @@ -1232,7 +1232,7 @@ decorator.ts:4:1 parse ━━━━━━━━━━━━━━━━━━━ 5 │ @[] class MyClass {} 6 │ @() => {} class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:4:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1284,7 +1284,7 @@ decorator.ts:6:3 parse ━━━━━━━━━━━━━━━━━━━ -- decorator.ts:6:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 4 │ @[] in 1 class MyClass {} 5 │ @[] class MyClass {} @@ -1293,7 +1293,7 @@ decorator.ts:6:1 parse ━━━━━━━━━━━━━━━━━━━ 7 │ @1 == 2 ? true : false class MyClass {} 8 │ @await fn class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:6:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1331,7 +1331,7 @@ decorator.ts:7:2 parse ━━━━━━━━━━━━━━━━━━━ -- decorator.ts:7:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 5 │ @[] class MyClass {} 6 │ @() => {} class MyClass {} @@ -1340,7 +1340,7 @@ decorator.ts:7:1 parse ━━━━━━━━━━━━━━━━━━━ 8 │ @await fn class MyClass {} 9 │ @function(){} class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:7:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1378,7 +1378,7 @@ decorator.ts:8:2 parse ━━━━━━━━━━━━━━━━━━━ -- decorator.ts:8:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 6 │ @() => {} class MyClass {} 7 │ @1 == 2 ? true : false class MyClass {} @@ -1387,7 +1387,7 @@ decorator.ts:8:1 parse ━━━━━━━━━━━━━━━━━━━ 9 │ @function(){} class MyClass {} 10 │ @obj instanceof Object class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:8:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1434,7 +1434,7 @@ decorator.ts:9:2 parse ━━━━━━━━━━━━━━━━━━━ -- decorator.ts:10:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 8 │ @await fn class MyClass {} 9 │ @function(){} class MyClass {} @@ -1443,7 +1443,7 @@ decorator.ts:10:1 parse ━━━━━━━━━━━━━━━━━━ 11 │ @1 === 2 class MyClass {} 12 │ @new Object() class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:10:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1481,7 +1481,7 @@ decorator.ts:11:2 parse ━━━━━━━━━━━━━━━━━━ -- decorator.ts:11:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 9 │ @function(){} class MyClass {} 10 │ @obj instanceof Object class MyClass {} @@ -1490,7 +1490,7 @@ decorator.ts:11:1 parse ━━━━━━━━━━━━━━━━━━ 12 │ @new Object() class MyClass {} 13 │ @{} class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:11:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1540,7 +1540,7 @@ decorator.ts:13:2 parse ━━━━━━━━━━━━━━━━━━ -- decorator.ts:14:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 12 │ @new Object() class MyClass {} 13 │ @{} class MyClass {} @@ -1549,7 +1549,7 @@ decorator.ts:14:1 parse ━━━━━━━━━━━━━━━━━━ 15 │ @a,b class MyClass {} 16 │ @`${d}foo` class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:14:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1568,7 +1568,7 @@ decorator.ts:14:6 parse ━━━━━━━━━━━━━━━━━━ -- decorator.ts:15:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 13 │ @{} class MyClass {} 14 │ @a++ class MyClass {} @@ -1577,7 +1577,7 @@ decorator.ts:15:1 parse ━━━━━━━━━━━━━━━━━━ 16 │ @`${d}foo` class MyClass {} 17 │ @obj as MyType class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:15:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1615,7 +1615,7 @@ decorator.ts:16:2 parse ━━━━━━━━━━━━━━━━━━ -- decorator.ts:17:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 15 │ @a,b class MyClass {} 16 │ @`${d}foo` class MyClass {} @@ -1624,7 +1624,7 @@ decorator.ts:17:1 parse ━━━━━━━━━━━━━━━━━━ 18 │ @obj class MyClass {} 19 │ @obj satisfies MyType class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:17:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1710,7 +1710,7 @@ decorator.ts:18:2 parse ━━━━━━━━━━━━━━━━━━ -- decorator.ts:18:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 16 │ @`${d}foo` class MyClass {} 17 │ @obj as MyType class MyClass {} @@ -1719,7 +1719,7 @@ decorator.ts:18:1 parse ━━━━━━━━━━━━━━━━━━ 19 │ @obj satisfies MyType class MyClass {} 20 │ @obj! class MyClass {} - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:18:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -1754,7 +1754,7 @@ decorator.ts:18:14 parse ━━━━━━━━━━━━━━━━━━ -- decorator.ts:19:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 17 │ @obj as MyType class MyClass {} 18 │ @obj class MyClass {} @@ -1763,7 +1763,7 @@ decorator.ts:19:1 parse ━━━━━━━━━━━━━━━━━━ 20 │ @obj! class MyClass {} 21 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator.ts:19:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_async_function_export_default_declaration_clause.rast b/crates/rome_js_parser/test_data/inline/err/decorator_async_function_export_default_declaration_clause.rast index e55cda8b3c1..5b03633e2cb 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_async_function_export_default_declaration_clause.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_async_function_export_default_declaration_clause.rast @@ -84,14 +84,14 @@ JsModule { -- decorator_async_function_export_default_declaration_clause.ts:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ @decorator │ ^^^^^^^^^^ 2 │ export default async function foo() { } 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- @decorator diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration.rast b/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration.rast index e0877e859d6..e7cc27b4329 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration.rast @@ -165,7 +165,7 @@ JsModule { -- decorator_class_declaration.js:2:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ function bar() { > 2 │ @decorator @@ -173,12 +173,12 @@ decorator_class_declaration.js:2:6 parse ━━━━━━━━━━━━━ 3 │ let a; 4 │ @decorator @decorator2 - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator_class_declaration.js:4:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 2 │ @decorator 3 │ let a; @@ -187,7 +187,7 @@ decorator_class_declaration.js:4:6 parse ━━━━━━━━━━━━━ 5 │ function Foo() { } 6 │ } - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- function bar() { diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration_top_level.rast b/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration_top_level.rast index 2a43ef15d1d..77d4dc45f5b 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration_top_level.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_class_declaration_top_level.rast @@ -126,19 +126,19 @@ JsModule { -- decorator_class_declaration_top_level.js:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ @decorator │ ^^^^^^^^^^ 2 │ let a; 3 │ @decorator1 @decorator2 - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator_class_declaration_top_level.js:3:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ @decorator 2 │ let a; @@ -147,7 +147,7 @@ decorator_class_declaration_top_level.js:3:1 parse ━━━━━━━━━ 4 │ function Foo() { } 5 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- @decorator diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_enum_export_default_declaration_clause.rast b/crates/rome_js_parser/test_data/inline/err/decorator_enum_export_default_declaration_clause.rast index 6eafeedcdf3..5cc548f97ed 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_enum_export_default_declaration_clause.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_enum_export_default_declaration_clause.rast @@ -101,14 +101,14 @@ JsModule { -- decorator_enum_export_default_declaration_clause.ts:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ @decorator │ ^^^^^^^^^^ 2 │ export default enum A { X, Y, Z } 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator_enum_export_default_declaration_clause.ts:2:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_export_class_clause.rast b/crates/rome_js_parser/test_data/inline/err/decorator_export_class_clause.rast index e59d0d2c525..7cffc766315 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_export_class_clause.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_export_class_clause.rast @@ -140,19 +140,19 @@ JsModule { -- decorator_export_class_clause.js:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ @decorator │ ^^^^^^^^^^ 2 │ export let a; 3 │ @decorator1 @decorator2 - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator_export_class_clause.js:3:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ @decorator 2 │ export let a; @@ -161,7 +161,7 @@ decorator_export_class_clause.js:3:1 parse ━━━━━━━━━━━━ 4 │ export function Foo() { } 5 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- @decorator diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_export_default_expression_clause.rast b/crates/rome_js_parser/test_data/inline/err/decorator_export_default_expression_clause.rast index c2f154a21e8..c4d7c36b7be 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_export_default_expression_clause.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_export_default_expression_clause.rast @@ -54,14 +54,14 @@ JsModule { -- decorator_export_default_expression_clause.ts:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ @decorator │ ^^^^^^^^^^ 2 │ export default a; 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- @decorator diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_expression_class.rast b/crates/rome_js_parser/test_data/inline/err/decorator_expression_class.rast index 4dff1823dc7..a4f72217709 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_expression_class.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_expression_class.rast @@ -305,14 +305,14 @@ JsModule { -- decorator_expression_class.js:1:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ let a = @decorator () => {}; │ ^^^^^^^^^^^^^ 2 │ let b = @first @second function foo() {} 3 │ let a = @decorator ( () => {} ) - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator_expression_class.js:1:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -334,7 +334,7 @@ decorator_expression_class.js:1:23 parse ━━━━━━━━━━━━━ -- decorator_expression_class.js:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ let a = @decorator () => {}; > 2 │ let b = @first @second function foo() {} @@ -342,12 +342,12 @@ decorator_expression_class.js:2:9 parse ━━━━━━━━━━━━━ 3 │ let a = @decorator ( () => {} ) 4 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator_expression_class.js:3:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ let a = @decorator () => {}; 2 │ let b = @first @second function foo() {} @@ -355,7 +355,7 @@ decorator_expression_class.js:3:9 parse ━━━━━━━━━━━━━ │ ^^^^^^^^^^^^^^^^^^^^^^^ 4 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- decorator_expression_class.js:4:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_function_export_default_declaration_clause.rast b/crates/rome_js_parser/test_data/inline/err/decorator_function_export_default_declaration_clause.rast index 71e9a24f6d7..d50459d66cd 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_function_export_default_declaration_clause.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_function_export_default_declaration_clause.rast @@ -84,14 +84,14 @@ JsModule { -- decorator_function_export_default_declaration_clause.ts:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ @decorator │ ^^^^^^^^^^ 2 │ export default function foo() { } 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- @decorator diff --git a/crates/rome_js_parser/test_data/inline/err/decorator_interface_export_default_declaration_clause.rast b/crates/rome_js_parser/test_data/inline/err/decorator_interface_export_default_declaration_clause.rast index e8523e900be..b433df71efc 100644 --- a/crates/rome_js_parser/test_data/inline/err/decorator_interface_export_default_declaration_clause.rast +++ b/crates/rome_js_parser/test_data/inline/err/decorator_interface_export_default_declaration_clause.rast @@ -66,14 +66,14 @@ JsModule { -- decorator_interface_export_default_declaration_clause.ts:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ @decorator │ ^^^^^^^^^^ 2 │ export default interface A { } 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- @decorator diff --git a/crates/rome_js_parser/test_data/inline/err/ts_declare_const_initializer.rast b/crates/rome_js_parser/test_data/inline/err/ts_declare_const_initializer.rast index 0a3398a7ade..b43e1c3f458 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_declare_const_initializer.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_declare_const_initializer.rast @@ -116,26 +116,26 @@ JsModule { -- ts_declare_const_initializer.ts:1:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ declare @decorator class D {} │ ^^^^^^^^^^ 2 │ declare @decorator abstract class D {} 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- ts_declare_const_initializer.ts:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ declare @decorator class D {} > 2 │ declare @decorator abstract class D {} │ ^^^^^^^^^^ 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- declare @decorator class D {} diff --git a/crates/rome_js_parser/test_data/inline/err/ts_export_declare.rast b/crates/rome_js_parser/test_data/inline/err/ts_export_declare.rast index cdbd442315d..032f272ccbf 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_export_declare.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_export_declare.rast @@ -134,26 +134,26 @@ JsModule { -- ts_export_declare.ts:1:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. > 1 │ export declare @decorator class D {} │ ^^^^^^^^^^ 2 │ export declare @decorator abstract class D {} 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- ts_export_declare.ts:2:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Decorators are not valid here + × Decorators are not valid here. 1 │ export declare @decorator class D {} > 2 │ export declare @decorator abstract class D {} │ ^^^^^^^^^^ 3 │ - i Decorators are only valid on class declarations, class expressions, and class methods + i Decorators are only valid on class declarations, class expressions, and class methods. -- export declare @decorator class D {}