When building a shed close to a property line most counties and towns have a rule about how close you can build to the property line.
This is called a setback line which means you must leave sufficient room between your property line and the neighbors property line when building the shed, house etc.
Most places have a rule that says that when you build something you must build it a minimum of 5 feet away from the property line.
However some places have the set back line as 10 to 15 feet.
You would have to check with your local building codes such as at the town hall about the actual and correct set back line.
But most of them require you to build your shed, house, etc at least 5 feet away from your property line.
I had a neighbor that had to move a mobile home in and I had to give him permission to let his mobile home overhang my property line by about 5 feet which was okay with me.
He had a small property and a smaller house on that property that burned down and so he had a mobile home moved in but he forgot that the mobile home was a bit too wide.
The other property owner did not want his mobile home to encroach on his property line and so I allowed him to put it on my property line the 5 feet he needed.
It doesn't bother me and if he needs to move it later he can.