Giveth-dapp: Add Prettier and Prettier ESLint

Created on 6 Dec 2017  路  4Comments  路  Source: Giveth/giveth-dapp

User Story

User story 1: As a developer, I don't want to have to worry about formatting styles. I want code to autoformat whenever I save. I want to completely remove any thinking of formatting from my workflow.

User story 2: As a reviewer, I want to ensure that code is formatted correctly and I don't have to review formatting errors and comment on them.

Type: Developer Tool

Summary: Integrate Prettier and Prettier ESLint into the project.

There are multiple editor integrations such as VSCode, Sublime, Atom, Vim and more.
In addition with Prettier ESLint we can get the power of ESLint --fix to automatically fix Prettier errors automatically even when not using any plugins.

Links:
https://github.com/prettier/prettier/
https://prettier.io/
https://prettier.io/docs/en/eslint.html

Expected behavior

While coding I have a formatting style guide that I am forced to follow and if I don't I get linting errors which could potentially break builds.

Actual behavior

Currently developers have to think about maintaining the current style of formatting and coding and thinking hard about this wastes time to think of other more important problems.

Solution

Summary:

I will add Prettier and Prettier ESLint integration and write up a Formatting.md file to explain how to use this in a few editors of choice.

Additional Information

This is open to suggestions/feedback.

Most helpful comment

Assigned to you, good luck! :-)

All 4 comments

Hi, thanks for the great overview. Love it.
We do have a linter implemented (follows airbnb standards) but it doesn't auto-format at least not in my editor. So this sounds like a good plan, what do you think @vojtechsimetka ?

Wow this is perfect description! Definitely down to try! I personally don't suffers with auto-formating issues as it works well in Atom but I know @satyavh has issues and I would definitely like to have eslint check on any PR.

Sounds great. Can this be assigned to me? I don't know if I can assign it to myself

Assigned to you, good luck! :-)

Was this page helpful?
0 / 5 - 0 ratings