Moesif is the most advanced API analytics platform for platform teams. Over 2000 companies use Moesif API analytics for REST and GraphQL APIs to make smarter decisions and build for growth.
markdown guide
 

ESLint is definitely useful (Using Airbnbโ€™s configuration with a few modifications) but Prettier is excellent for code style. I love Prettier and use ESLint for non-style related issues like cyclic complexity, unused imports etc.

 

Eslint and Prettier. Eslint for non-formatting rules and Prettier for formatting.

You can check the setup in my blog if you're interested.

GitHub logo nickytonline / iamdeveloper.com

Source code for my web site iamdeveloper.com

iamdeveloper.com

Netlify Status

Hey there, I'm Nick and this is my site's source code. This site started off as a clone of the Netlify CMS Gatsby Starter (check it out!). Since then, I've tweaked it a lot and converted the codebase to TypeScript.

Feel free to peruse the code and/or fork it. ๐Ÿ˜‰

Thanks to all the wonderful projects that made it possible to build this blog.

To get up and running:

  • clone the repository by running git clone git@github.com:nickytonline/www.iamdeveloper.com.git or git clone https://github.com/nickytonline/www.iamdeveloper.com.git
  • run npm install
  • run npm run develop to get up and running with the Gatsby development server.
  • Since the project uses Babel and not TypeScript as the compiler, a separate process is required to run type checking. Open another terminal and run npm run type-check:watch
  • If you're curious about why the Netlify CMS adminโ€ฆ
 

I'd say that's a bit like comparing ๐ŸŽ to ๐ŸŠ since they both accomplish two different things.

๐Ÿ‘ฉโ€๐ŸŽจ Prettier is an opinionated formatter that parses the AST and reprints the entire thing, enforcing prettier's style rules, but it doesn't actually make changes to the AST. You'd use prettier to enforce code style across the entire project, it isn't going to catch errors.

๐Ÿ‘ฎโ€โ™‚๏ธ ESLint traverses the tree and can make changes to nodes and give you warnings. ESLint does have some format opinions but it doesn't reprint your entire tree as prettier does. You'd use ESLint to enforce code convention across your project.

 

It's gotta be both for me.
ESLint is a must have for catching common bugs and typos.
And a11y catches
But Prettier makes my overall coding faster ๐Ÿ˜Ž๐Ÿ”ฅ๐Ÿ”ฅ

 

Oh well I actually have a combination of both, ESLint is very useful for unused vars, imports and things like that but I am guilty of using it for formatting code a certain way where Prettier fails. For everything else code style related Prettier is the way to go, there are just certain things that rub me the wrong way but at the end of the day it doesn't matter that much.

 

These two aren't really up to comparison and the best answer is to use them together. ESLint is a linter - it will show possible errors in your code, provide with best practices and then show you code style problems, which you then solve with Prettier. The combination of two is life changing.

 

use both! prettier will take care of formatting while eslint will catch code quality bugs (e.g. unused variables) prettier.io/docs/en/comparison.html

 

I use both ESLint and prettier. But I love prettier because I'm very dumb in indentation and styling the code and prettier does it automatically for me.

 
Classic DEV Post from Dec 12 '18

Silly Repos

eeeeeeee!

moesif profile image
API Analytics for Platform Teams.

Thousands of organizations use Moesif to better understand their APIs (REST and GraphQL) and make smarter decisions.

Don't ghost on us โค๏ธ

Sign Up

DEV is home to the best community-driven resources on the web. All 100% free and publicly available.

Discover more by creating your account.