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

fix(linter): improve handling of barrel entry point files #12543

Closed
wants to merge 1 commit into from

Conversation

forivall
Copy link
Contributor

Current Behavior

ENOENT or other file reading errors when tsconfig paths are configured in some ways, such as in #12067

Expected Behavior

ESLint should not crash and should gracefully continue

Related Issue(s)

Fixes #12067

@vercel
Copy link

vercel bot commented Oct 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) Oct 12, 2022 at 8:17AM (UTC)

tsConfigBase.compilerOptions.paths[entry].map((x) => ({
path: x,
paths[entry].map((x) => ({
path: [x, `${x}.ts`, `${x}.js`].find(existsSync) || x,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, do a readdir on the parent directory, and check extensions there.

@meeroslav
Copy link
Contributor

Debugging now on WebStorm, I don't think this solves the issue. It actually hides it and the result is an invalid message being returned by the linter.

The file exists, but readFileSync does not find it, meaning we need to ensure the path is correct and full.

@meeroslav meeroslav closed this Nov 2, 2022
@meeroslav
Copy link
Contributor

Please check #12953 for the solution to the given problem.

@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESLint: ENOENT: no such file or directory when referencing the secondary entry point
2 participants