Skip to content

Commit

Permalink
release: 1.3.0 (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Oct 19, 2023
1 parent e578675 commit 5dcae83
Show file tree
Hide file tree
Showing 36 changed files with 3,158 additions and 284 deletions.
79 changes: 77 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

### Analyzer

### CLI

### Configuration

### Editors

### Formatter

### JavaScript APIs

### Linter

### Parser

### VSCode

## 1.3.0

### Analyzer

#### Enhancements

- Import sorting is safe to apply now, and it will be applied when running `check --apply` instead of `check --apply-unsafe`.
Expand Down Expand Up @@ -62,8 +82,9 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

#### Enhancements

- Deprecated the environment variable `ROME_BINARY`. Contributed by @ematipico
- Deprecated the environment variable `ROME_BINARY`. Use `BIOME_BINARY` instead. Contributed by @ematipico
- Biome doesn't check anymore the presence of the `.git` folder when VCS support is enabled. Contributed by @ematipico
- `biome rage` doesn't print the logs of the daemon, use `biome rage --daemon-logs` to print them. Contributed by @unvalley

### Configuration

Expand All @@ -78,7 +99,61 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom
- `linter.include`;
- `organizeImports.include`;
When `include` and `ignore` are both specified, `ignore` takes **precedence** over `include`
- Add option `overrides`, where users can modify the behaviour of the tools for certain files or paths.

For example, it's possible to modify the formatter `lineWidth`, and even `quoteStyle` for certain files that are included in glob path `generated/**`:

```json
{
"formatter": {
"lineWidth": 100
},
"overrides": [
{
"include": ["generated/**"],
"formatter": {
"lineWidth": 160
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
}
]
}
```

Or, you can disable certain rules for certain path, and disable the linter for other paths:

```json
{
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"overrides": [
{
"include": ["lib/**"],
"linter": {
"rules": {
"suspicious": {
"noDebugger": "off"
}
}
}
},
{
"include": ["shims/**"],
"linter": {
"enabled": false
}
}
]
}
```

### Bug fixes

Expand All @@ -97,7 +172,6 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom
#### Enhancements
- Use `OnceCell` for the Memoized memory because that's what the `RefCell<Option>` implemented. Contributed by @denbezrukov

### JavaScript APIs
### Linter

#### Promoted rules
Expand Down Expand Up @@ -157,6 +231,7 @@ The following rules are now recommended:
- Add [noMisrefactoredShorthandAssign](https://biomejs.dev/lint/rules/no-misrefactored-shorthand-assign) rule.
The rule reports shorthand assigns when variable appears on both sides. For example `x += x + b`
Contributed by @victor-teles
- Add [noApproximativeNumericConstant](https://biomejs.dev/linter/rules/no-approximative-numeric-constant/) rule. Contributed by @nikeee

- Add [noInteractiveElementToNoninteractiveRole](https://biomejs.dev/linter/rules/no-interactive-element-to-noninteractive-role) rule. The rule enforces the non-interactive ARIA roles are not assigned to interactive HTML elements. Contributed by @nissy-dev

Expand Down
22 changes: 11 additions & 11 deletions Cargo.lock

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

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@ inherits = "release"

[workspace.dependencies]
# publish
biome_analyze = { version = "0.1.0", path = "./crates/biome_analyze" }
biome_aria = { version = "0.1.0", path = "./crates/biome_aria" }
biome_analyze = { version = "0.2.0", path = "./crates/biome_analyze" }
biome_aria = { version = "0.2.0", path = "./crates/biome_aria" }
biome_aria_metadata = { version = "0.1.0", path = "./crates/biome_aria_metadata" }
biome_console = { version = "0.1.0", path = "./crates/biome_console" }
biome_control_flow = { version = "0.1.0", path = "./crates/biome_control_flow" }
biome_control_flow = { version = "0.2.0", path = "./crates/biome_control_flow" }
biome_css_factory = { version = "0.1.0", path = "./crates/biome_css_factory" }
biome_css_parser = { version = "0.1.0", path = "./crates/biome_css_parser" }
biome_css_syntax = { version = "0.1.0", path = "./crates/biome_css_syntax" }
biome_deserialize = { version = "0.1.0", path = "./crates/biome_deserialize" }
biome_diagnostics = { version = "0.1.0", path = "./crates/biome_diagnostics" }
biome_diagnostics_categories = { version = "0.1.0", path = "./crates/biome_diagnostics_categories" }
biome_diagnostics_categories = { version = "0.2.0", path = "./crates/biome_diagnostics_categories" }
biome_diagnostics_macros = { version = "0.1.0", path = "./crates/biome_diagnostics_macros" }
biome_formatter = { version = "0.1.0", path = "./crates/biome_formatter" }
biome_formatter = { version = "0.2.0", path = "./crates/biome_formatter" }
biome_fs = { version = "0.1.0", path = "./crates/biome_fs" }
biome_js_analyze = { version = "0.1.0", path = "./crates/biome_js_analyze" }
biome_js_analyze = { version = "0.2.0", path = "./crates/biome_js_analyze" }
biome_js_factory = { version = "0.1.0", path = "./crates/biome_js_factory" }
biome_js_formatter = { version = "0.1.0", path = "./crates/biome_js_formatter" }
biome_js_formatter = { version = "0.2.0", path = "./crates/biome_js_formatter" }
biome_js_parser = { version = "0.1.0", path = "./crates/biome_js_parser" }
biome_js_semantic = { version = "0.1.0", path = "./crates/biome_js_semantic" }
biome_js_syntax = { version = "0.1.0", path = "./crates/biome_js_syntax" }
biome_js_semantic = { version = "0.2.0", path = "./crates/biome_js_semantic" }
biome_js_syntax = { version = "0.2.0", path = "./crates/biome_js_syntax" }
biome_js_transform = { version = "0.1.0", path = "./crates/biome_js_transform" }
biome_js_unicode_table = { version = "0.1.0", path = "./crates/biome_js_unicode_table" }
biome_json_analyze = { version = "0.1.0", path = "./crates/biome_json_analyze" }
biome_json_analyze = { version = "0.2.0", path = "./crates/biome_json_analyze" }
biome_json_factory = { version = "0.1.0", path = "./crates/biome_json_factory" }
biome_json_formatter = { version = "0.1.0", path = "./crates/biome_json_formatter" }
biome_json_parser = { version = "0.1.0", path = "./crates/biome_json_parser" }
biome_json_syntax = { version = "0.1.0", path = "./crates/biome_json_syntax" }
biome_markup = { version = "0.1.0", path = "./crates/biome_markup" }
biome_parser = { version = "0.1.0", path = "./crates/biome_parser" }
biome_parser = { version = "0.2.0", path = "./crates/biome_parser" }
biome_rowan = { version = "0.1.0", path = "./crates/biome_rowan" }
biome_suppression = { version = "0.1.0", path = "./crates/biome_suppression" }
biome_text_edit = { version = "0.1.0", path = "./crates/biome_text_edit" }
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_analyze/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords.workspace = true
license.workspace = true
name = "biome_analyze"
repository.workspace = true
version = "0.1.0"
version = "0.2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion crates/biome_aria/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords.workspace = true
license.workspace = true
name = "biome_aria"
repository.workspace = true
version = "0.1.0"
version = "0.2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
52 changes: 52 additions & 0 deletions crates/biome_cli/tests/cases/overrides_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,58 @@ fn does_handle_included_file() {
));
}

#[test]
fn does_handle_included_file_and_disable_formatter() {
let mut console = BufferConsole::default();
let mut fs = MemoryFileSystem::default();
let file_path = Path::new("biome.json");
fs.insert(
file_path.into(),
r#"{
"files": {
"include": ["test.js", "special/**"]
},
"overrides": [{ "include": ["special/**"], "formatter": { "enabled": false } }]
}
"#
.as_bytes(),
);

let test = Path::new("test.js");
fs.insert(test.into(), UNFORMATTED.as_bytes());

let test2 = Path::new("special/test2.js");
fs.insert(test2.into(), UNFORMATTED.as_bytes());

let result = run_cli(
DynRef::Borrowed(&mut fs),
&mut console,
Args::from(
[
("format"),
("--write"),
test.as_os_str().to_str().unwrap(),
test2.as_os_str().to_str().unwrap(),
]
.as_slice(),
),
);

assert!(result.is_ok(), "run_cli returned {result:?}");

assert_file_contents(&fs, test2, UNFORMATTED);
assert_file_contents(&fs, test, FORMATTED);

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"does_handle_included_file_and_disable_formatter",
fs,
console,
result,
));
}

