How to set environment variable to lint-staged task
See original GitHub issueLet me say I have the following lint-staged
configuration.
"lint-staged": { "*.{css,scss}": [ "prettier --fix", "git add" ], "*.{js,vue}": [ "eslint --fix --ext js,vue", "jest --findRelatedTests", "git add" ] },
But, I would like to set extra environment variable for “jest” task.
I would like to set the task as NODE_ENV=production BABEL_ENV=node jest --findRelatedTests
.
Right now lint-staged will report error that NODE_ENV is not a command.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Linting Staged Git Files with lint-staged
To get started, check that your project already has ESLint, stylelint or Prettier configured (either via a .xxxrc configuration file or a key ......
Read more >node_modules/lint-staged · master · simmalik / xylem-website
lint -staged uses the debug module internally to log information about staged files, commands being executed, location of binaries, etc. Debug ...
Read more >javascript - lint-staged not running on precommit
But to make it less confusing for you: it simply queries git for changed files and saves result in $jsfiles variable. You can...
Read more >flightproject - node_modules - lint-staged - GitLab
Linting commands do not support the shell convention of expanding environment variables. To enable the convention yourself, use a tool like cross-env ....
Read more >mrm-task-lint-staged
For example, if you have lint script that runs ESLint for js and ts files, the task will add lint-staged rule that runs...
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
@oliverzy I see a documentation PR opportunity here.
Thanks, The Solution 2 is great. I think this issue can be closed.