I used to know how to do this, but forgot (been a long time since I've used Lineage).
Don't know if "factory reset" is even the correct term here, but I'd like to wipe everything on the phone, files, apps that don't come bundled with the OS, everything except Lineage itself. I think you have to go into TWRP (???), and then . . . ? Anyway, would be much obliged for any help with this.
Hi there, what version is your LineageOS? since you mention TWRP which hasn't been recommended for some years..
Anyway from what you wrote you want to keep the current system installed. On my LOS 22.1 (but it's worked like this for ages, even on stock roms): you go to Settings -> System -> Reset Options -> "Erase all data (factory reset)"