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 fixes #2558

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

inferrinizzard
Copy link
Contributor

@inferrinizzard inferrinizzard commented Apr 13, 2024

Description

Fixes all outstanding ESLint issues as reported in #2555

Motivation and Context

Once #2555 is merged, the latest commit on the master branch will be in an unstable state. This PR aims to immediately resolve that by fixing all existing errors including:

  • Standardising JSON formats
  • Enforcing consistent import syntax
  • Enforcing consistent naming schemes
  • Replacing or intentionally commenting all uses of the any type
  • Adding explicit values for enums (prefer strings)
  • Add access modifiers on all class methods
  • Adding return types on all functions
  • Converting undefined or null or operators to nullish coalescing
  • Remove all null assertions in favour of optional chaining
  • Final formatting indentation pass

This PR also tags several sections of the codebase that are in need of a refactor, these are the major candidates:

  1. CJSON
    a. This file is far too heavily nested and dense to easily grok
  2. Circular imports
    a. There are ~5 major circular import cycles that need to be resolved
  3. Strongly typed RendererOptions
    a. strongly typing RendererOptions (as well as a few other places) could help to alleviate some areas where types are currently unknown/unclear
    b. would additionally help users of quicktype-core as we could provide intellisense while writing options

Previous Behaviour / Output

N/a

New Behaviour / Output

N/a

How Has This Been Tested?

npm run lint now only comes back with warnings, no errors
image

Screenshots (if appropriate):

@inferrinizzard inferrinizzard changed the title wip: chore: ESLint fixes chore: ESLint fixes Apr 14, 2024
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.

None yet

1 participant