question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The --fix option is not available for piped-in code.

See original GitHub issue

Trying 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chtenbcommented, Mar 15, 2017

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.

1reaction
ChrisHubingercommented, Mar 15, 2017

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 to stderr? This still feels a bit strange but would solves the issue for most of us (i guess)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found