Imagine this: In the days after a new president’s central domestic policy initiative becomes law, a number of state attorneys general and public interest groups — committed ideological opponents of the president — march into the courts seeking its invalidation. By cherry-picking friendly district judges in parts of the country hostile to the president’s politics and values, in judicial circuits with longstanding reputations for legal approaches more sympathetic to one end of the political spectrum, these challengers become remarkably successful in persuading at least some of the courts to embrace legal theories soundly criticized by many in the legal academy — and novel even in the views of some of their proponents. And when these lawsuits finally reach the Supreme Court, the justices deliver a mixed verdict, upholding the core of the president’s initiative, but also sustaining enough of the challengers’ objections that all involved can claim some kind of victory.

That scenario is an apt description of the challenges President Trump’s “travel ban” has sustained and continues to face. It is also a fitting characterization of lawsuits filed back in 2010, challenging the substantive centerpiece of President Barack Obama’s Affordable Care Act know as the individual mandate. Yet despite the distinct sense of history repeating itself, conservative and libertarian legal commentators (many of whom were on the challengers’ side opposing Obamacare in the 2010 litigation) are now accusing individual judges — and sometimes entire federal courts — of shirking their institutional roles as neutral magistrates and “joining the resistance” in the various suits against President Trump.

From National Review to The Wall Street Journal, these critics are voicing the idea that if President Trump loses any of his legal battles, it will be because progressive judges are out to get him. The fact that many of these rulings have come from Republican appointees or centrist Democrats and that they are often rooted in sound doctrinal principles is left out. To the critics, these judges aren’t real judges; they’re partisan hacks in robes. These critics, in the guise of dispassionate legal analysts, are using the same kinds of language and tactics deployed by the president they claim not to be defending to attack judges and their rulings.

For instance, Josh Blackman, a professor at South Texas College of Law, argued in National Review this month that opposition to the president’s policies had been “advanced” by federal judges “who abandoned their traditional role out of a fear that Donald Trump posed an existential threat to the republic.” And Ilya Shapiro, a senior fellow in constitutional studies at the Cato Institute, argued on the Cato at Liberty blog in late May that “what’s going on here isn’t a sober legal analysis” but “a wholesale rejection of Donald Trump.”