Repository: biomejs/biome (language: rust)

Issue:
💅 lint/nursery/noMissingVarFunction doesnt recognize var() after line break
### Environment information

```bash
CLI:
  Version:                      1.9.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.7.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.1.29"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  true
  GraphQL enabled:              false
  Recommended:                  true
  All:                          false
  Enabled rules:
  performance/noDelete
  suspicious/noCatchAssign
  suspicious/noUnsafeNegation
  complexity/useLiteralKeys
  style/useImportType
  complexity/noMultipleSpacesInRegularExpressionLiterals
  a11y/useValidLang
  complexity/noUselessEmptyExport
  nursery/useConsistentMemberAccessibility
  suspicious/useNamespaceKeyword
  a11y/useValidAriaRole
  correctness/noConstantCondition
  a11y/useAriaActivedescendantWithTabindex
  suspicious/noAssignInExpressions
  style/useDefaultParameterLast
  complexity/noEmptyTypeParameters
  correctness/noConstructorReturn
  style/useSelfClosingElements
  suspicious/noDuplicateParameters
  suspicious/noDuplicateSelectorsKeyframeBlock
  suspicious/useValidTypeof
  correctness/noUnknownProperty
  style/useTemplate
  correctness/noUnusedLabels
  complexity/noUselessTernary
  correctness/noUnreachableSuper
  suspicious/noCompareNegZero
  suspicious/noExplicitAny
  correctness/noSwitchDeclarations
  a11y/noAutofocus
  correctness/noUnsafeOptionalChaining
  correctness/noConstAssign
  suspicious/noControlCharactersInRegex
  complexity/noUselessTypeConstraint
  style/noVar
  suspicious/noDoubleEquals
  suspicious/noRedundantUseStrict
  style/useLiteralEnumMembers
  suspicious/noGlobalIsNan
  suspicious/noEmptyInterface
  suspicious/noConstEnum
  nursery/noDuplicateElseIf
  correctness/noPrecisionLoss
  a11y/noLabelWithoutControl
  suspicious/noMisleadingCharacterClass
  suspicious/noRedeclare
  correctness/noStringCaseMismatch
  correctness/noSetterReturn
  correctness/noInvalidConstructorSuper
  suspicious/noImplicitAnyLet
  suspicious/noFallthroughSwitchClause
  suspicious/noUnsafeDeclarationMerging
  correctness/noUnreachable
  a11y/useKeyWithClickEvents
  suspicious/noDuplicateObjectKeys
  complexity/noUselessThisAlias
  complexity/noThisInStatic
  complexity/useOptionalChain
  correctness/noInnerDeclarations
  style/noParameterAssign
  suspicious/noDuplicateCase
  a11y/useValidAnchor
  complexity/useRegexLiterals
  correctness/noSelfAssign
  correctness/noInvalidBuiltinInstantiation
  style/noUselessElse
  style/useShorthandFunctionType
  suspicious/noShadowRestrictedNames
  correctness/noInvalidDirectionInLinearGradient
  nursery/noMissingVarFunction
  suspicious/noImportantInKeyframe
  complexity/noUselessLabel
  complexity/noUselessCatch
  correctness/noUnsafeFinally
  a11y/useAriaPropsForRole
  correctness/noNonoctalDecimalEscape
  style/useEnumInitializers
  a11y/useHtmlLang
  suspicious/noDuplicateTestHooks
  complexity/noStaticOnlyClass
  style/useWhile
  complexity/useArrowFunction
  style/noInferrableTypes
  a11y/noNoninteractiveTabindex
  complexity/useSimpleNumberKeys
  correctness/useYield
  a11y/noInteractiveElementToNoninteractiveRole
  style/useNumericLiterals
  correctness/noUnnecessaryContinue
  nursery/noDuplicatedFields
  suspicious/noApproximativeNumericConstant
  nursery/noDuplicateCustomProperties
  correctness/noGlobalObjectCalls
  suspicious/noImportAssign
  suspicious/noLabelVar
  a11y/useAltText
  correctness/noEmptyCharacterClassInRegex
  correctness/noUnknownUnit
  suspicious/noSparseArray
  a11y/useIframeTitle
  complexity/noBannedTypes
  a11y/noSvgWithoutTitle
  correctness/noVoidElementsWithChildren
  style/useAsConstAssertion
  suspicious/noDebugger
  style/useExportType
  complexity/noUselessLoneBlockStatements
  style/noArguments
  a11y/useValidAriaValues
  nursery/noUnknownPseudoClass
  suspicious/noCommentText
  a11y/useFocusableInteractive
  correctness/noUnmatchableAnbSelector
  suspicious/noGlobalAssign
  suspicious/noDuplicateJsxProps
  suspicious/noMisleadingInstantiator
  a11y/noPositiveTabindex
  correctness/noEmptyPattern
  complexity/noExcessiveNestedTestSuites
  security/noDangerouslySetInnerHtmlWithChildren
  a11y/useKeyWithMouseEvents
  suspicious/noExtraNonNullAssertion
  suspicious/noShorthandPropertyOverrides
  correctness/noRenderReturnValue
  correctness/useExhaustiveDependencies
  nursery/noUnknownPseudoElement
  security/noGlobalEval
  a11y/noRedundantRoles
  complexity/useFlatMap
  correctness/useIsNan
  style/useConst
  suspicious/noGlobalIsFinite
  suspicious/noSelfCompare
  suspicious/noThenProperty
  suspicious/noAsyncPromiseExecutor
  nursery/noDescendingSpecificity
  suspicious/noDuplicateFontNames
  suspicious/useGetterReturn
  security/noDangerouslySetInnerHtml
  style/useNodejsImportProtocol
  a11y/noDistractingElements
  suspicious/noArrayIndexKey
  complexity/noWith
  nursery/useStrictMode
  complexity/noExtraBooleanCast
  performance/noAccumulatingSpread
  a11y/useValidAriaProps
  a11y/noRedundantAlt
  correctness/noChildrenProp
  correctness/noUnknownFunction
  correctness/noInvalidPositionAtImportRule
  suspicious/noConfusingLabels
  suspicious/noDuplicateClassMembers
  suspicious/noPrototypeBuiltins
  suspicious/noConfusingVoidType
  suspicious/noFocusedTests
  a11y/useButtonType
  a11y/useSemanticElements
  nursery/useDeprecatedReason
  suspicious/useDefaultSwitchClauseLast
  a11y/noAriaUnsupportedElements
  correctness/noInvalidGridAreas
  correctness/noFlatMapIdentity
  suspicious/noSuspiciousSemicolonInJsx
  a11y/noBlankTarget
  a11y/useHeadingContent
  correctness/useValidForDirection
  correctness/noVoidTypeReturn
  correctness/noInvalidUseBeforeDeclaration
  a11y/noAriaHiddenOnFocusable
  a11y/useGenericFontNames
  correctness/noUnknownMediaFeatureName
  a11y/useAnchorContent
  complexity/noUselessRename
  nursery/noUselessEscapeInRegex
  style/useNumberNamespace
  complexity/noUselessConstructor
  a11y/noAccessKey
  nursery/useSortedClasses
  style/noUnusedTemplateLiteral
  complexity/noUselessSwitchCase
  style/useExponentiationOperator
  nursery/useAriaPropsSupportedByRole
  style/useSingleVarDeclarator
  suspicious/noExportsInTest
  a11y/noNoninteractiveElementToInteractiveRole
  style/noCommaOperator
  suspicious/noDuplicateAtImportRules
  suspicious/useIsArray
  a11y/noHeaderScope
  complexity/noUselessFragments
  suspicious/noMisrefactoredShorthandAssign
  complexity/noForEach
  suspicious/noClassAssign
  suspicious/noEmptyBlock
  suspicious/noFunctionAssign

Workspace:
  Open Documents:               0
```


### Rule name

lint/nursery/noMissingVarFunction

### Playground link

https://biomejs.dev/playground/?lintRules=all&files.main.tsx=&files.styles.css=OgByAG8AbwB0ACAAewAKACAAIAAtAC0AYwBvAGwAbwByAHMALQBnAHIAYQB5AC0AYQA3ADoAIABiAGwAYQBjAGsAOwAKACAAIAAvACoAIABUAGgAZQAgAGYAbwByAG0AYQB0AHQAZQByACAAYgByAGUAYQBrAHMAIAB0AGgAZQAgAGwAaQBuAGUAIAAqAC8ACgAgACAALQAtAGIAcgBvAGsAZQBuAC0AcwBoAGEAZABvAHcAOgAgADAAcAB4ACAAMQBwAHgAIAAyAHAAeAAgAHYAYQByACgALQAtAGMAbwBsAG8AcgBzAC0AYgBsAGEAYwBrAC0AYQAzACkALAAgADAAcAB4ACAAMABwAHgAIAAxAHAAeAAKACAAIAAgACAAdgBhAHIAKAAtAC0AYwBvAGwAbwByAHMALQBnAHIAYQB5AC0AYQA3ACkAOwAKAAoAIAAgAC8AKgAgAFcAaQB0AGgAbwB1AHQAIABsAGkAbgBlACAAYgByAGUAYQBrACwAIABpAHQAIAB3AG8AcgBrAHMAIABmAGkAbgBlACAAKgAvAAoAIAAgAC0ALQB3AG8AcgBrAGkAbgBnAC0AcwBoAGEAZABvAHcALQBuAG8ALQBsAGkAbgBlAC0AYgByAGUAYQBrADoAIAAwAHAAeAAgADEAcAB4ACAAMgBwAHgAIAB2AGEAcgAoAC0ALQBjAG8AbABvAHIAcwAtAGIAbABhAGMAawAtAGEAMwApACwAIAAwAHAAeAAgADAAcAB4ACAAMQBwAHgAIAB2AGEAcgAoAC0ALQBjAG8AbABvAHIAcwAtAGcAcgBhAHkALQBhADcAKQA7AAoAfQA%3D

