parse-community / parse-dashboard

A dashboard for managing Parse Server
https://parseplatform.org
Other
3.74k stars 1.38k forks source link

Add linting to repository #2467

Closed mtrezza closed 1 year ago

mtrezza commented 1 year ago

New Feature / Enhancement Checklist

Current Limitation

The code is not (properly) linted, causing varying code styles.

Feature / Enhancement Description

Enforce proper lint rules.

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

patelmilanun commented 1 year ago

I think for code style we should use something like prettier or any such code formatter. Doing formatting with linter is very bad idea mostly because of performance. I do have a video suggestion to not use linter as formatter. If u want I can post it here.

mtrezza commented 1 year ago

We use both prettier and eslint as the default across repos in this org.

patelmilanun commented 1 year ago

Basically we setup a prettier formatting step in our CI so when somebody is pushing code that is not formatted correctly our CI will yell at him.

patelmilanun commented 1 year ago

I don't see prettier anywhere in the dashboard repo.

mtrezza commented 1 year ago

You could look at the parse server repo for how we use eslint and prettier:

patelmilanun commented 1 year ago

ok but we dont have a dedicated step for checking formatting right ? or linter is doing that?

mtrezza commented 1 year ago

Yes, it's in the CI, see the 2nd point

mtrezza commented 1 year ago

Dashboard already has a lint check in the CI, see https://github.com/parse-community/parse-dashboard/actions/runs/5315803113/jobs/9624609903?pr=2463

But it seems the rules are different, because it doesn't seem to enforce leading spacing and code structure for example: https://github.com/parse-community/parse-dashboard/pull/2466#discussion_r1234376813

I would compare the lint rules with those of parse sever, which are the best maintained of all repos I assume.