Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: context.cwd is incorrect set as / when absolute path is used as filename in rule tester #11274

Open
@JounQin

Description

@JounQin

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Relevant Package

rule-tester

Playground Link

No response

Repro Code

basePath = path.parse(
path.resolve(basePath ?? process.cwd(), filename),
).root;

Expected Result

context.cwd should not be set /

Actual Result

context.cwd === '/'

Additional Info

I thought it was ESLint's issue eslint/eslint#19821, and found out it's actually typescript-eslint's.

Versions

package version
@typescript-eslint/rule-tester 8.33.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: rule-testerIssues related to the @typescript-eslint/rule-tester package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions