-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't working
Description
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
new RuleTester().run('rule-name', rule, {
valid: [
{
filename: './../../escaped/cwd/file.ts',
code: '"whatever"'
}),
invalid: []
})
ESLint Config
tsconfig
Expected Result
filename should not cause problems since #9906 was fixed (as well as its follow-ons).
Actual Result
running tests causes "No matching configuration found for './../../escaped/cwd/file.ts'."
Additional Info
The .startsWith('..')
check in the following doesn't work with non-normalized paths (e.g. ./../foo.ts
)
typescript-eslint/packages/rule-tester/src/RuleTester.ts
Lines 211 to 218 in f3ef20e
if ( | |
filename != null && | |
(path.isAbsolute(filename) || filename.startsWith('..')) | |
) { | |
basePath = path.parse( | |
path.resolve(basePath ?? process.cwd(), filename), | |
).root; | |
} |
Versions
package | version |
---|---|
@typescript-eslint/rule-tester |
8.39.1 |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't working