There are two issues triggered by moving just before filing bankruptcy.
First, whether can you file here. Second, what exemptions must you use to protect your property from being sold by the bankruptcy trustee.
Bankruptcy is filed in federal courts, not state courts. Federal courts are divided into districts. I practice in the Western District of Washington, which is the State of Washington west of the Cascade Mountains.
To file in the Western District of Washington Federal Bankruptcy Court, you must have lived in this district for the past 91 days (that is to say, more than half of the preceding 180 days). Alternatively, even if you do not pass this residency test, you can still file here if this is the district where your principal assets are located at the time of filing. Your principal assets are things like your house or, if no house, the bulk of your personal belongings–car, household goods and furnishings, and clothing.
Exemptions are very important because they protect your property from being sold. This topic is covered in greater detail elsewhere in this website. The main point is that can choose between state exemptions or federal exemptions. Washington State is one of the few states that offers this flexible option. The state exemptions provide more protection for a house that has a lot of equity. The federal exemptions provide more protection for most personal property.
You must have resided in Washington State for the past two years to use Washington State exemptions. If you do not meet that residency test, then you must use the state’s exemptions where you resided for the most time during the 180 day period preceding the two-year residence test, i.e, where were you residing for the bulk of the 180 day period immediately preceding two years before filing.
However, if you want to use the federal exemptions instead of state exemptions, then you must have been residing in Washington State for merely 91 days prior to filing.