-
-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(configuration): enabled rules calculation (#2072)
- Loading branch information
Showing
6 changed files
with
273 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
crates/biome_cli/tests/snapshots/main_commands_lint/top_level_all_down_level_empty.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
source: crates/biome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `biome.json` | ||
|
||
```json | ||
{ | ||
"linter": { | ||
"rules": { | ||
"all": true, | ||
"nursery": { | ||
"all": false | ||
}, | ||
"suspicious": { | ||
"all": false | ||
}, | ||
"style": {} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## `fix.js` | ||
|
||
```js | ||
|
||
console.log(event); | ||
const FOO = "FOO"; | ||
console.log(FOO); | ||
|
||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
fix.js:2:17 lint/style/noRestrictedGlobals ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! Do not use the global variable event. | ||
> 2 │ console.log(event); | ||
│ ^^^^^ | ||
3 │ const FOO = "FOO"; | ||
4 │ console.log(FOO); | ||
i Use a local variable instead. | ||
``` | ||
|
||
```block | ||
fix.js:3:11 lint/style/noShoutyConstants FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! Redundant constant declaration. | ||
2 │ console.log(event); | ||
> 3 │ const FOO = "FOO"; | ||
│ ^^^^^^^^^^^ | ||
4 │ console.log(FOO); | ||
5 │ | ||
i Used here. | ||
2 │ console.log(event); | ||
3 │ const FOO = "FOO"; | ||
> 4 │ console.log(FOO); | ||
│ ^^^ | ||
5 │ | ||
i You should avoid declaring constants with a string that's the same | ||
value as the variable name. It introduces a level of unnecessary | ||
indirection when it's only two additional characters to inline. | ||
i Unsafe fix: Use the constant value directly | ||
1 1 │ | ||
2 2 │ console.log(event); | ||
3 │ - ····const·FOO·=·"FOO"; | ||
4 │ - ····console.log(FOO); | ||
3 │ + ····console.log("FOO"); | ||
5 4 │ | ||
``` | ||
|
||
```block | ||
Checked 1 file in <TIME>. No fixes needed. | ||
Found 2 warnings. | ||
``` |
Oops, something went wrong.