Skip to content

💅 noProcessEnv only works with the global process object (false negative) #9061

@luisfi-dev

Description

@luisfi-dev

Environment information

Details
CLI:
  Version:                      2.3.14
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  BIOME_THREADS:                unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v24.13.1
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         bun/1.3.9

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  false
  HTML full support enabled:    unset

Linter:
  JavaScript enabled:           unset
  JSON enabled:                 unset
  CSS enabled:                  unset
  GraphQL enabled:              unset
  Recommended:                  false
  Enabled rules:
    complexity/noAdjacentSpacesInRegex
    complexity/noArguments
    complexity/noBannedTypes
    complexity/noCommaOperator
    complexity/noEmptyTypeParameters
    complexity/noExcessiveCognitiveComplexity
    complexity/noExcessiveLinesPerFunction
    complexity/noExcessiveNestedTestSuites
    complexity/noExtraBooleanCast
    complexity/noFlatMapIdentity
    complexity/noImplicitCoercions
    complexity/noStaticOnlyClass
    complexity/noThisInStatic
    complexity/noUselessCatch
    complexity/noUselessConstructor
    complexity/noUselessContinue
    complexity/noUselessEmptyExport
    complexity/noUselessEscapeInRegex
    complexity/noUselessLabel
    complexity/noUselessLoneBlockStatements
    complexity/noUselessRename
    complexity/noUselessStringConcat
    complexity/noUselessStringRaw
    complexity/noUselessSwitchCase
    complexity/noUselessTernary
    complexity/noUselessThisAlias
    complexity/noUselessTypeConstraint
    complexity/noUselessUndefinedInitialization
    complexity/noVoid
    complexity/useArrowFunction
    complexity/useDateNow
    complexity/useFlatMap
    complexity/useIndexOf
    complexity/useNumericLiterals
    complexity/useOptionalChain
    complexity/useRegexLiterals
    complexity/useSimpleNumberKeys
    complexity/useSimplifiedLogicExpression
    complexity/useWhile
    correctness/noConstantCondition
    correctness/noConstantMathMinMaxClamp
    correctness/noConstructorReturn
    correctness/noEmptyCharacterClassInRegex
    correctness/noEmptyPattern
    correctness/noGlobalDirnameFilename
    correctness/noInnerDeclarations
    correctness/noPrecisionLoss
    correctness/noPrivateImports
    correctness/noProcessGlobal
    correctness/noSelfAssign
    correctness/noStringCaseMismatch
    correctness/noSwitchDeclarations
    correctness/noUndeclaredDependencies
    correctness/noUnreachable
    correctness/noUnsafeFinally
    correctness/noUnsafeOptionalChaining
    correctness/noUnusedFunctionParameters
    correctness/noUnusedImports
    correctness/noUnusedLabels
    correctness/noUnusedPrivateClassMembers
    correctness/noUnusedVariables
    correctness/useIsNan
    correctness/useParseIntRadix
    correctness/useSingleJsDocAsterisk
    correctness/useValidForDirection
    correctness/useYield
    performance/noAccumulatingSpread
    performance/noAwaitInLoops
    performance/noBarrelFile
    performance/noDelete
    performance/noDynamicNamespaceImportAccess
    performance/noReExportAll
    performance/useTopLevelRegex
    security/noGlobalEval
    security/noSecrets
    style/noCommonJs
    style/noDefaultExport
    style/noDoneCallback
    style/noExportedImports
    style/noInferrableTypes
    style/noMagicNumbers
    style/noNegationElse
    style/noNestedTernary
    style/noNonNullAssertion
    style/noParameterAssign
    style/noProcessEnv

Workspace:
  Open Documents:               0

Rule name

noProcessEnv

Playground link

https://biomejs.dev/playground/?indentWidth=4&lintRules=noProcessEnv&code=LwAvACAAVQBuAGMAbwBtAG0AZQBuAHQAaQBuAGcAIAB0AGgAZQAgAGkAbQBwAG8AcgB0ACAAcwB0AGEAdABlAG0AZQBuAHQAIABiAGUAbABvAHcAIABtAGEAawBlAHMACgAvAC8AIAB0AGgAZQAgAGwAaQBuAHQAIABkAGkAcwBhAHAAcABlAGEAcgAsACAAdwBoAGUAbgAgAGkAdAAgAHMAaABvAHUAbABkAG4AJwB0AC4ACgAvAC8AIAA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQAKAC8ALwAgAGkAbQBwAG8AcgB0ACAAcAByAG8AYwBlAHMAcwAgAGYAcgBvAG0AIAAiAHAAcgBvAGMAZQBzAHMAIgA7AAoAaQBtAHAAbwByAHQAIAB7ACAAZQBuAHYAIAB9ACAAZgByAG8AbQAgACIAcAByAG8AYwBlAHMAcwAiADsACgBjAG8AbgBzAG8AbABlAC4AbABvAGcAKABwAHIAbwBjAGUAcwBzAC4AZQBuAHYALgBQAFIATwBKAEUAQwBUAF8ASQBEACkAOwAKAAoALwAvACAASQBtAHAAbwByAHQAaQBuAGcAIAB0AGgAZQAgAGAAZQBuAHYAYAAgAG8AYgBqAGUAYwB0ACAAcwBlAHAAYQByAGEAdABlAGwAeQAgAGEAbABzAG8ACgAvAC8AIAByAGUAbQBvAHYAZQBzACAAdABoAGUAIABsAGkAbgB0AC4ACgBjAG8AbgBzAG8AbABlAC4AbABvAGcAKABlAG4AdgAuAFAAUgBPAEoARQBDAFQAXwBJAEQAKQA%3D&language=ts

Expected result

The lint should also trigger when importing the process object or the env object inside it, not just when using the global process object.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bugS-Help-wantedStatus: you're familiar with the code base and want to help the project

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions