Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Update test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Dec 15, 2022
1 parent c8f7554 commit 127b948
Showing 1 changed file with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/rome_js_analyze/tests/spec_tests.rs
assertion_line: 86
expression: invalid.js
---
# Input
Expand All @@ -11,11 +10,7 @@ export function g(a, b = 0, c) {}

export function g(a, b /* before */ = /* mid */ 0/* after */) {}

export function g(
a,
b /* before */ = /* mid */ 0/* after */,/* after comma */
c
) {}
export function g(a, b /* before */ = /* mid */ 0 /* after */ /* after comma */, c) {}
```

# Diagnostics
Expand Down Expand Up @@ -76,31 +71,31 @@ invalid.js:3:22 lint/nursery/useDefaultParameterLast FIXABLE ━━━━━
```

```
invalid.js:9:2 lint/nursery/useDefaultParameterLast FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.js:7:22 lint/nursery/useDefaultParameterLast FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! The default parameter should follow the required parameter or should be a required parameter.
7 │ export function g(
8 │ a,
> 9 │ b /* before */ = /* mid */ 0/* after */,/* after comma */
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 │ c
11 │ ) {}
5 │ export function g(a, b /* before */ = /* mid */ 0/* after */) {}
6 │
> 7 │ export function g(a, b /* before */ = /* mid */ 0 /* after */ /* after comma */, c) {}
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
i The required parameter is here:
8 │ a,
9 │ b /* before */ = /* mid */ 0/* after */,/* after comma */
> 10 │ c
│ ^
11 │ ) {}
5 │ export function g(a, b /* before */ = /* mid */ 0/* after */) {}
6 │
> 7 │ export function g(a, b /* before */ = /* mid */ 0 /* after */ /* after comma */, c) {}
│ ^
i A default parameter that precedes a required parameter cannot be omitted at call site.
i Suggested fix: Turn the parameter into a required parameter.
9 │ → b·/*·before·*/·=·/*·mid·*/·0/*·after·*/,/*·after·coma·*/
│ -------------
5 5 │ export function g(a, b /* before */ = /* mid */ 0/* after */) {}
6 6 │
7 │ - export·function·g(a,·b·/*·before·*/·=·/*·mid·*/·0·/*·after·*/·/*·after·comma·*/,·c)·{}
7 │ + export·function·g(a,·b·/*·before·*/··/*·after·*/·/*·after·comma·*/,·c)·{}
```

Expand Down

0 comments on commit 127b948

Please sign in to comment.