New York Supreme Court Justice Paul Feinman offered school kids a ray of hope yesterday when he gave the city the OK to close 22 failing schools and place 15 charters in Department of Education buildings.

City Hall has sought to do so for months. But the teachers union — looking to save jobs at the failing schools and to snuff out competition at the charters — sued, with the help of the NAACP (which it helps support financially).

Feinman disagreed with the suit’s claims that the failing schools could be turned around and that the city’s plans for the charters did not “fulfill their obligation of completeness” under the law.

But those claims never had any merit; the litigation was meant as just another union harassment for the city — not to mention the kids and their families.

Feinman’s ruling, of course, will have broad consequences well beyond the fate of the 37 schools in question. And the unions vow more litigation.

And we’ll certainly have more to say about all that in the coming days.

For now, though, bravo to a jurist who did right by the law. And by the kids.