VulnerableApp-facade icon indicating copy to clipboard operation
VulnerableApp-facade copied to clipboard

Set up JavaScript and Typescript linting and formatting tools

Open Dripcoding opened this issue 2 years ago • 7 comments

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.

Dripcoding avatar Mar 21 '22 01:03 Dripcoding

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

preetkaran20 avatar Mar 21 '22 02:03 preetkaran20

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.

kkreine avatar Jul 25 '22 01:07 kkreine

@kkreine please go ahead with the task.

cc: @Dripcoding

preetkaran20 avatar Jul 25 '22 03:07 preetkaran20

I'll be working on this this weekend.

kkreine avatar Jul 28 '22 21:07 kkreine

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:

  • Don't use {} as a type. {} actually means "any non-nullish value" (@typescript-eslint/ban-types)
  • Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)
  • Missing "key" prop for element in iterator (react/jsx-key)
  • and some unused vars (@typescript-eslint/no-unused-vars)

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.

kkreine avatar Aug 02 '22 03:08 kkreine

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

thanks, Karan

preetkaran20 avatar Aug 02 '22 05:08 preetkaran20

@kkreine are you still working on this ?

preetkaran20 avatar Sep 30 '22 16:09 preetkaran20