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

Chore/eslint-setup-improvement #541

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ericbolikowski
Copy link
Contributor

What Github issue does this PR relate to? Insert link.

What should the reviewer know?

This PR is an outcome of Anil and Eric talking on 7th of March about figuring out and improving our linting setup and tooling.

@ericbolikowski
Copy link
Contributor Author

So far in this PR:

  • make existing package.json linter task run on entire workspace (for some reason existing setup just checks redi-connect app)
  • make workspace VsCode settings more explicit/opinionated about using Prettier

@ericbolikowski
Copy link
Contributor Author

@helloanil, outputs from related research, same as I sent you in Slack.

Research outputs:

  • Created a PR. TL;DR: package.json linter task to check entire repo + started setting more workspace-level VsCode settings for Prettier (including format-on-save/paste)
  • Our base eslint setup comes from Nx. TL;DR: our repo’s eslint setup has several eslint* dependencies. It also integrates with the Typescript type-checker via two @typescript-eslint packages. More info on Nx’s site.
  • With the VsCode Eslint extension installed, the VsCode Problems tab will display all issues in currently open files only. Apparently there’s no way to make VsCode continuously scan all files displaying all issues (and various Github issue discussions agree it’s a bad idea anyways — too CPU intensive). So running yarn lint is next-best thing.
  • Important to understand: Eslint defines formatting rules, Prettier does the formatting. This is officially recommended (by prettier). The dependency eslint-config-prettier makes eslint and prettier talk together.

To-dos:

  • README: give instructions to install Eslint extension and Prettier extension before coding
  • Can we set up a Github Action or something similar to check that committed code obeys our prescribed Eslint/Prettier setup (in case someone disregards above-mentioned README instruction)? Perhaps a classic husky pre-commit hook?
  • Verify: are any of our eslint/typescript/prettier pacakge.json dependencies superfluous?
  • Semgrep has a VsCode extension, so you can see analysis offline
  • Continue playing around with Semgrep (I didn’t yet; I focussed on eslint/prettier instead)
  • While we’re at it, we can consider upgrading all packages within current ranges (yarn upgrade-interactive) or going all the way to latest (yarn upgrade-interactive --latest). Latest may in particular be interesting with regards to Nx given the recent less-config-more-opinionated upgrades I mentioned to you.

@gitguardian
Copy link

gitguardian bot commented Apr 27, 2023

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
753993 Generic High Entropy Secret b3e7f20 nx.json View secret
753993 Generic High Entropy Secret ad5445b nx.json View secret
753993 Generic High Entropy Secret 863d333 nx.json View secret
753993 Generic High Entropy Secret e7ef109 nx.json View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

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

Successfully merging this pull request may close these issues.

1 participant