Updating to lint-staged v9 issue -- using .eslintignore throws warnings!
See original GitHub issueRecently we’ve updated to use the latest version of eslint from v6. It appears that lint-staged no longer allows an advanced config. Instead of configuring lint-staged directly, you recommend using .prettierignore (or in our case .eslintignore) to ignore files.
Unfortunately this doesn’t work very well because with .eslintignore we get a warning in the console. Here’s what it looks like in my terminal:
git commit -am "test"
husky > pre-commit (node v10.16.3)
🔍 Finding changed files since git revision 200ebaddb.
🎯 Found 0 changed files.
✅ Everything is awesome!
↓ Stashing changes... [skipped]
→ No partially staged files found...
❯ Running tasks...
❯ Running tasks for client/**/*.js|server/src/**/*.js|e2e-tests/cypress/**/*.js
✖ eslint --rule 'react/jsx-curly-brace-presence: 1' --fix --max-warnings=0
node addCopyright.js
git add
✖ eslint --rule 'react/jsx-curly-brace-presence: 1' --fix --max-warnings=0 found some errors. Please fix them and try committing again.
/Users/tnrich/Sites/hde/server/src/data-lib/entities/aaSequence/countAASequence.js
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
✖ 1 problem (0 errors, 1 warning)
The crucial part is that warning File ignored because of a matching ignore pattern.
. Lint staged now passes all the files eslint which is causing the ignore warning.
Not quite sure what to do here. Any suggestions @okonet ?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (7 by maintainers)
Top Results From Across the Web
lint-staged - npm
lint -staged GitHub Actions npm version Codecov. Run linters against staged git files and don't let slip into your code base!
Read more >lint-staged - NPM Package Overview - Socket.dev
Linter commands work on a subset of all staged files, defined by a glob pattern. lint-staged uses micromatch for matching files with the ......
Read more >Husky/lint-staged is it possible to exclude/ignore file?
While configuring lint-staged in package.json or If you're using any other IDE, in order to ignore/exclude files by lint-Staged and husky ...
Read more >How to Automate Code Linting in Next.js with ESLint & Husky ...
Linting is the practice of checking code through automated static analysis for syntax errors and optionally code style issues.
Read more >Error: Failed to load config "@vue/prettier" to extend - You.com
After installing react-native with npx it throws an error on me with eslint settings in webstorm.
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
I don’t see the problem here. It works as expected so I’m not sure what’s this is about. We don’t change the behavior at any time.
Thanks for the help @okonet not your fault. I think that eslint needs to add an option to not throw a warning if a file is ignored by .eslintignore but is specifically passed to eslint like
eslint myIgnoreFile.js
.In the meantime I find that this is a decent workaround: