You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execute commands in the shell lint-staged is run in when the --shell option is passed. Lint-staged uses execa, which also accepts a --shell option: "If true, runs file inside of a shell. Uses /bin/sh on UNIX and cmd.exe on Windows. A different shell can be specified as a string." ~ https://github.com/sindresorhus/execa#shell
Since lint-staged ferries the --shell option through to execa, it would be ideal for it to also accept a string specifying a custom shell. This would allow lint-staged configs requiring the --shell option to function consistently on Unix and Windows development environments. N.B. Windows ships with Bash these days. An alternative solution would be to run lint-staged commands in the shell from which lint-staged was executed when --shell is passed. That would be more intuitive from the perspective of the developer committing code but perhaps less intuitive from the perspective of the developer authoring the lint-staged config.
Steps to reproduce
Run lint-staged (e.g., by committing in a repository with lint-staged configured) from Bash on Windows.
The lint-staged commands are run in Command Prompt.
Environment
OS: Windows 10
Node.js: v16.14.0
lint-staged: v11.0.0
The text was updated successfully, but these errors were encountered:
Description
Execute commands in the shell lint-staged is run in when the
--shell
option is passed. Lint-staged usesexeca
, which also accepts a--shell
option: "If true, runs file inside of a shell. Uses/bin/sh
on UNIX andcmd.exe
on Windows. A different shell can be specified as a string." ~ https://github.com/sindresorhus/execa#shellSince lint-staged ferries the
--shell
option through toexeca
, it would be ideal for it to also accept a string specifying a custom shell. This would allow lint-staged configs requiring the--shell
option to function consistently on Unix and Windows development environments. N.B. Windows ships with Bash these days. An alternative solution would be to run lint-staged commands in the shell from which lint-staged was executed when--shell
is passed. That would be more intuitive from the perspective of the developer committing code but perhaps less intuitive from the perspective of the developer authoring the lint-staged config.Steps to reproduce
Environment
lint-staged
: v11.0.0The text was updated successfully, but these errors were encountered: