Closed ntwb closed 7 years ago
Hi, thanks for the detailed report.
So, it seems like it doesn't find any config for Stylelint, based on:
https://github.com/davidtheclark/cosmiconfig
I suppose we should fail properly and note that it didn't find any config.
At least that's what I'd expect if I'd use this tool without a config.
What do you think?
I expected it to work "as is", if you try and use it as noted in #7 you would get the same results
I mean, would you expect it to fail and tell you it didn't find a config?
Or perhaps something else?
The purpose of this tool is to find available stylelint rules that are not configured in your config.
Right, the reason is that all 3 of these repos are shared configs rather than configurations that stylelint would normally detect using cosmiconfig
So it would be great if stylelint-find-rules
could add support for shared configs so that it can be used as a tool to detect any rules missing from a shared config and not just cosmiconfig detected configurations such as .stylelintrc
etc 😄
@ntwb Is this for making the development of shared configs easier?
I could add a --config
flag and you'd pass the path to index.js
in your case.
Is that viable?
@ntwb Turns out we already had support for --config
through cosmiconfig :-)
I've made some changes any way to print an error if a config is not found and documented the custom config case with --config
:
https://github.com/alexilyaev/stylelint-find-rules#custom-config-file
Release notes: https://github.com/alexilyaev/stylelint-find-rules/releases/tag/v0.7.0
Works great @alexilyaev 👌
Just realized if the config itself extends something, I'm not following it, hmm.
Opening a new issue :-).
Testing with https://github.com/WordPress-Coding-Standards/stylelint-config-wordpress
Results in error:
(node:82670) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'config' of null
Tested using Node.js v6.11.1 and v8.2.1
Via cli:
Via
package.json
npm script:How I tested it: