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

🐛 Unexpected override behavior #691

Closed
1 task done
nstepien opened this issue Nov 8, 2023 · 5 comments · Fixed by #1278
Closed
1 task done

🐛 Unexpected override behavior #691

nstepien opened this issue Nov 8, 2023 · 5 comments · Fixed by #1278
Assignees
Labels
A-Project Area: project 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

@nstepien
Copy link
Contributor

nstepien commented Nov 8, 2023

Environment information

CLI:
  Version:                      1.3.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v21.1.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.2.3"

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

Workspace:
  Open Documents:               0

What happened?

{
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  "files": {
    "ignore": ["./.cache/**/*", "./coverage/**/*", "./translations/**/*"]
  },
  "formatter": {
    "ignore": ["*.ts", "*.tsx"],
    "indentStyle": "space"
  },
  "json": {
    "parser": {
      "allowComments": true
    }
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "single",
      "trailingComma": "none"
    }
  },
  "linter": {
    "rules": {
      "recommended": false,
      "a11y": {
        "noAccessKey": "warn",
        "noAriaUnsupportedElements": "warn",
        "noAutofocus": "off",
        "noBlankTarget": "warn",
        "noDistractingElements": "warn",
        "noHeaderScope": "warn",
        "noNoninteractiveElementToInteractiveRole": "warn",
        "noNoninteractiveTabindex": "off",
        "noPositiveTabindex": "warn",
        "noRedundantAlt": "warn",
        "noRedundantRoles": "warn",
        "noSvgWithoutTitle": "off",
        "useAltText": "warn",
        "useAnchorContent": "warn",
        "useAriaPropsForRole": "warn",
        "useButtonType": "warn",
        "useHeadingContent": "warn",
        "useHtmlLang": "warn",
        "useIframeTitle": "off",
        "useKeyWithClickEvents": "off",
        "useKeyWithMouseEvents": "warn",
        "useMediaCaption": "off",
        "useValidAnchor": "off",
        "useValidAriaProps": "warn",
        "useValidAriaValues": "warn",
        "useValidLang": "warn"
      },
      "complexity": {
        "noBannedTypes": "warn",
        "noExcessiveCognitiveComplexity": "off",
        "noExtraBooleanCast": "warn",
        "noForEach": "off",
        "noMultipleSpacesInRegularExpressionLiterals": "warn",
        "noStaticOnlyClass": "warn",
        "noUselessCatch": "warn",
        "noUselessConstructor": "warn",
        "noUselessEmptyExport": "warn",
        "noUselessFragments": "warn",
        "noUselessLabel": "warn",
        "noUselessRename": "warn",
        "noUselessSwitchCase": "warn",
        "noUselessThisAlias": "warn",
        "noUselessTypeConstraint": "warn",
        "noVoid": "warn",
        "noWith": "warn",
        "useFlatMap": "warn",
        "useLiteralKeys": "warn",
        "useOptionalChain": "warn",
        "useSimpleNumberKeys": "warn",
        "useSimplifiedLogicExpression": "off"
      },
      "correctness": {
        "noChildrenProp": "off",
        "noConstAssign": "warn",
        "noConstantCondition": "warn",
        "noConstructorReturn": "warn",
        "noEmptyPattern": "warn",
        "noGlobalObjectCalls": "warn",
        "noInnerDeclarations": "warn",
        "noInvalidConstructorSuper": "warn",
        "noNewSymbol": "warn",
        "noNonoctalDecimalEscape": "warn",
        "noPrecisionLoss": "warn",
        "noRenderReturnValue": "warn",
        "noSelfAssign": "warn",
        "noSetterReturn": "warn",
        "noStringCaseMismatch": "warn",
        "noSwitchDeclarations": "warn",
        "noUndeclaredVariables": "off",
        "noUnnecessaryContinue": "warn",
        "noUnreachable": "warn",
        "noUnreachableSuper": "warn",
        "noUnsafeFinally": "warn",
        "noUnsafeOptionalChaining": "warn",
        "noUnusedLabels": "warn",
        "noUnusedVariables": "off",
        "noVoidElementsWithChildren": "warn",
        "noVoidTypeReturn": "warn",
        "useExhaustiveDependencies": "off",
        "useHookAtTopLevel": "off",
        "useIsNan": "warn",
        "useValidForDirection": "warn",
        "useYield": "warn"
      },
      "performance": {
        "noAccumulatingSpread": "warn",
        "noDelete": "warn"
      },
      "security": {
        "noDangerouslySetInnerHtml": "warn",
        "noDangerouslySetInnerHtmlWithChildren": "warn"
      },
      "style": {
        "noArguments": "warn",
        "noCommaOperator": "warn",
        "noImplicitBoolean": "off",
        "noInferrableTypes": "warn",
        "noNamespace": "warn",
        "noNegationElse": "off",
        "noNonNullAssertion": "off",
        "noParameterAssign": "off",
        "noParameterProperties": "warn",
        "noRestrictedGlobals": "warn",
        "noShoutyConstants": "warn",
        "noUnusedTemplateLiteral": "warn",
        "noVar": "warn",
        "useBlockStatements": "off",
        "useCollapsedElseIf": "warn",
        "useConst": "warn",
        "useDefaultParameterLast": "off",
        "useEnumInitializers": "off",
        "useExponentiationOperator": "warn",
        "useFragmentSyntax": "warn",
        "useLiteralEnumMembers": "warn",
        "useNamingConvention": "off",
        "useNumericLiterals": "warn",
        "useSelfClosingElements": "warn",
        "useShorthandArrayType": "warn",
        "useSingleCaseStatement": "off",
        "useSingleVarDeclarator": "warn",
        "useTemplate": "warn",
        "useWhile": "warn"
      },
      "suspicious": {
        "noArrayIndexKey": "off",
        "noAssignInExpressions": "off",
        "noAsyncPromiseExecutor": "warn",
        "noCatchAssign": "warn",
        "noClassAssign": "warn",
        "noCommentText": "warn",
        "noCompareNegZero": "warn",
        "noConfusingLabels": "warn",
        "noConfusingVoidType": "warn",
        "noConsoleLog": "warn",
        "noConstEnum": "warn",
        "noControlCharactersInRegex": "warn",
        "noDebugger": "warn",
        "noDoubleEquals": "warn",
        "noDuplicateCase": "warn",
        "noDuplicateClassMembers": "warn",
        "noDuplicateJsxProps": "warn",
        "noDuplicateObjectKeys": "warn",
        "noDuplicateParameters": "warn",
        "noEmptyInterface": "warn",
        "noExplicitAny": "warn",
        "noExtraNonNullAssertion": "warn",
        "noFallthroughSwitchClause": "warn",
        "noFunctionAssign": "warn",
        "noGlobalIsFinite": "warn",
        "noGlobalIsNan": "warn",
        "noImportAssign": "warn",
        "noLabelVar": "warn",
        "noPrototypeBuiltins": "warn",
        "noRedeclare": "warn",
        "noRedundantUseStrict": "warn",
        "noSelfCompare": "warn",
        "noShadowRestrictedNames": "warn",
        "noSparseArray": "warn",
        "noUnsafeDeclarationMerging": "warn",
        "noUnsafeNegation": "warn",
        "useDefaultSwitchClauseLast": "warn",
        "useGetterReturn": "warn",
        "useIsArray": "warn",
        "useNamespaceKeyword": "warn",
        "useValidTypeof": "warn"
      }
    }
  },
  "organizeImports": {
    "enabled": false
  },
  "overrides": [
    {
      "include": ["**/*.js"],
      "linter": {
        "rules": {
          "suspicious": {
            "noConsoleLog": "off"
          }
        }
      }
    }
  ]
}

Using this config, I've added an override at the end to allow console calls in all .js files.
But this changes the behavior of Biome in unexpected ways:

  • running biome ci . now wants .js files to have a different formatting, like using tabs instead of spaces for indentation
    • it seems like it resets the formatting options for files that match the override
  • files under the coverage directory are now checked for lints/format
    • these files should be ignored, as configured by files.ignore

Expected result

Overrides should only... override what's defined in them, they should not reset Biome to use default configs on matched files.

Files that are ignored/excluded should still be ignored/excluded.
Please let me know if you want more details/opinions.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico added A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug labels Nov 11, 2023
@ematipico ematipico self-assigned this Nov 15, 2023
@ematipico
Copy link
Member

ematipico commented Nov 19, 2023

This should be fixed now. Closed by #625 and #737

I keep it open, so we can confirm if the next release fixes your issue.

@nstepien
Copy link
Contributor Author

1.4.0 still resets formatting settings for .js files with the overrides config above.
For example, I have .js files with space indentation, but Biome wants tabs instead when I add the override. Even though the override does not change any formatter settings.

@ematipico
Copy link
Member

Thank you for the feedback, I'll look into it next week unless someone else is able to work on it

@nstepien
Copy link
Contributor Author

Thanks! I'll check again when the next version is released, early January most likely.

@nstepien
Copy link
Contributor Author

nstepien commented Jan 8, 2024

The config above works fine now in 1.5.0! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Project Area: project 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