### Expected result

Should not throw an error. The linter throws bc it does not recognize the `var()` function being used after a line break, even though it is using the function correctly. If the line break is removed, the error goes away. Also, the formatter is producing the line break - so the path to a solution may start there.

### Code of Conduct

- [X] I agree to follow Biome's Code of Conduct


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e30e56364d6..e85cdc4079c8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,22 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
 
 ### Linter
 
+- Biome no longer crashes when it encounters a string that contain a multibyte character ([#4181](https://github.com/biomejs/biome/issues/4181)).
+
+  This fixes a regression introduced in Biome 1.9.3
+  The regression affected the following linter rules:
+
+  - nursery/useSortedClasses
+  - nursery/useTrimStartEnd
+  - style/useTemplate
+  - suspicious/noMisleadingCharacterClass
+
+  Contributed by @Conaclos
+
+- Fix [#4190](https://github.com/biomejs/biome/issues/4190), where the rule `noMissingVarFunction` wrongly reported a variable as missing when used inside a `var()`  function that was a newline. Contributed by @ematipico
+
+### Parser
+
 #### Bug Fixes
 
 - The CSS parser now accepts more emoji in identifiers ([#3627](https://github.com/biomejs/biome/issues/3627#issuecomment-2392388022)).
@@ -45,20 +61,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
   }
   ```
 
-- Biome no longer crashes when it encounters a string that contain a multibyte character ([#4181](https://github.com/biomejs/biome/issues/4181)).
-
-  This fixes a regression introduced in Biome 1.9.3
-  The regression affected the following linter rules:
-
-  - nursery/useSortedClasses
-  - nursery/useTrimStartEnd
-  - style/useTemplate
-  - suspicious/noMisleadingCharacterClass
-
   Contributed by @Conaclos
 
-### Parser
-
 ## v1.9.3 (2024-10-01)
 
 ### CLI
diff --git a/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs b/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs
index 38675bd7e392..e192963942c4 100644
--- a/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs
+++ b/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs
@@ -222,7 +222,7 @@ fn is_wrapped_in_var(node: &CssDashedIdentifier) -> bool {
             // e.g `color: --custom-property;`
             //             ^^^^^^^^^^^^^^^^ CSS_GENERIC_COMPONENT_VALUE_LIST
             CssSyntaxKind::CSS_GENERIC_COMPONENT_VALUE_LIST => return false,
-            CssSyntaxKind::CSS_FUNCTION => return parent.text().starts_with("var"),
+            CssSyntaxKind::CSS_FUNCTION => return parent.text_trimmed().starts_with("var"),
             _ => {}
         }
         current_node = parent.parent();


Test patch:
diff --git a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css
index bbb288bd9017..8ed3b50ccd2e 100644
--- a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css
+++ b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css
@@ -66,3 +66,10 @@ a {
         --foo: red;
     }
 }
+
+:root {
+	--colors-gray-a7: black;
+	/* The formatter breaks the line */
+	--broken-shadow: 0px 0px 1px
+	var(--colors-gray-a7);
+}
diff --git a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap
index 04c5c0e97268..9eb37f42e50b 100644
--- a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap
+++ b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap
@@ -73,4 +73,11 @@ a {
     }
 }
 
+:root {
+	--colors-gray-a7: black;
+	/* The formatter breaks the line */
+	--broken-shadow: 0px 0px 1px
+	var(--colors-gray-a7);
+}
+
 ```