Skip to content

Files with uppercased letter can't be parsed on case-insensitive filesystem in folder with case-sensitivity support #4680

@wKich

Description

@wKich
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

  1. Windows machine
  2. Enable case-sensitivity support by fsutil.exe file SetCaseSensitiveInfo C:\folder\path enable
  3. Inside case-sensitivity folder create/open project that contains files with uppercased letters
  4. Run eslint

Actual Result

Got errors, like this

C:\Users\nflaz\Projects\creevey\creevey\stories\TestViews.stories.tsx
  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: stories\TestViews.stories.tsx.
The file must be included in at least one of the projects provided

Expected Result

There shouldn't be Parsing error: "parserOptions.project" errors

Additional Info

After many hours of trying to figure out that was happening. I found this piece of code:

const useCaseSensitiveFileNames =
ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true;
const correctPathCasing = useCaseSensitiveFileNames
? (filePath: string): string => filePath
: (filePath: string): string => filePath.toLowerCase();

It seems, like on system-level useCaseSensitiveFileNames is false, but my project folder has case sensitivity support. So I tried to set useCaseSensitiveFileNames to true and voi la, no more parserOptions.project errors.

Versions

package version
@typescript-eslint/typescript-estree 5.14.0
TypeScript 4.4.3
node 14.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinghelp wantedExtra attention is neededpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions