You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run prettier-eslint --write through husky & lint-staged. I wonder if there are any lint errors / or warnings that the --write cannot --fix (other than parser errors, maybe a question for eslint?), or rephrased: would there be any use of running eslint after prettier-eslint --write? I wrote more on this here.
While playing with it, I noticed that parse errors are prettier when running just eslint. So I also thought that maybe we could at least have an option for --no-stacktrace, as -l silent is neither silent nor gives enough info about where the error is at. Or maybe a -l concise?
Here is an example of a parse error I get from eslint - contains only the info needed to go fix the code, and a summary of total warnings / errors:
Here is the same error coming from prettier-eslint --write:
prettier-eslint [ERROR]: prettier formatting failed due to a prettier error
prettier-eslint-cli [ERROR]: There was an error formatting "/Users/om/Dev/mel/drmelgill.com/components/reveal.js":
SyntaxError: Unterminated string constant (3:19)
1 | import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
2 | import FirstChild from 'components/first-child'
> 3 | import styles from './reveal.js.scss;
| ^
4 |
5 | export default props => (
6 | <div className='reveal'>
at Parser.pp$5.raise (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:4333:13)
at Parser.readString (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:1296:33)
at Parser.getTokenFromCode (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:1102:21)
at Parser.readToken (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:771:19)
at Parser.<anonymous> (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:6626:20)
at Parser.readToken (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:5443:22)
at Parser.nextToken (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:761:19)
at Parser.next (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:686:10)
at Parser.eat (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:693:12)
at Parser.pp.eatContextual (/Users/om/Dev/mel/drmelgill.com/node_modules/prettier/node_modules/babylon/lib/index.js:1661:44)
failure formatting 1 file with prettier-eslint
Running prettier-eslint --write -l silent says:
failure formatting 1 file with prettier-eslint
An alternative request would be to maybe add a --no-error option (making the cli completely silent and with exit code 0), which would allow people to run eslint after prettier-eslint --write --no-error.
The text was updated successfully, but these errors were encountered:
Hey @orlin,
Thanks for your input. If you want to make a pull request, that'd be great. The challenge is that errors can come from any number of modules. prettier-eslint-cli, prettier-eslint, eslint, prettier, or any number of transitive dependencies as well. And previously we didn't show very much information and that led to a lot of people asking for help when more information in the error would have empowered them to fix their issues themselves.
But yeah, feel free to makeapullrequest.com if you feel like it could be improved.
I run
prettier-eslint --write
throughhusky
&lint-staged
. I wonder if there are any lint errors / or warnings that the--write
cannot--fix
(other than parser errors, maybe a question foreslint
?), or rephrased: would there be any use of runningeslint
afterprettier-eslint --write
? I wrote more on this here.While playing with it, I noticed that parse errors are prettier when running just
eslint
. So I also thought that maybe we could at least have an option for--no-stacktrace
, as-l silent
is neither silent nor gives enough info about where the error is at. Or maybe a-l concise
?Here is an example of a parse error I get from
eslint
- contains only the info needed to go fix the code, and a summary of total warnings / errors:Here is the same error coming from
prettier-eslint --write
:Running
prettier-eslint --write -l silent
says:An alternative request would be to maybe add a
--no-error
option (making the cli completely silent and with exit code 0), which would allow people to runeslint
afterprettier-eslint --write --no-error
.The text was updated successfully, but these errors were encountered: