What is a word to mean "when bad is good"?

I'm looking for a single word (adjective or adverb) to describe a person who acts "bad", but in an admirable fashion. Examples of this abound from history and literature. Here are just a few I could think of :

  • pirates
  • vikings
  • Batman
  • Bonnie & Clyde
  • Captain Nemo
  • James Dean

Note that these characters are not (necessarily) acting to achieve any greater social or moral goal. They are simply breaking rules, and they are respected for it.

The word I am looking for will complete this sentence:

Jim Stark was such a ___ kind of guy.


That should be an antihero.

antihero in MW dictionary: a main character in a book, play, movie, etc., who does not have the usual good qualities that are expected in a hero

Incidentally, a couple of the examples that you mentioned appear in this list (I saw mention of Batman, pirates & Vikings): https://en.wikipedia.org/wiki/List_of_fictional_antiheroes