What is your setup?
Which coding style guide do you use?
For further actions, you may consider blocking this person and/or reporting abuse
What is your setup?
Which coding style guide do you use?
For further actions, you may consider blocking this person and/or reporting abuse
Md Shahriar -
Angelina Jasper -
keploy -
Mads Stoumann -
Top comments (9)
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.
nickytonline / iamdeveloper.com
Source code for my web site iamdeveloper.com
iamdeveloper.com
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:
git clone git@github.com:nickytonline/www.iamdeveloper.com.git
orgit clone https://github.com/nickytonline/www.iamdeveloper.com.git
npm install
npm run develop
to get up and running with the Gatsby development server.npm run type-check:watch
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.
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.
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 😎🔥🔥
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.
Both!