antonk52 / cssmodules-language-server

autocompletion and go-to-defintion for cssmodules
MIT License
54 stars 8 forks source link

Crash with commented tsconfig.json #23

Closed dhleong closed 3 months ago

dhleong commented 3 months ago

Looks to be caused by lilconfig here using require to read JSON. Seems like we could use the require-json5 module to override the default json file loader, something like:

    const searcher = lilconfigSync('', {
        searchPlaces: ['tsconfig.json', 'jsconfig.json'],
        loaders: {
            '.json': require('require-json5'),
        },
    });

What do you think? Happy to put up a PR if you're open to this

antonk52 commented 3 months ago

Hey, this makes sense. Happy to merge your PR. Though let's use json5 directly without require-json5.