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 folder symbolic link traversing in Windows #82

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/balena-lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ const findFiles = async (
paths.map(async (p) => {
if ((await fs.stat(p)).isDirectory()) {
files.push(
...(await globAsync(`${p}/**/*.@(${extensions.join('|')})`)),
...(await globAsync(`${p}/**/*.@(${extensions.join('|')})`, {
// Ignore unusual errors while reading directories.
// Avoids EPERM scandir errors in Windows.
// See: https://github.com/isaacs/node-glob/issues/284
strict: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

This could in theory mask errors that a developer might wish to be warned about (e.g. actual permission errors), however presumably such errors would also affect the functioning of the application or the CI builds/tests and should be caught by testing rather than linting, so I think it is a fair enough workaround to a node-glob issue. 👍

})),
);
} else {
files.push(p);
Expand Down