Open thasmo opened 8 years ago
Can you show the feature of cosmiconfig?
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.
I don't see it is very necessary to use cosmiconfig.
It's more a suggestion to greatly improve dev/user experience imo, no necessity in the first place.
๐ 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 ๐
Indeed. cosmiconfig supports using your preferred method.
+1.
It would be nice, if HTMLHint will support YAML configuration files. htmllintrc.yaml
for example.
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.
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.
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.
The problem still exists.
Thanks.
I will work on this after https://github.com/htmlhint/HTMLHint/issues/279
ๆๅๆๆ็็ๆณใ ๅจๆ็ๆฅ๏ผ่ฎฉ HTMLHint ๅ็ๆฏๆ .js ๅ็ผ็้ ็ฝฎๆไปถๆฏ็ๆๅฝ็ถ็ไบๆ ใ
If this is implemented, then autocomplete could be used (like in ESLint) in configfile with .js, .ts, .mjs or .cjs extensions.
.eslintrc.cjs
Would be awesome if
HTMLHint
used cosmiconfig for loading the configuration.