In January, the Pennsylvania Supreme Court ordered the legislature to redraw the state’s congressional districts, invalidating the current map as an impermissible gerrymander under the state constitution. The Republican Party has responded swiftly and aggressively. GOP legislators filed a flagrantly partisan appeal with the U.S. Supreme Court that assailed the ruling as lawless “judicial activism.” (Justice Samuel Alito rejected it without comment.) State Senate president pro tempore Joseph Scarnati refused to comply with an order from the state supreme court. Republican leaders moved to vacate the decision because one justice in the majority had criticized gerrymandering during a campaign. And on Monday, GOP Rep. Cris Dush called for the impeachment of all five Democratic justices who voted to strike down the gerrymander.

These antics should surprise no one. In recent years, many Republicans—especially swing-state legislators—have countered judicial efforts to protect voting rights by assailing the legitimacy of the courts themselves. They’ve also manipulated the machinery of government to disenfranchise disfavored communities, then tried to insulate their machinations from judicial scrutiny. The Pennsylvania GOP’s crusade against the courts is not an outlier. It is a distressingly familiar example of the tactics vulnerable Republicans use to entrench their own power.

Consider the GOP’s chicanery in North Carolina. After the U.S. Supreme Court hobbled the Voting Rights Act, North Carolina Republicans requested a breakdown of voter data on the basis of race. It then passed a sweeping law imposing new burdens on the right to vote, including a stringent voter ID requirement that eliminated the forms of identification most commonly used by black voters. In July 2016, a three-judge panel of the 4th U.S. Circuit Court of Appeals struck down the act, ruling that it appeared to “target African Americans with almost surgical precision.” Republican then-Gov. Pat McCrory promptly charged “three Democratic judges” with “undermining the integrity of our elections while also maligning our state.” (All three judges were appointed by Democratic presidents.) Senate leader Phil Berger and House Speaker Tim Moore, both Republicans, went further, issuing an enraged statement indicating their intention to appeal the decision to the U.S. Supreme Court:

Since today’s decision by three partisan Democrats ignores legal precedent, ignores the fact that other federal courts have used North Carolina’s law as a model, and ignores the fact that a majority of other states have similar protections in place, we can only wonder if the intent is to reopen the door for voter fraud, potentially allowing fellow Democrat politicians like Hillary Clinton and Roy Cooper to steal the election.

The Supreme Court rejected their appeal with no noted dissents.

But that was just the start of North Carolina Republicans’ campaign against any court that defied their agenda. In November 2016, Democrat Roy Cooper won the governor’s race, which should have entitled him to take control of the state elections board and expand voting rights. But the GOP changed the law to prevent him from appointing a majority of Democrats to the board. Lower courts soon blocked the measure, along with several other laws stripping power from Cooper, as an infringement on the state’s constitution.

Moore and Berger tore into these judges, declaring that “they should hang up their robes and run for a legislative seat.” They also backed one measure that would gerrymander judicial districts to elect more Republican judges, and another that would eliminate judicial primaries and turn judicial races into confusing free-for-alls. When U.S. District Judge Catherine Eagles blocked the latter law, Republicans responded by castigating Eagles as a biased Obama appointee. Then, when a Democratic majority on the state supreme court struck down a retooled election board bill, Berger declared that “the Democrats on the Supreme Court delivered a partisan decision for their Democratic governor.”

Elsewhere in the country, anxious Republicans have played similar games. The New Hampshire GOP has seized upon Donald Trump’s claims of voter fraud in the state to suppress the franchise. Republicans have already passed one bill that tightens the documentation requirements for new voters, and allows law enforcement to interrogate voters at their homes if they fail to provide the necessary paperwork. When a state judge blocked part of the act, the state GOP scorned Democrats for “cherry picking a liberal judge.” Republicans are now poised to pass another bill that would force all new voters to pay hundreds of dollars to obtain a New Hampshire driver’s license and register their car with the state. The bill is aimed squarely at college students, whom the state GOP blames for swinging elections toward Democrats.

Virginia Republicans have also borrowed ideas from North Carolina. Under current law, the Virginia elections board is composed of three members, with two from the governor’s party, and overseen by a commissioner chosen by the governor. Over the last four years, under Democratic control, the board helped streamline the process of registration and voting. Now Republicans want to overhaul the board to abolish its Democratic edge. In January, a subcommittee voted along party lines to expand the board to six members—three Republicans and three Democrats—with a commission chosen by those members instead of Gov. Ralph Northam, a Democrat. The result would be a perpetually deadlocked body incapable of acting to protect Virginians’ access to the ballot.

It’s easy to see why Republicans feel empowered to attack courts and interfere with elections. President Donald Trump has a history of condemning judges who rule against him on the basis of their ethnicity or decisions. He is egged on by conservative commentators who call for the impeachment of judges who rule against him and peddle the myth of a “judicial resistance.” He has insisted voter fraud is rampant in swing states, including New Hampshire and Virginia, and put together a failed commission designed to justify a federal voter suppression law. In many respects, the GOP is rotting from the head down.

Thus far, the Pennsylvania GOP’s tantrum has amounted to little more than impotent whining. We should still take it seriously. Republicans’ long-term goal is to delegitimize any institution that limits their power. By calling for the impeachment of the judges who ruled against Pennsylvania’s political gerrymander, Rep. Dush is simply making this project explicit. His impeachment push will almost certainly fail, but his zeal to kneecap the court may inspire a new round of legislative attacks on its independence. Dush is testing the limits of the GOP rebellion against the rule of law. We ignore his stunt at our own peril.