apache / cordova-node-xcode

Apache cordova
Apache License 2.0
194 stars 98 forks source link

Introduce eslint task with semistandard & prettier #36

Open brodycj opened 5 years ago

brodycj commented 5 years ago

I am already working on this, wanted before we start the new major release (#20).

n1ru4l commented 5 years ago

Can we also add https://github.com/prettier/prettier + https://github.com/prettier/eslint-config-prettier

brodycj commented 5 years ago

I would definitely favor adding prettier, just updated the title to reflect this idea.

When using eslint we generally like to use eslint-config-semistandard, which is basically standard but with semicolons required. I think a major challenge is to avoid conflicts between semistandard rules and prettier rules.

I found eslint-config-prettier-standard which will hopefully solve this problem for us.

brodycj commented 5 years ago

I found [...]

I meant eslint-config-prettier-standard, which does use prettier & prettier / eslint-config-prettier as suggested above, just fixed my comment.

There was some interesting discussion in https://github.com/standard/standard/issues/811 & https://github.com/standard/standard/issues/996.

brodycj commented 5 years ago

I just raised WIP PR #39 to introduce eslint & prettier, using prettier-eslint-cli instead of eslint-config-prettier. The issue eslint-config-prettier is that it disables a number of eslint rules from standard in order to maintain compatibility with prettier.

I was able to use prettier-eslint-cli to resolve a number of eslint issues that had been lurking in the code for ages. I hope to get it ready for review and merge in the near future.