add option to use relative paths in commands
See original GitHub issuecurrently lint-staged
will pass absolute paths of every file matched file to the defined command in some cases resulting in unexpected results for commands, for example.
xo
expects its configuration under package.json
of the cwd in order to apply correct rules but when using xo /Users/foo/app/lib/path.js
rather than lib/path.js
it will ignore package.json
some of its configuration (i.e: the overrides option).
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (5 by maintainers)
Top Results From Across the Web
How to use relative paths on windows CMD? - Super User
Start a process using the file my_executable.exe found (with starting point in the current directory (relative path)) by going two directories ...
Read more >Is there a way to use Relative Path in "Command line ...
I am trying to figure out if it's possible to use a Relative Path in the "Command line arguments" start option setting in...
Read more >Using relative paths in Linux scripts - Tjelvar Olsson
This post will show you how create scripts that have a clear separation between raw and derived data using relative paths.
Read more >How Linux Relative Path Works with examples? - eduCBA
The Linux relative path the path is defined with the current working directory (for a present relative path, we can use the “pwd”...
Read more >File path formats on Windows systems | Microsoft Learn
As result, the first is an absolute path from the root directory of drive C: , whereas the second is a relative path...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for replying @okonet. I understand it may be something that can also be defined in xo (I actually did let them know) but thought it could be a helpful feature to have under lint-staged as well with a
--relative
flag or something so it could be more flexible.Would you feel that adding this feature could benefit other users or does it feels out of scope for you? Please let me know and I could try to send a PR if you believe it’s a good idea or would like to discuss further.
Thanks in advance
@jeznag and others: you may be interested in this PR: https://github.com/okonet/lint-staged/pull/534.