muni-town / weird

Weird web pages
https://weird.one
Other
52 stars 11 forks source link

Add CI to lint the codebase #78

Closed azzamsa closed 4 months ago

azzamsa commented 5 months ago

Hi, there.

I've found some inconsistencies in the code. So, perhaps this PR will solve the issue.

This PR adds:

The mentioned tools are also included inside the justfile. So, one is able to check locally just using just fmt or just fmt-check.

The repo had prettier and eslint already, but it seems they were not used in previous commits. So, I have added both to CI and the just recipe too.

I use ci: as the commit prefix here. If these commits should belong under a different category, I'd be happy to change it.

One last step is fixing the error that comes from eslint:

Oops! Something went wrong! :(

ESLint: 8.57.0

Error: Error while loading rule '@typescript-eslint/no-floating-promises': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
azzamsa commented 5 months ago

I have read the CLA Document and I hereby sign the CLA

azzamsa commented 4 months ago

@zicklag if you agree with this PR, I will look for a fix for the ESLint issue. Do you have any suggestions on how to fix the issue?

zicklag commented 4 months ago

Yeah, I'm interested in this. I did a quick search and it looks like the issue we're running into is the same as this https://github.com/vuejs/eslint-config-typescript/issues/52.

I'm not exactly sure what the fix is, but we may have to either ignore that lint just for CI, or install typescript in CI before running the lint or something.

azzamsa commented 4 months ago

@zicklag , I believe this is ready to merge. There is a new typo in the latest commits.

I've temporarily disabled ESLint due to the many errors that need fixing. With the release of ESLint 9, we might want to try it to see if it improves our experience.