Skip to content

Commit 0f65142

Browse files
committed
test: order configuration files
1 parent 7fc052c commit 0f65142

18 files changed

Lines changed: 95 additions & 139 deletions

crates/biome_cli/tests/snap_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub(crate) struct CliSnapshot {
4242
/// the configuration, if set
4343
/// First string is the content
4444
/// Second string is the name
45-
pub configuration_list: Vec<(String, String)>,
45+
pub configuration_list: BTreeMap<String, String>,
4646
/// file name -> content
4747
pub files: BTreeMap<String, String>,
4848
/// messages written in console
@@ -55,7 +55,7 @@ impl CliSnapshot {
5555
pub fn from_result(result: Result<(), CliDiagnostic>) -> Self {
5656
Self {
5757
in_messages: InMessages::default(),
58-
configuration_list: vec![],
58+
configuration_list: BTreeMap::default(),
5959
files: BTreeMap::default(),
6060
messages: Vec::new(),
6161
termination: result.err().map(Error::from),
@@ -459,7 +459,7 @@ impl From<SnapshotPayload<'_>> for CliSnapshot {
459459
{
460460
cli_snapshot
461461
.configuration_list
462-
.push((content.to_string(), file.to_string()));
462+
.insert(content.to_string(), file.to_string());
463463
} else {
464464
cli_snapshot
465465
.files

crates/biome_cli/tests/snapshots/main_cases_config_extends/extends_config_ok_from_npm_package.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `node_modules/@shared/format/biome.json`
5+
## `biome.json`
66

77
```json
8-
{ "javascript": { "formatter": { "quoteStyle": "single" } } }
8+
{ "extends": ["@shared/format/biome", "@shared/linter/biome"] }
99
```
1010

11-
## `node_modules/@shared/linter/biome.jsonc`
11+
## `node_modules/@shared/format/biome.json`
1212

1313
```json
14-
{ "linter": { "enabled": false } }
14+
{ "javascript": { "formatter": { "quoteStyle": "single" } } }
1515
```
1616

17-
## `biome.json`
17+
## `node_modules/@shared/linter/biome.jsonc`
1818

1919
```json
20-
{ "extends": ["@shared/format/biome", "@shared/linter/biome"] }
20+
{ "linter": { "enabled": false } }
2121
```
2222

2323
## `node_modules/@shared/format/package.json`

crates/biome_cli/tests/snapshots/main_cases_config_extends/extends_config_ok_from_npm_package_with_author_field.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `node_modules/@shared/format/biome.json`
5+
## `biome.json`
66

77
```json
8-
{ "javascript": { "formatter": { "quoteStyle": "single" } } }
8+
{ "extends": ["@shared/format/biome", "@shared/linter/biome"] }
99
```
1010

11-
## `node_modules/@shared/linter/biome.jsonc`
11+
## `node_modules/@shared/format/biome.json`
1212

1313
```json
14-
{ "linter": { "enabled": false } }
14+
{ "javascript": { "formatter": { "quoteStyle": "single" } } }
1515
```
1616

17-
## `biome.json`
17+
## `node_modules/@shared/linter/biome.jsonc`
1818

1919
```json
20-
{ "extends": ["@shared/format/biome", "@shared/linter/biome"] }
20+
{ "linter": { "enabled": false } }
2121
```
2222

2323
## `node_modules/@shared/format/package.json`

crates/biome_cli/tests/snapshots/main_cases_config_extends/extends_config_ok_from_npm_package_with_condition_names.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `node_modules/@shared/format/biome.json`
5+
## `biome.json`
66

77
```json
8-
{ "javascript": { "formatter": { "quoteStyle": "single" } } }
8+
{ "extends": ["@shared/format", "@shared/linter/biome"] }
99
```
1010

11-
## `node_modules/@shared/linter/biome.jsonc`
11+
## `node_modules/@shared/format/biome.json`
1212

1313
```json
14-
{ "linter": { "enabled": false } }
14+
{ "javascript": { "formatter": { "quoteStyle": "single" } } }
1515
```
1616

17-
## `biome.json`
17+
## `node_modules/@shared/linter/biome.jsonc`
1818

1919
```json
20-
{ "extends": ["@shared/format", "@shared/linter/biome"] }
20+
{ "linter": { "enabled": false } }
2121
```
2222

2323
## `node_modules/@shared/format/package.json`

crates/biome_cli/tests/snapshots/main_cases_configuration/uses_project_config_before_user_config.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `.biome.json`
5+
## `<CONFIG_DIR>/biome.json`
66
77
```json
88
{
99
"javascript": {
1010
"formatter": {
11-
"quoteStyle": "single"
11+
"enabled": false
1212
}
1313
}
1414
}
1515
```
1616
17-
## `<CONFIG_DIR>/biome.json`
17+
## `.biome.json`
1818
1919
```json
2020
{
2121
"javascript": {
2222
"formatter": {
23-
"enabled": false
23+
"quoteStyle": "single"
2424
}
2525
}
2626
}

crates/biome_cli/tests/snapshots/main_cases_included_files/can_force_ignore_biome_json.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `nested/biome.json`
5+
## `biome.json`
66

77
```json
8-
{ "formatter": { "enabled": false } }
8+
{ "files": { "includes": ["**/*.js", "!!nested/biome.json"] } }
99
```
1010

11-
## `biome.json`
11+
## `nested/biome.json`
1212

1313
```json
14-
{ "files": { "includes": ["**/*.js", "!!nested/biome.json"] } }
14+
{ "formatter": { "enabled": false } }
1515
```
1616

1717
## `a.js`

crates/biome_cli/tests/snapshots/main_cases_included_files/errors_on_ignored_nested_biome_json.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `nested/biome.json`
5+
## `biome.json`
66

77
```json
8-
{ "formatter": { "enabled": false } }
8+
{ "files": { "includes": ["**/*.js", "!nested/biome.json"] } }
99
```
1010

11-
## `biome.json`
11+
## `nested/biome.json`
1212

1313
```json
14-
{ "files": { "includes": ["**/*.js", "!nested/biome.json"] } }
14+
{ "formatter": { "enabled": false } }
1515
```
1616

1717
## `a.js`

crates/biome_cli/tests/snapshots/main_cases_migrate_v2/should_migrate_nested_config.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `bar/biome.json`
6-
7-
```json
8-
{ "linter": { "rules": { "recommended": true } } }
9-
```
10-
11-
## `biome.json`
12-
13-
```json
14-
{ "linter": { "rules": { "recommended": true } } }
15-
```
16-
175
## `foo/biome.json`
186

197
```json

crates/biome_cli/tests/snapshots/main_cases_monorepo/should_fail_for_nested_roots.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `biome.json`
6-
7-
```json
8-
{
9-
"javascript": {
10-
"formatter": {
11-
"quoteStyle": "double"
12-
}
13-
}
14-
}
15-
```
16-
175
## `packages/lib/biome.json`
186

197
```json

crates/biome_cli/tests/snapshots/main_cases_monorepo/should_find_settings_when_run_from_nested_dir.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
source: crates/biome_cli/tests/snap_test.rs
33
expression: redactor(content)
44
---
5-
## `biome.jsonc`
5+
## `packages/lib/biome.jsonc`
66

77
```json
88
{
9+
"extends": "//",
910
"linter": {
1011
"rules": {
11-
"correctness": { "noUnusedVariables": "off" },
12-
"suspicious": { "noDebugger": "off" }
12+
"correctness": { "noUnusedVariables": "error" }
1313
}
1414
}
1515
}
1616
```
1717

18-
## `packages/lib/biome.jsonc`
18+
## `biome.jsonc`
1919

2020
```json
2121
{
22-
"extends": "//",
2322
"linter": {
2423
"rules": {
25-
"correctness": { "noUnusedVariables": "error" }
24+
"correctness": { "noUnusedVariables": "off" },
25+
"suspicious": { "noDebugger": "off" }
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)