-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Default configuration #25
Comments
Hi @ericcornelissen , Regarding sensible defaults – I'm really not an SVG expert, that's why I was looking for a linter to help me notice my problems. I use SVGs exclusively for the web, where (I imagine) the defaults are different from other environments. Maybe you could have different sets of defaults (or just one, for starters), that can be specified via a flag. That way, you could even keep the current behaviour for throwing if no config is provided. Running without a config file, with the
Or the
Or assuming a config file:
I'd suggest that if you don't provide a defaults flag, and there is no config, an error is thrown. The error message should indicate which defaults you can use. If you provide a defaults flag, and there is a config file, the defaults should take precedence, but this should emit a warning. Just my 2 cents … since I'm pretty caught up in other projects right now, I won't be able to support with implementing this. But maybe you can get something out of it :) |
Thank you very much for the thoughtful comment @stefanpl! (and no problem for not having found the other issue) I think we will start by removing the need for a configuration file (which will basically just validate your SVG) and we can add some sensible defaults to that later (e.g. there must be an attribute like As for your suggestion of different defaults. I think web is the primary use case by a large margin, so I think we can use defaults for the web as the default defaults. We can always add support for other default rulesets in a non-breaking way using the CLI flag style you suggested. And lastly, just a note to my future self - or anyone looking to implement sensible defaults - it may be interesting to support "extending" the default rules. I'll open this issue again as I'm interested in supporting the sensible defaults part, which is not explicit in #10. |
I would expect this package to work without having to provide a config file. Sensible defaults should be applied when there is no such file – instead, the program will just fail right now.
This would enable one-off usage outside a given project, like:
I'm a big fan of linters, and really like the idea of constraining and checking svgs. Hope to see this project grow 🌱
The text was updated successfully, but these errors were encountered: