question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

config file json js ts support

See original GitHub issue

Would you consider to support browserslist.config.json and even browserslist.config.js browserslist.config.ts as config files?

I am currently gathering some information and opinions about config files and conventions and wrote a short article about the the inconsistency that is going on at the moment and a proposal as a possible solution. What are your thoughts on this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
timreichencommented, Jun 11, 2020

I see. I am very glad to hear that it would be at least a considerable. In my opinion the support for the JSON format on it’s own would already be a huge deal. As described in my article I am not a big fan of using package.json for configuration data, allowing a self contained browserslist.config.json would make a big difference and has some real use cases:

  • Simpler dynamic config file generation
  • Easy parsing format (for example in plugins)
  • Paves the way to easy support for other tools like deno who do not have a package.jsonfile and use JSON as a standard config format (as in tsconfig.json)
  • Aligns with lots of other tools (webpack, parcel, rollup, babel, deno, import-maps etc.) and therefore going in a more standardised direction
  • Would allow for IntelliSense in VSCode
1reaction
dev99problemscommented, Aug 12, 2020

Hey folks, any updates on that? TBH this is really a pain in the ass in case of monorepo, when you want to share a bunch of configs for different tools, but you have to implement a separate package specifically for BL shareable config. Looks like a some hack.

  1. I like to allow other languages to parse Browserslist. For instance, in Autoprefixer Rails I use Ruby code to parse the file. In the past Compass parsed it as well.

Totally agree on that, so seems like for other languages default browserslistrc fits perfectly, but for a such heavily relied package as Browserslist in front-end community it would be extremely helpful to support some implicit common practice, like giving the ability to set up configuration in js file, etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - What is a tsconfig.json - TypeScript
The tsconfig.json file specifies the root files and the compiler options required to compile the project. JavaScript projects can use a jsconfig.json file...
Read more >
jsconfig.json Reference - Visual Studio Code
The jsconfig.json file specifies the root files and the options for the features provided by the JavaScript language service.
Read more >
Is it possible to include a json file when using TypeScript with ...
One workaround is to make the json file a normal js file, require/import it normally, and add "allowJs" : true to "compilerOptions" in...
Read more >
Configuration options in tsconfig.js file | TypeScript Tutorial
00:00 Overview of tsconfig. json file 01:55 ' help ' CLI option 03:00 ... with 'strict' compiler option enabled 07:04 Debug TS code...
Read more >
How to Set Up Environment Variables using JSON files with ...
In today's JavaScript world, it's possible to read JSON Modules as follows: import config from '../../config.json' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found