SasanLabs / VulnerableApp-facade

VulnerableApp-facade is probably most modern lightweight distributed farm of Vulnerable Applications built for handling wide range of vulnerabilities across tech stacks.
Apache License 2.0
47 stars 50 forks source link

Set up JavaScript and Typescript linting and formatting tools #64

Open Dripcoding opened 2 years ago

Dripcoding commented 2 years ago

Is your feature request related to a problem? Please describe. I would like to automate linting and formatting when contributing code. This will make collaboration easier and helps ensure code-quality.

Describe the solution you'd like I would like ESLint, TSLint, Husky, Prettier to be configured for the project locally and as part of the ci/cd pipeline.

Describe alternatives you've considered I've also considered looking in to using code quality tools available on the Github Actions marketplace.

Additional context NA

Would you like to help fix this issue? Yes, I'd like to work on this feature.

preetkaran20 commented 2 years ago

We already have prettier configured https://github.com/SasanLabs/VulnerableApp-facade/blob/main/facade-app/package.json#L27

If you still think we can make it better or integrate with npm build please go ahead

kkreine commented 2 years ago

Hi @preetkaran20, I'd be happy to work on this. I think there is value in having both ESLint and Prettier, but let me know what you think best suits the need of the project. Given that their rules can conflict with each other, I'll spend some time reviewing their configs and defaults to minimize that. I would be happy to set up a husky hook to run ESLint and/or Prettier on commit too, so that devs don't have to run the extra prettier command before committing.

preetkaran20 commented 2 years ago

@kkreine please go ahead with the task.

cc: @Dripcoding

kkreine commented 2 years ago

I'll be working on this this weekend.

kkreine commented 2 years ago

Hi @preetkaran20, @Dripcoding, sorry for being a little late on this, but I have Husky and ESLint configured and working with Prettier. However, there are a few default ESLint rules the code is breaking, including:

I can send over more detail & files affected if you'd like.

Would you like me to address these issues? I'd be happy to, and many are pretty straightforward, but I wanted to check before I go beyond the initial scope of this issue. I could also disable those rules globally or locally.

preetkaran20 commented 2 years ago

@kkreine thanks for pointing those issues, please go ahead with fixing those.

thanks, Karan

preetkaran20 commented 2 years ago

@kkreine are you still working on this ?