President-elect Donald Trump’s decision to appoint his son-in-law, Jared Kushner, as a senior White House adviser very likely violates a federal anti-nepotism law, and shows again how little he seems to care about the legal and ethical obligations of the office he is about to assume.

The language of the law is clear: No federal official, including the president, may hire or appoint a relative, including a son-in-law, to “a civilian position in the agency in which he is serving or over which he exercises jurisdiction or control.”

There’s a good reason for anti-nepotism laws, versions of which are also on the books in most states. Government officials seek informal advice and counsel from relatives all the time, but when they appoint or hire those people, they undermine the public’s faith that important posts are being filled with the best possible candidates. And when relatives get security clearance to view classified information and sit in on high-level meetings, it upends delicate dynamics, as senior staff members keep their mouths shut rather than contradict a trusted relative of their boss. Even if Mr. Kushner is technically subordinate to others on the White House staff, he is always first and foremost Mr. Trump’s son-in-law.

The scope of Mr. Kushner’s responsibilities is not clear, but it could be extremely broad. He was by Mr. Trump’s side throughout much of the campaign, an influential voice with impressive contacts. At one point he arranged a meeting between Mr. Trump and the Israeli prime minister, Benjamin Netanyahu.