I'm assuming you don't mean just avoiding major story spoilers here, but not spoiling anything about the region, mechanics, Pokemon if it's a new generation, etc.?...
I tried it deliberately with Black 2, but that happened to be right around the time my interest in Pokemon fell into a slump, and I ended up not playing past Nimbasa until years later by which time I had long given up. Honestly, I didn't much like the experience for the short time I did it - looking at Pokemon, locations, story elements, etc. outside of the game sorta helps cement them in my brain, y'know? Everything felt so ephemeral, only seeing it for the short time it appeared in front of me on my DS.
Then when I played Moon, I was just coming out of my Pokemon slump, and hadn't been keeping up with the info, so I sorta did it unintentionally. I enjoyed it better then than with Black 2, I guess my feelings shifted as I got older? I'd say there were good and bad points to doing it - example of the good: seeing Type: Null for the first time and feeling like I was in a creepypasta is one of most cherished poke-memories. Example of the bad: okay, I happened to have only 5 Pokemon on my team when it came time to catch the cover legendary (not knowing why I'd really really want to use it), but if that incredible coincidence hadn't happened, I would've been so upset! Also, there were some Pokemon like Mimikyu and Oricorio that I didn't love as much as I do today just from seeing them in the game without knowing the concepts and lore behind them.
In any case, apparently I didn't feel it was worth repeating for Ultra Moon, because I followed everything with that up to and including story spoilers. I enjoyed the experience, and it was probably a good idea, seeing as most of the game is the psyducking same and I might've lost motivation to continue without having the climax to look forward to, but I do sorta wish I got to be surprised by Ultra Necrozma.
Sword and Shield, I followed all the information (which was permanently traumatizing, but not for spoiler-related reasons); I tried to avoid story spoilers, but at some point I just gave up and started looking at them. I'm not sure how I feel about that, since, well...I hate the story (or at least the climax), and now I'm having trouble motivating myself to play through that part and beat the game. If I'd gone in unspoiled, I would've at least gotten to play the climax with complete optimism once, but I also feel like it would've been worse to have it just dropped on me with no preparation...