Otto Penzler, the dean of noir, has this to say about the genre. “Noir works, whether films, novels or short stories, are existential, pessimistic tales about people, especially protagonists who are seriously flawed and morally questionable. The tone is generally bleak and nihilistic with characters whose greed, lust, jealousy and alienation lead them into a downward spiral as their plans and schemes inevitably go awry……the private detective story is a different matter entirely.”
The moral tone is ambiguous-innocent people don’t always win, the guilty are not always punished except maybe by themselves, and nobody rides in on a white horse to rescue the damsel in distress. Revenge is always in vogue, too.
 Foreword to Best American Noir of the Century, edited by Ellroy and Penzler (2010) reviewed by Ian Crouch in the New Yorker.