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

💅 noChildrenProp doesn't throw warning/error when children passed as a prop is placed in a new a line #2211

Closed
1 task done
nouman2075 opened this issue Mar 26, 2024 · 1 comment · Fixed by #2214
Closed
1 task done
Labels
good first issue Good for newcomers L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@nouman2075
Copy link

Environment information

CLI:
  Version:                      1.6.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.0.33"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Linter:
  Recommended:                  true
  All:                          false
  Rules:                        complexity/noEmptyTypeParameters = "error"
                                complexity/noExcessiveCognitiveComplexity = {"level":"error","options":{"maxAllowedComplexity":30}}
                                complexity/noForEach = "off"
                                complexity/noStaticOnlyClass = "off"
                                complexity/noUselessFragments = "error"
                                complexity/noUselessLoneBlockStatements = "error"
                                complexity/useSimplifiedLogicExpression = "error"
                                correctness/noInvalidUseBeforeDeclaration = "error"
                                correctness/noUndeclaredVariables = "error"
                                correctness/noUnusedImports = "error"
                                correctness/noUnusedPrivateClassMembers = "error"
                                correctness/noUnusedVariables = "error"
                                correctness/useHookAtTopLevel = "error"
                                nursery/noBarrelFile = "error"
                                nursery/noDuplicateJsonKeys = "error"
                                nursery/noDuplicateTestHooks = "error"
                                nursery/noExcessiveNestedTestSuites = "error"
                                nursery/noExportsInTest = "error"
                                nursery/noNamespaceImport = "error"
                                nursery/noNodejsModules = "error"
                                nursery/noSemicolonInJsx = "error"
                                nursery/noUselessTernary = "error"
                                nursery/useNodeAssertStrict = "error"
                                nursery/useSortedClasses = {"level":"error","options":{"attributes":["class","className"],"functions":["joinClasses"]}}
                                style/useCollapsedElseIf = "error"
                                style/useConsistentArrayType = {"level":"error","options":{"syntax":"generic"}}
                                style/useExportType = "error"
                                style/useFilenamingConvention = {"level":"error","options":{"filenameCases":["camelCase","export","PascalCase"]}}
                                style/useForOf = "error"
                                style/useFragmentSyntax = "error"
                                style/useImportType = "error"
                                style/useNodejsImportProtocol = "error"
                                style/useNumberNamespace = "error"
                                style/useShorthandAssign = "error"
                                style/useShorthandFunctionType = "error"
                                style/useSingleCaseStatement = "error"
                                suspicious/noConsoleLog = "warn"
                                suspicious/noEmptyBlockStatements = "error"
                                suspicious/noGlobalAssign = "error"
                                suspicious/noThenProperty = "error"
                                suspicious/useAwait = "error"

Workspace:
  Open Documents:               0

Rule name

noChildrenProp

Playground link

https://biomejs.dev/playground/?code=YwBvAG4AcwB0ACAAQQBwAHAAIAA9ACAAKAApACAAPQA%2BACAAewAKAAkAcgBlAHQAdQByAG4AIAAoAAoACQAJADwAPgAKAAkACQAJADwAQwBoAGkAbABkACAAYwBoAGkAbABkAHIAZQBuAD0AJwBXAG8AcgBsAGQAJwAgAC8APgAKAAkACQAJADwAQwBoAGkAbABkAAoACQAJAAkACQAvAC8ACgAJAAkACQAJAGMAaABpAGwAZAByAGUAbgA9ACcASABlAGwAbABvACcACgAJAAkACQAvAD4ACgAJAAkACQA8AEMAaABpAGwAZAAgAAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIABjAGwAYQBzAHMATgBhAG0AZQA9ACcAdABlAHMAdABpAG4AZwAnAAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIABjAGgAaQBsAGQAcgBlAG4APQAnAEgAZQBsAGwAbwAnAAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAALwA%2BAAoACQAJADwALwA%2BAAoACQApADsACgB9ADsACgAKAGMAbwBuAHMAdAAgAEMAaABpAGwAZAAgAD0AIAAoAHsAIABjAGgAaQBsAGQAcgBlAG4ALAAgAC4ALgAuAHIAZQBzAHQAIAB9ADoAIAB7ACAAYwBoAGkAbABkAHIAZQBuADoAIABSAGUAYQBjAHQALgBSAGUAYQBjAHQATgBvAGQAZQA7ACAAYwBsAGEAcwBzAE4AYQBtAGUAPwA6ACAAcwB0AHIAaQBuAGcAIAB9ACkAIAA9AD4AIAB7AAoACQByAGUAdAB1AHIAbgAgADwAcwBwAGEAbgAgAHsALgAuAC4AcgBlAHMAdAB9AD4AewBjAGgAaQBsAGQAcgBlAG4AfQA8AC8AcwBwAGEAbgA%2BADsACgB9ADsACgA%3D

Expected result

It should throw/error warning when children is passed as a prop regardless of the placement of prop whether all props are placed in one line or in a separate line

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico added good first issue Good for newcomers S-Help-wanted Status: you're familiar with the code base and want to help the project L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Mar 26, 2024
@ematipico
Copy link
Member

This is an easy fix, you just need to replace text() with text_trimmed():

if name.value_token().ok()?.text() == "children" {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants