import re
import json


def load_config(filename):
    """Load JSON config file and remove line comments."""

    with open(filename, 'r') as f:
        _lines = list(f)

        for _i, _line in enumerate(_lines):
            _lines[_i] = re.sub(r'//.*\n', '\n', _line)

        return json.loads(''.join(_lines))