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

symlink paths #1318

Open
JamesKyburz opened this issue Aug 30, 2023 · 4 comments
Open

symlink paths #1318

JamesKyburz opened this issue Aug 30, 2023 · 4 comments

Comments

@JamesKyburz
Copy link

Symlink paths

When this tool is used together with husky and prettier symlink files are processed.
This causes issues with the latest version of prettier that errors on symbolic links....

In the context of linting symlink files don't make any sense?

Would you accept a pull request to ignore symlink files?

Steps to reproduce

Add a new file with git add that is a symlink.

git status
A  index.js
git ls-files -s | grep index.js
120000 8577b9841658a7a00067d49e79e8292077b37193 0	index.js

Debug Logs

expand to view
COPY THE DEBUG LOGS HERE

Environment

  • OS: macOS High Sierra
  • Node.js: v18.16.1
  • lint-staged: 14.0.1
@iiroj
Copy link
Member

iiroj commented Aug 30, 2023

Hello, can this be achieved with the diff-filter option or what's the proposed solution?

https://github.com/okonet/lint-staged/blob/fc3bfeabae29b65f99b6911a989b0b41d3d1128e/lib/getDiffCommand.js#L6

@JamesKyburz
Copy link
Author

@iiroj diff-filter can't omit symlink files.

@JamesKyburz
Copy link
Author

eslint can break too when given symlink files

typescript-eslint/typescript-eslint#2987

Could we not add a config to ignore them?

@iiroj
Copy link
Member

iiroj commented Feb 5, 2024

I'm not sure if this is something lint-staged should solve, because the issue is in linter tool itself. 🤔 If we start linting on the real files, they might be outside of the repo, for example.

A flag like --ignore-symlinks could be possible, but it would have to access all files' stats and cause some performance issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants