Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(biome_diagnostics): fix JetBrains relative file URLs should be clickable when given line and column numbers #4875

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
## Unreleased

- Fix [#4323](https://github.com/biomejs/biome/issues/4258), where `lint/a11y/useSemanticElement` accidentally showed recommendations for `role="searchbox"` instead of `role="search"`
- Fix [#4875](https://github.com/biomejs/biome/issues/4875), where the Jetbrains IDE terminal would output unclickable, relative file path links to files. This does not fix paths without line and column numbers. Contributed by @Andrew-Chen-Wang

### Analyzer

Expand Down Expand Up @@ -41,6 +42,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
- `biome migrate eslint` now correctly handles ESLint configuration with `null` values in file lists ([#4740](https://github.com/biomejs/biome/issues/4740)).
Contributed by @Conaclos

- Fix [#4202](https://github.com/biomejs/biome/issues/4202), where the formatting of the test function was different from prettier. Contributed by @mdm317

### Configuration

### Editors
Expand Down Expand Up @@ -89,6 +92,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

- `noDuplicateProperties` now throws lint errors properly when we use `@supports` (fix [#4756](https://github.com/biomejs/biome/issues/4756)) Contributed by @mehm8128

- Fix [#4719](https://github.com/biomejs/biome/issues/4719), `bracketSameLine` now performs as expected when a comment is placed before the last JSX attribute. Contributed by @bushuai

### JavaScript APIs

### Linter
Expand Down Expand Up @@ -350,6 +355,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

- [noUselessFragments](https://biomejs.dev/linter/rules/no-useless-fragments/) now handles `JsxAttributeInitializerClause`, ensuring that fragments inside expressions like `<A b=<></> />` are preserved. ([#4208](https://github.com/biomejs/biome/issues/4208)). Contributed by @MaxtuneLee

- [useSortedClasses](https://biomejs.dev/linter/rules/use-sorted-classes/) now suggests code fixes that match the JSX quote style of the formatter ([#4855](https://github.com/biomejs/biome/issues/4855)). Contributed by @lucasweng

### Parser

#### Bug fixes
Expand Down
11 changes: 6 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ getrandom = "0.2.15"
globset = "0.4.15"
ignore = "0.4.23"
indexmap = { version = "2.7.0", features = ["serde"] }
insta = "1.41.1"
insta = "1.42.0"
natord = "1.0.9"
oxc_resolver = "3.0.3"
proc-macro2 = "1.0.86"
Expand Down
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"node": ">20.0.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "8.18.1",
"@typescript-eslint/eslint-plugin": "8.19.1",
"dprint": "0.48.0",
"eslint": "9.17.0",
"prettier": "3.3.3"
Expand Down
8 changes: 8 additions & 0 deletions crates/biome_analyze/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct RuleContext<'a, R: Rule> {
file_path: &'a Path,
options: &'a R::Options,
preferred_quote: &'a PreferredQuote,
preferred_jsx_quote: &'a PreferredQuote,
jsx_runtime: Option<JsxRuntime>,
}

Expand All @@ -33,6 +34,7 @@ where
file_path: &'a Path,
options: &'a R::Options,
preferred_quote: &'a PreferredQuote,
preferred_jsx_quote: &'a PreferredQuote,
jsx_runtime: Option<JsxRuntime>,
) -> Result<Self, Error> {
let rule_key = RuleKey::rule::<R>();
Expand All @@ -45,6 +47,7 @@ where
file_path,
options,
preferred_quote,
preferred_jsx_quote,
jsx_runtime,
})
}
Expand Down Expand Up @@ -168,6 +171,11 @@ where
self.preferred_quote
}

/// Returns the preferred JSX quote that should be used when providing code actions
pub fn as_preferred_jsx_quote(&self) -> &PreferredQuote {
self.preferred_jsx_quote
}

/// Attempts to retrieve a service from the current context
///
/// ```no_test
Expand Down
7 changes: 7 additions & 0 deletions crates/biome_analyze/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ pub struct AnalyzerConfiguration {
/// Allows to choose a different quote when applying fixes inside the lint rules
pub preferred_quote: PreferredQuote,

/// Allows to choose a different JSX quote when applying fixes inside the lint rules
pub preferred_jsx_quote: PreferredQuote,

/// Indicates the type of runtime or transformation used for interpreting JSX.
pub jsx_runtime: Option<JsxRuntime>,
}
Expand Down Expand Up @@ -117,6 +120,10 @@ impl AnalyzerOptions {
pub fn preferred_quote(&self) -> &PreferredQuote {
&self.configuration.preferred_quote
}

pub fn preferred_jsx_quote(&self) -> &PreferredQuote {
&self.configuration.preferred_jsx_quote
}
}

#[derive(Debug, Default)]
Expand Down
2 changes: 2 additions & 0 deletions crates/biome_analyze/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ impl<L: Language + Default> RegistryRule<L> {
let query_result = <R::Query as Queryable>::unwrap_match(params.services, query_result);
let globals = params.options.globals();
let preferred_quote = params.options.preferred_quote();
let preferred_jsx_quote = params.options.preferred_jsx_quote();
let jsx_runtime = params.options.jsx_runtime();
let options = params.options.rule_options::<R>().unwrap_or_default();
let ctx = match RuleContext::new(
Expand All @@ -409,6 +410,7 @@ impl<L: Language + Default> RegistryRule<L> {
&params.options.file_path,
&options,
preferred_quote,
preferred_jsx_quote,
jsx_runtime,
) {
Ok(ctx) => ctx,
Expand Down
4 changes: 4 additions & 0 deletions crates/biome_analyze/src/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ where
fn diagnostic(&self) -> Option<AnalyzerDiagnostic> {
let globals = self.options.globals();
let preferred_quote = self.options.preferred_quote();
let preferred_jsx_quote = self.options.preferred_jsx_quote();
let options = self.options.rule_options::<R>().unwrap_or_default();
let ctx = RuleContext::new(
&self.query_result,
Expand All @@ -355,6 +356,7 @@ where
&self.options.file_path,
&options,
preferred_quote,
preferred_jsx_quote,
self.options.jsx_runtime(),
)
.ok()?;
Expand Down Expand Up @@ -386,6 +388,7 @@ where
&self.options.file_path,
&options,
self.options.preferred_quote(),
self.options.preferred_jsx_quote(),
self.options.jsx_runtime(),
)
.ok();
Expand Down Expand Up @@ -435,6 +438,7 @@ where
&self.options.file_path,
&options,
self.options.preferred_quote(),
self.options.preferred_jsx_quote(),
self.options.jsx_runtime(),
)
.ok();
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_aria/src/roles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl AriaRoles {

/// Given an element name and attributes, it returns the role associated with that element.
/// If no explicit role attribute is present, an implicit role is returned.
fn get_role_by_element_name(&self, element: &impl Element) -> Option<AriaRole> {
pub fn get_role_by_element_name(&self, element: &impl Element) -> Option<AriaRole> {
element
.find_attribute_by_name(|name| name == "role")
.as_ref()
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_aria_metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn is_valid_html_id(id: &str) -> bool {
}

impl AriaRole {
/// Returns the first valid role from `values`, a space-separated list of roles.
/// Returns the first valid role from `roles`, a space-separated list of roles.
///
/// If a role attribute has multiple values, the first valid role (specified role) will be used.
/// See <https://www.w3.org/TR/2014/REC-wai-aria-implementation-20140320/#mapping_role>
Expand Down
10 changes: 10 additions & 0 deletions crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs

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

Loading
Loading