diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b0914ef2db7..c2795534d903 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -536,6 +536,7 @@ Members are listed in alphabetical order. Members are free to use the full name, - [Dani Guardiola @DaniGuardiola](https://github.com/DaniGuardiola) - [Justinas Delinda @minht11](https://github.com/minht11) - [Madeline Gurriarán @SuperchupuDev](https://github.com/SuperchupuDev) +- [Maikel @Netail](https://github.com/netail) - [Marat Dulin @mdevils](https://github.com/mdevils) - [Vladimir Ivanov_@vlad](https://github.com/vladimir-ivanov) - [Vo Hoang Long @vohoanglong0107](https://github.com/vohoanglong0107) diff --git a/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql.snap b/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql.snap index f8c26f3fb1c0..2e6063c3d69e 100644 --- a/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql.snap +++ b/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql.snap @@ -7,18 +7,3 @@ expression: allowComments.graphql # Allowed comment ``` - -# Diagnostics -``` -allowComments.graphql:2:1 lint/nursery/noEmptySource ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - i An empty source is not allowed. - - 1 │ # Allowed comment - > 2 │ - │ - - i Empty sources can clutter the codebase and increase cognitive load; deleting empty sources can help reduce it. - - -``` diff --git a/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json b/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json index 216117387f81..235a3169257b 100644 --- a/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json +++ b/crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json @@ -1,5 +1,5 @@ { - "$schema": "../../../../../../packages/@biomejs/biome/configuration_schema.json", + "$schema": "../../../../../../../packages/@biomejs/biome/configuration_schema.json", "linter": { "rules": { "nursery": { diff --git a/crates/biome_service/src/file_handlers/graphql.rs b/crates/biome_service/src/file_handlers/graphql.rs index 2e8be643e8d8..3fca52144ffc 100644 --- a/crates/biome_service/src/file_handlers/graphql.rs +++ b/crates/biome_service/src/file_handlers/graphql.rs @@ -4,6 +4,7 @@ use super::{ SearchCapabilities, is_diagnostic_error, }; use crate::WorkspaceError; +use crate::configuration::to_analyzer_rules; use crate::file_handlers::DebugCapabilities; use crate::file_handlers::{ AnalyzerCapabilities, Capabilities, FormatterCapabilities, ParserCapabilities, @@ -16,7 +17,9 @@ use crate::utils::growth_guard::GrowthGuard; use crate::workspace::{ CodeAction, FixAction, FixFileMode, FixFileResult, GetSyntaxTreeResult, PullActionsResult, }; -use biome_analyze::{AnalysisFilter, AnalyzerOptions, ControlFlow, Never, RuleError}; +use biome_analyze::{ + AnalysisFilter, AnalyzerConfiguration, AnalyzerOptions, ControlFlow, Never, RuleError, +}; use biome_configuration::graphql::{ GraphqlAssistConfiguration, GraphqlAssistEnabled, GraphqlFormatterConfiguration, GraphqlFormatterEnabled, GraphqlLinterConfiguration, GraphqlLinterEnabled, @@ -167,15 +170,18 @@ impl ServiceLanguage for GraphqlLanguage { } fn resolve_analyzer_options( - _global: &Settings, + global: &Settings, _language: &Self::LinterSettings, _environment: Option<&Self::EnvironmentSettings>, path: &BiomePath, _file_source: &DocumentFileSource, suppression_reason: Option<&str>, ) -> AnalyzerOptions { + let configuration = + AnalyzerConfiguration::default().with_rules(to_analyzer_rules(global, path.as_path())); AnalyzerOptions::default() .with_file_path(path.as_path()) + .with_configuration(configuration) .with_suppression_reason(suppression_reason) }