Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cosmiconfig for configuration loading #126

Open
thasmo opened this issue Apr 23, 2016 · 13 comments
Open

Use cosmiconfig for configuration loading #126

thasmo opened this issue Apr 23, 2016 · 13 comments
Assignees
Labels
enhancement Functionality that enhances existing features keep-unstale The issue will not be marked as stale by the stale-bot

Comments

@thasmo
Copy link

thasmo commented Apr 23, 2016

Would be awesome if HTMLHint used cosmiconfig for loading the configuration.

@yaniswang
Copy link
Contributor

Can you show the feature of cosmiconfig?

@thasmo
Copy link
Author

thasmo commented May 6, 2016

Their docs are very easy to grasp, but basically it does this:

Find and load a configuration object from
- a package.json property (anywhere down the file tree)
- a JSON or YAML "rc file" (anywhere down the file tree)
- a .config.js CommonJS module (anywhere down the file tree)
- a CLI --config argument

It supports rc files with optional file-type extension, e.g. .sasslintrc.yml or .sasslintrc.json and, as mentioned, it can also read configuration from the package.json file - an option which gains more and more interest lately.

And:

Additionally, all of these search locations are configurable: you can customize filenames or turn off any location.

@yaniswang
Copy link
Contributor

I don't see it is very necessary to use cosmiconfig.

@thasmo
Copy link
Author

thasmo commented May 6, 2016

It's more a suggestion to greatly improve dev/user experience imo, no necessity in the first place.

@gforcada
Copy link

👍 on that, rather than spreading my configurations on 1000 files I prefer to have everything in a single place: package.json, this way I have JS dependencies, eslint and styleling rules, The only thing missing right now is htmlhint 😞

@thasmo
Copy link
Author

thasmo commented Mar 21, 2017

Indeed. cosmiconfig supports using your preferred method.

@thedaviddias thedaviddias added enhancement Functionality that enhances existing features triage An HTMLHint team member will look at this issue type: discussion labels Aug 22, 2018
@Kristinita
Copy link

+1.

1. Summary

It would be nice, if HTMLHint will support YAML configuration files. htmllintrc.yaml for example.

2. Argumentation

JSON — is not a good idea for user-editing files. Main reason — user can't write comments, why he uses those or other options. Another arguments:

Also, look at related issue.

Thanks.

@ryansully
Copy link

To add my two cents, I prefer .js config files supported by cosmiconfig so that I can break configuration into separate CommonJS module files as needed, as well as document them with comments. I've seen far too many config files with settings that have no explanation as to their purpose or reason for why a particular value was chosen for that setting.

@stale
Copy link

stale bot commented May 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the bot:stale Issue marked as stale because there was no activity label May 14, 2020
@Kristinita
Copy link

The problem still exists.

Thanks.

@stale stale bot removed the bot:stale Issue marked as stale because there was no activity label May 14, 2020
@Shinigami92 Shinigami92 self-assigned this May 17, 2020
@Shinigami92 Shinigami92 added accepted and removed discussion triage An HTMLHint team member will look at this issue labels May 17, 2020
@Shinigami92
Copy link
Contributor

I will work on this after #279

@Shinigami92 Shinigami92 added the keep-unstale The issue will not be marked as stale by the stale-bot label May 17, 2020
@github-actions github-actions bot removed the accepted label Jun 11, 2021
@ghost
Copy link

ghost commented Dec 13, 2021

我坚持我的看法。
在我看来,让 HTMLHint 原生支持 .js 后缀的配置文件是理所当然的事情。

@gian1200
Copy link

gian1200 commented Jul 3, 2023

If this is implemented, then autocomplete could be used (like in ESLint) in configfile with *.js, *.ts, *.mjs or *.cjs extensions.

.eslintrc.cjs
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Functionality that enhances existing features keep-unstale The issue will not be marked as stale by the stale-bot
Projects
None yet
Development

No branches or pull requests

8 participants