Pathoschild / SMAPI

The modding API for Stardew Valley.
https://smapi.io/
GNU Lesser General Public License v3.0
1.71k stars 258 forks source link

Add analyzers to detect incorrect usage of Content Managers for vanilla assets #922

Open SinZ163 opened 8 months ago

SinZ163 commented 8 months ago

This Analyzer addition contains two new analyzers:

  1. AvoidContentManagerBadType
    • This will trigger when DataLoader can load the given Data asset, and the type is wrong. This is an error and will cause exceptions at runtime anyway
      1. PreferContentManagerDataLoader
    • This will trigger when DataLoader can load the given Data asset, regardless of type. This is Informative as its best practice, but the code will work anyway.