You do not want to burn any bridges no matter how tempting it may be as you never know when you may need a reference or recommendation from previous employers. The company you are leaving needs to find a replacement and that can take some time so turning your work over to someone else and explaining all the “ins” and “outs” could be a two week process.
Many employees over the years have asked me this question and I firmly stick to the two week rule as I feel it is the most professional.
Hope everyone has a fantastic weekend!!