create-web3-dapp icon indicating copy to clipboard operation
create-web3-dapp copied to clipboard

Conflicts between ESLint and Prettier

Open butovsky opened this issue 3 years ago • 0 comments

Current plugins in ESLint have the no-mixed-spaces-and-tabs rule. If this rule isn't followed in the code, the error is thrown. image

However, even after fixing it manually, yarn prettier --write returns it to the previous state. Thus, we are never able to lint the code locally and to send it then to the repo without any possible ESlint errors.

Possible workaround:

~~Override the rule. (not recommended, because there can be another conflicts in the future)~~

~~Wait until #44 is resolved and the consistent coding style is accepted. (may take too long)~~

  1. Remove Prettier entirely (can be replaced with some consistent styling after #44, I've proposed Airbnb here);
  2. Create separate script like npm run lint:fix, which will invoke the ESlint with the argument --fix;
  3. Basic npm run lint will be used for the checks in pipelines - see #43.

I guess this issue can be a great and non-painful way to start the whole linting enhancement.

butovsky avatar Sep 15 '22 19:09 butovsky