A children's book (or perhaps Young Adult) by Terry Pratchett. It is written in the style of his Discworld books, and Good Omens. This is the second in the Johnny Maxwell series.
Johnny Maxwell is your average kid, although he has strange adventures and strange friends. This time his strange adventure revolves around ghosts. Johnny discovers that he is the only (sane) person in Blackbury who can see ghosts. It just so happens that this discovery happens only days after the town has announced that it was selling the graveyard to United Amalgamated Consolidated Holdings, where they planed to put up office blocks.
Johnny and his friends work to save the graveyard, at first for the sake of the ghosts, but then for the sake of local history. As is always the case in the Johnny books, there are some 'deeper' themes running in the background; "What is our relationship to our history?", "should we give up on the past in the name of the future?", and (maybe) "what is death?", although Terry Pratchett doesn't seem to be seriously trying to answer that last one. Fortunately, these questions don't get in the way of the story, or the humour.
A very good book, and any Pratchett fan should read it (along with the rest of the Johnny Maxwell Trilogy), no matter what their age.
Published by Doubleday in 1993 (Hardcover), and Corgi in 1994 (Paperback).
The Johnny Maxwell series thus far: Only You Can Save Mankind, Johnny And The Dead, Johnny and the Bomb.