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.

[website] Replace ESLint with Prettier

See original GitHub issue

Do you want to request a feature or report a bug? Feature (Build tools)

What is the current behavior? ESLint rules are so annoying and slow down the development.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test. N/A

What is the expected behavior? Prettier is the standard currently and so many popular projects use it and makes you write the code without being worried about one less semicolon or on which line close which tag 😦

Please provide your exact Babel configuration and mention your Linaria, Node, Yarn/npm version and operating system. Not related.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
satya164commented, Dec 18, 2017

Prettier will format the code, but it can’t catch the mistakes in the code that a linter can. For example, trying to use a variable which is not defined and many more other rules that ESLint has. That’s why it’s important to use both ESLint and prettier together.

In our ESLint config we have only enabled rules which can catch potential errors and disabled all code style related rules which are handled by prettier. But since our config is based on Airbnb’s config, some rules could be annoying as the Airbnb config is unnecessary restrictive. If you are annoyed by a specific rule, please mention it and we can discuss disabling it in the config.

1reaction
satya164commented, Dec 18, 2017

That’s exactly what he mentioned with eslint --fix

It’s different:

  • prettier-eslint - format code with prettier, then override some style rules with eslint (for example array-bracket-spacing), like running prettier, then eslint --fix.
  • eslint with eslint-plugin-prettier - disable all of the style related rules from eslint and always use the prettier for formatting, equivalent to running eslint --fix then prettier
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to replace Prettier by ESLint rules ? | by Florian Briand
In this article, I'll list and explain how to quickly replace Prettier rules by equivalent ESLint rules, to then allow you to really...
Read more >
How to use Prettier with ESLint - Robin Wieruch
This tutorial is part 3 of 3 in this series. ... The default setup for my JavaScript projects: Prettier + ESLint. Whereas Prettier...
Read more >
Integrating with Linters - Prettier
First, we have plugins that let you run Prettier as if it was a linter rule: eslint-plugin-prettier · stylelint-prettier. These plugins were especially...
Read more >
Using Prettier and ESLint to automate formatting and fixing ...
Learn how to use ESLint and Prettier together to automatically format and fix JavaScript code in your projects.
Read more >
Replace `'react'` with `"react"` eslint(prettier/prettier)
You can try something like this, it works for me. package.json "devDependencies": { "eslint-plugin-prettier": "^3.1.1", "prettier": ...
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