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

Commit

Permalink
chore: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 28, 2022
1 parent 0139d44 commit 0062d74
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 73 deletions.
2 changes: 1 addition & 1 deletion crates/rome_cli/tests/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ fn downgrade_severity() {
.filter(|m| m.level == LogLevel::Error)
.filter(|m| {
let content = format!("{:#?}", m.content);
content.contains("security/noDebugger")
content.contains("correctness/noDebugger")
})
.count(),
1
Expand Down
5 changes: 2 additions & 3 deletions crates/rome_cli/tests/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub const CONFIG_LINTER_SUPPRESSED_RULE: &str = r#"{
"linter": {
"rules": {
"recommended": true,
"security": {
"correctness": {
"noDebugger": "off"
}
}
Expand All @@ -122,8 +122,7 @@ pub const CONFIG_LINTER_DOWNGRADE_DIAGNOSTIC: &str = r#"{
"linter": {
"rules": {
"recommended": true,
"security": {
"recommended": true,
"correctness": {
"noDebugger": "warn"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ expression: content
"linter": {
"rules": {
"recommended": true,
"security": {
"recommended": true,
"correctness": {
"noDebugger": "warn"
}
}
Expand All @@ -27,7 +26,7 @@ debugger;
# Emitted Messages

```block
file.js:1:1 lint/security/noDebugger FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
file.js:1:1 lint/correctness/noDebugger FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! This is an unexpected use of the debugger statement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ expression: content
"linter": {
"rules": {
"recommended": true,
"security": {
"correctness": {
"noDebugger": "off"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/rome_cli/tests/snap_test.rs
assertion_line: 223
expression: content
---
## `rome.json`
Expand All @@ -11,8 +10,7 @@ expression: content
"rules": {
"recommended": true,
"nursery": {
"noUnreachable": "error",
"noUnusedVariables": "error"
"noInvalidConstructorSuper": "error"
}
}
}
Expand All @@ -22,13 +20,9 @@ expression: content
## `file.js`

```js
function f() {
for (;;) {
continue;
break;
}
class A extends B {
constructor() {}
}

```

# Termination Message
Expand All @@ -40,40 +34,14 @@ errors where emitted while running checks
# Emitted Messages

```block
file.js:4:9 lint/nursery/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
file.js:1:9 lint/nursery/noInvalidConstructorSuper ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× This code will never be reached ...
2 │ for (;;) {
3 │ continue;
> 4 │ break;
│ ^^^^^^
5 │ }
6 │ }
× This class extends another class and a super() call is expected.
i ... because this statement will continue the loop beforehand
1 │ function f() {
2 │ for (;;) {
> 3 │ continue;
> 1 │ class A extends B {
│ ^^^^^^^^^
4 │ break;
5 │ }
```

```block
file.js:1:10 lint/nursery/noUnusedVariables ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× This function is unused.
> 1 │ function f() {
│ ^
2 │ for (;;) {
3 │ continue;
i Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
2 │ constructor() {}
3 │ }
```
Expand Down
12 changes: 1 addition & 11 deletions crates/rome_js_analyze/src/analyzers/nursery.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions crates/rome_js_analyze/src/semantic_analyzers/nursery.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0062d74

Please sign in to comment.