#[test]
fn does_include_file_with_different_formatting() {
let mut console = BufferConsole::default();
Expand Down
52 changes: 52 additions & 0 deletions crates/biome_cli/tests/cases/overrides_linter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,58 @@ fn does_handle_included_file() {
));
}

#[test]
fn does_handle_included_file_and_disable_linter() {
let mut console = BufferConsole::default();
let mut fs = MemoryFileSystem::default();
let file_path = Path::new("biome.json");
fs.insert(
file_path.into(),
r#"{
"files": {
"include": ["test.js", "special/**"]
},
"overrides": [{ "include": ["special/**"], "linter": { "enabled": false } }]
}
"#
.as_bytes(),
);

let test = Path::new("test.js");
fs.insert(test.into(), FIX_BEFORE.as_bytes());

let test2 = Path::new("special/test2.js");
fs.insert(test2.into(), FIX_BEFORE.as_bytes());

let result = run_cli(
DynRef::Borrowed(&mut fs),
&mut console,
Args::from(
[
("lint"),
("--apply"),
test.as_os_str().to_str().unwrap(),
test2.as_os_str().to_str().unwrap(),
]
.as_slice(),
),
);

assert!(result.is_ok(), "run_cli returned {result:?}");

assert_file_contents(&fs, test2, FIX_BEFORE);
assert_file_contents(&fs, test, FIX_AFTER);

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"does_handle_included_file_and_disable_linter",
fs,
console,
result,
));
}

#[test]
fn does_include_file_with_different_rules() {
let mut console = BufferConsole::default();
Expand Down
Loading

0 comments on commit 5dcae83

Please sign in to comment.