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.

Support standard cosmiconfig file names

See original GitHub issue

At the moment size-limit does not support standard cosmiconfig file names:

https://github.com/ai/size-limit/blob/0.22.0/cli.js#L188

.sizelimitrc.json or .size-limitrc.json, or even .size-limit.json would be nicer than .size-limit, because editors could tell the file is JSON for syntax highlighting and Prettier formatting. Compare a .size-limit file opened next to a .lintstagedrc.json file in VS Code:

Screen Shot 2019-03-31 at 2 58 18 pm

I’ve recently changed my mind about including all config in package.json (as it bloats the published file). Of the ~6 config files I just created in a project for various tools size-limit was the only one I had to look up the documentation to work out the right filename.

Supporting standard cosmiconfig file names doesn’t have to be a breaking change; .size-limit could remain an option.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
aicommented, Mar 31, 2019

Released in 1.0

0reactions
aicommented, Apr 1, 2019

Fixed 684eb6a

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration File - Prettier
Prettier uses cosmiconfig for configuration file support. This means you can configure Prettier via (in order of precedence):.
Read more >
@types/cosmiconfig | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
node_modules/cosmiconfig ... - GitLab
Type: string or false Default: '.[moduleName]rc'. Name of the "rc file" to look for, which can be formatted as JSON or YAML. If...
Read more >
Configuration | Stylelint
Stylelint uses cosmiconfig to find and load your configuration object. ... You can add a filename extension to help your text editor provide...
Read more >
npm:@darkobits/saffron | Skypack
Cosmiconfig is an extremely powerful and configurable utility for adding support for configuration files to an application in several different formats, ...
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