Comments (2)
I discovered one of my mono-repo projects had a .lintstagedrc.js
file inside with no content.
Offending block that doesn't catch the error is searchConfigs:98, I will raise a PR for this one shortly.
Side note: is there a central place where unexpected errors are logged in lint-staged? It seems odd that an error improperly caught could cause the program to exit without logging anything at all, even just the error message and/or stack trace.
from lint-staged.
I cannot actually reproduce this error in the lint-staged repo itself. Adding an empty file test/.lintstagedrc.js
works as expected:
lint-staged:searchConfigs Found possible config files: [
'/Users/iiro/git/lint-staged/test/unit/__mocks__/my-lint-staged-config/package.json',
'/Users/iiro/git/lint-staged/test/.lintstagedrc.js',
'/Users/iiro/git/lint-staged/.lintstagedrc.json',
'/Users/iiro/git/lint-staged/package.json'
] +6ms
lint-staged:loadConfig Loading configuration from `/Users/iiro/git/lint-staged/test/unit/__mocks__/my-lint-staged-config/package.json`... +0ms
lint-staged:loadConfig Loading configuration from `/Users/iiro/git/lint-staged/test/.lintstagedrc.js`... +1ms
lint-staged:loadConfig Loading configuration from `/Users/iiro/git/lint-staged/.lintstagedrc.json`... +0ms
lint-staged:loadConfig Loading configuration from `/Users/iiro/git/lint-staged/package.json`... +0ms
lint-staged:loadConfig Successfully loaded config from `/Users/iiro/git/lint-staged/test/unit/__mocks__/my-lint-staged-config/package.json`:
lint-staged:loadConfig null +0ms
lint-staged:loadConfig Successfully loaded config from `/Users/iiro/git/lint-staged/.lintstagedrc.json`:
lint-staged:loadConfig { '*.js': 'eslint --fix', '*.{json,md}': 'prettier --write' } +0ms
lint-staged:validateConfig Validating config from `/Users/iiro/git/lint-staged/.lintstagedrc.json`... +0ms
lint-staged:validateConfig Validated config from `/Users/iiro/git/lint-staged/.lintstagedrc.json`: +0ms
lint-staged:validateConfig {
lint-staged:validateConfig '*.js': 'eslint --fix',
lint-staged:validateConfig '*.{json,md}': 'prettier --write'
lint-staged:validateConfig } +0ms
lint-staged:loadConfig Successfully loaded config from `/Users/iiro/git/lint-staged/package.json`:
lint-staged:loadConfig null +0ms
lint-staged:loadConfig Successfully loaded config from `/Users/iiro/git/lint-staged/test/.lintstagedrc.js`:
lint-staged:loadConfig null +1ms
lint-staged:searchConfigs Found 1 config files +2ms
So the file /Users/iiro/git/lint-staged/test/.lintstagedrc.js
is treated as a possible config file, but its content gets resolved to null
instead of lint-staged failing silently.
from lint-staged.
Related Issues (20)
- Add flag to simplify testing `lint-staged` integration HOT 2
- 'lint-staged' will not restore changes if there's an error or the script is halted HOT 4
- Monorepo and different `.lintstagedrc.json` configuration files HOT 2
- WSL incorrect resolveGitRepo: Current directory is not a git directory HOT 5
- Issue: Targeted files skip tsconfig HOT 1
- Failing to get staged files on 15.2.6 HOT 11
- Version 12+ results in exit code 1 instead of working HOT 2
- Fail to find git dir with git "rev-parse" HOT 1
- The 'File Ignored' warning is still a big problem HOT 1
- 'Integrate with Next.js' not working properly without '--dir' in monorepo.
- The docs suggests having empty config, but it doesn't work HOT 3
- Failed to get staged files HOT 18
- Execute vue-tsc --noEmit through lint-staged to detect that the scope includes the node_modules file HOT 6
- tsc bug when running through lint-staged HOT 2
- 15.2.9: eslint failure Could not find plugin "import" when running via lint-staged HOT 2
- lint-staged dependency: micromatch vulnerability HOT 5
- Unstaged local changes get committed with `--no-stash` flag from version `15.2.0` HOT 5
- lint-staged depends on vulnerable version of micromatch HOT 1
- eslint --fix doesn't fix on lintstaged but fix when run directly HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lint-staged.