Gabb-c / pokenode-ts

A lightweight Node.js wrapper for the PokéAPI with built-in types.
https://pokenode-ts.vercel.app/
MIT License
244 stars 28 forks source link

Type fixes #478

Closed ScotteRoberts closed 2 years ago

ScotteRoberts commented 2 years ago

Pull Request Template

Checks and guidelines

Type of change

Describe the changes

Spelling error:

Argument of type '{ abilities: { ability: { name: string; url: string; }; is_hidden: boolean; slot: number; }[]; base_experience: number; forms: { name: string; url: string; }[]; game_indices: { game_index: number; version: { name: string; url: string; }; }[]; ... 13 more ...; weight: number; }' is not assignable to parameter of type 'Pokemon | (() => Pokemon)'.
  Type '{ abilities: { ability: { name: string; url: string; }; is_hidden: boolean; slot: number; }[]; base_experience: number; forms: { name: string; url: string; }[]; game_indices: { game_index: number; version: { name: string; url: string; }; }[]; ... 13 more ...; weight: number; }' is not assignable to type 'Pokemon'.
    The types of 'sprites.versions["generation-iv"]' are incompatible between these types.
      Property '"diamond-perl"' is missing in type '{ "diamond-pearl": { back_default: string; back_female: null; back_shiny: string; back_shiny_female: null; front_default: string; front_female: null; front_shiny: string; front_shiny_female: null; }; "heartgold-soulsilver": { ...; }; platinum: { ...; }; }' but required in type 'GenerationIVSprites'.ts(2345)
index.d.ts(1485, 2): '"diamond-perl"' is declared here.

Effort Fix:

Argument of type '{ abilities: { ability: { name: string; url: string; }; is_hidden: boolean; slot: number; }[]; base_experience: number; forms: { name: string; url: string; }[]; game_indices: { game_index: number; version: { name: string; url: string; }; }[]; ... 13 more ...; weight: number; }' is not assignable to parameter of type 'Pokemon | (() => Pokemon)'.
  Type '{ abilities: { ability: { name: string; url: string; }; is_hidden: boolean; slot: number; }[]; base_experience: number; forms: { name: string; url: string; }[]; game_indices: { game_index: number; version: { name: string; url: string; }; }[]; ... 13 more ...; weight: number; }' is not assignable to type 'Pokemon'.
    Types of property 'stats' are incompatible.
      Type '{ base_stat: number; effort: number; stat: { name: string; url: string; }; }[]' is not assignable to type 'PokemonStat[]'.
        Type '{ base_stat: number; effort: number; stat: { name: string; url: string; }; }' is not assignable to type 'PokemonStat'.
          Types of property 'effort' are incompatible.
            Type 'number' is not assignable to type '0 | 1 | 2 | 3'.ts(2345)
sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Gabb-c commented 2 years ago

Hey @ScotteRoberts, thanks for your contribution to Pokenode-ts! Your fix will be merged and released soon.