Create-react-app: Use prettier instead of eslint

Created on 11 Oct 2017  路  5Comments  路  Source: facebook/create-react-app

Is this a bug report?

No

Prettier is more strict on formatting and provides more consistency within a codebase.

Most helpful comment

Create React App only uses ESLint for verifying correctness, not style. We won't stop using it for that because it finds real mistakes in the code.

We do recommend you to use Prettier for enforcing style. We agree it is valuable. In fact we have instructions for integrating it right in the User Guide: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#formatting-code-automatically

It might be possible that in the future we will bundle it by default. For now, I hope this answer clarifies our position.

All 5 comments

I recently tried both on my react project, and abandoned eslint for _formatting_ when i encountered some fatal crashes which erased some of my code i was working on. prettier is much faster and stable. I also opt'd to use jshint for linting.. https://www.npmjs.com/package/jshint

Create React App only uses ESLint for verifying correctness, not style. We won't stop using it for that because it finds real mistakes in the code.

We do recommend you to use Prettier for enforcing style. We agree it is valuable. In fact we have instructions for integrating it right in the User Guide: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#formatting-code-automatically

It might be possible that in the future we will bundle it by default. For now, I hope this answer clarifies our position.

@gaearon Sorry, I mis-typed. I meant eslint for formatting. Yes i use it as well for checking code. It does that most excellent.

Create React App doesn't use ESLint for formatting for this exact reason. If you see formatting rules in our config please file an issue and we will remove them.

@gaearon will do, ill keep an eye open. Ty for the info :) much appreciated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jnachtigall picture jnachtigall  路  3Comments

alleroux picture alleroux  路  3Comments

fson picture fson  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

alleroux picture alleroux  路  3Comments