Earwigs like to come out at night when you're not looking and eat flowers and new growth.
Remove mulch like bark or piles of leaves from the immediate area.
a thin layer of diatomaceous earth around the basil will discourage them.
However this will have to be redone after a rainfall Longer term solutions are consider where you have planted basil as your "trap" area.
Plant more basil that you want to keep in clay pots or other containers in a different area.
encourage natural insect eating predators such as frogs.
They need water, shelter and lots of insects to eat.
gardening.stackexchange.com/users/499/kevinsky
Last year we grew chives right next to basil in our square foot garden and had absolutely no pest problems near the chives.
I am not sure if chives repel earwigs though.
I did find this article however.
gardening.stackexchange.com/users/1121/Jeremy Novak
You might try what I did for the same problem with Asiatic Garden Beetles - make covers for the plants out of window screen material.
Row cover might be easier to use, but overheating is an issue unless you can find some really lightweight row-cover.
gardening.stackexchange.com/users/445/Ed Staub
It was quite a revelation when I discovered an earwig in my basil plants.
The leaves had been developing "holes" overnight.
Since then, I've been spraying the basil plants twice daily with a 10% solution of dish soap and water.
I'm partial to the Dollar store brand -- don't ask what that brand may be.
I know that its an amber colored soap.
I give my plants a thorough spraying both on the upper and lower side of the leaves.
The nymphs are similar in color to the plant stems and difficult to see.
The eggs are dark green and brown.
I spray them all and leave a soapy, foamy residue around the stems and leaves -- as much as possible.
Not sure if the soap kills them outright, so when they fall from the plant, I try to remove them all from the vicinity.
The soaping makes the leaves nice and shiny, too.
gardening.stackexchange.com/users/6849/The reluctant gardner
I thought I had slugs, so I set up a few beer traps.
In the morning I had 4 earwigs, so I guess the traps are at least partially effective against earwigs.
gardening.stackexchange.com/users/26343/Glenn
Last night I found that earwigs have been eating my newly planted basil plants. They have only been in the ground for a few days, and it didn't take long for the earwigs to find them.  The planted ones are lost. I have read  this question  about millipedes, which mentions removing debris, so I'll start with that.   Is there anything I can do to prevent earwigs from eating any more herbs that I would like to plant?
How can I keep earwigs from eating my basil?
gardening.stackexchange.com
<pest-control><pest-damage>
gardening.stackexchange.com/questions/3891
gardening.stackexchange.com/users/101/kmm
Remove mulch or bark from the area around. Encourage natural predators like frogs. You can alos try growing chives right next to basil. Remove mulch like bark or piles of leaves from the immediate area and encourage natural insect eating predators such as frogs.  You can also grow chives next to the basil or make covers for the plants out of window screen material.  
Remove mulch like bark or piles of leaves from the immediate area.   Encourage natural insect eating predators such as frogs.   Last year we grew chives right next to basil in our  square foot garden  and had absolutely no pest problems near the chives.   You can make covers for the plants out of window screen material.   Spray the basil plants twice daily with a 10% solution of dish soap and water.