The --fix option is not available for piped-in code.
See original GitHub issueTrying to format some piped-in code:
echo "var foo = { one: 'one' };" | eslint --stdin --fix
Results in:
The --fix option is not available for piped-in code.
It would be great to use all of my carefully crafted eslint rules as formatter rules for my editor.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Developers - The --fix option is not available for piped-in code. -
Intellij IDEA (2016.2) gives "The --fix option is not available for piped-in code." error to all jsx files after --fix option is put...
Read more >eslint/eslint - Gitter
@kishorevarma Unfortunately it won't work because of eslint error: The --fix option is not available for piped-in code. I think that someone needs...
Read more >ESLint v1.4.0 released - ESLint中文文档
When you run ESLint on the command line with the --fix flag, it will automatically fix any problems that it can (not all...
Read more >ESLint 0.18.0 released - ESLint - Pluggable JavaScript Linter
Following up on the removal of React semantics in 0.17.0, we discovered that there was some lingering pieces of code that were still...
Read more >eslint | Yarn - Package Manager
... identifying and reporting on patterns found in ECMAScript/JavaScript code. ... 1a327aa fix: Ensure flat config unignores work consistently like eslintrc ...
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
Another solution would be to suppress the unfixed problems with a flag (so that the user is aware of problems not being reported), or optionally write those to a given log file. When you want to prettify/fix the code in an editor, you are not interested in unfixed problems. You can use the normal linter mode for that.
I just implemented a linter for vim-autoformat bypassing the behaviour using a tmp file, which is imho an ugly solution (https://github.com/Chiel92/vim-autoformat/pull/178).
What about to output the fixed code to
stdout
and if errors the report tostderr
? This still feels a bit strange but would solves the issue for most of us (i guess)