Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up JavaScript and Typescript linting and formatting tools #64

Open
Dripcoding opened this issue Mar 21, 2022 · 7 comments
Open

Set up JavaScript and Typescript linting and formatting tools #64

Dripcoding opened this issue Mar 21, 2022 · 7 comments

Comments

@Dripcoding
Copy link
Contributor

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
Copy link
Member

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
Copy link

kkreine commented Jul 25, 2022

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
Copy link
Member

@kkreine please go ahead with the task.

cc: @Dripcoding

@kkreine
Copy link

kkreine commented Jul 28, 2022

I'll be working on this this weekend.

@kkreine
Copy link

kkreine commented Aug 2, 2022

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.

@preetkaran20
Copy link
Member

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

thanks,
Karan

@preetkaran20
Copy link
Member

@kkreine are you still working on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants