-
Notifications
You must be signed in to change notification settings - Fork 1
Is webhint a general purpose hinter/linter? #49
Comments
Short answer is: yes.
We designed We also tried to simplify the process of creating new modules such as new
We don't want to reinvent the wheel, so that is exactly what we were thinking when we first created Our thinking is: when we find tools that we as a community decide are very useful and do a great job at what they test, we will try to integrate them into We already do this with a few of them. E.g.: aXe (
For that we have the concept of
Since everything is modular, multiple I hope that answers your questions. Let us know if you have more, or something isn't clear. |
Hi @alrra , thank you for this indepth answer.
Do the parsers have any kind of constraints? For example I'd like to use the complete TypeScript language service in a hint (to have access to
What would be a good place to start adding something like a (By the way, some packages linked in https://webhint.io/docs/user-guide/concepts/parsers/#list-of-official-parsers only show a 404 page.) Are there already existing discussions about a "auto-fix" feature? (Which would be quite useful for Some totally different topic: You said webhint is quite pluggable - how much actually? :) Could I write a "zero config" feature, which automatically loads custom hints (e.g. based on the dependencies I use and if they have a Thank you! |
The only constraint will be how to access and shared the information. All the different parts of webhint communicate with each other via events. Parsers subscribe mostly to For your case you will use the local connector, subscribe to
Nice catch, while we update it you can replace
That's something we want to do but haven't thought yet on how to do it. Not all the rules will support autofix but it's definitely something we eventually want to explore more seriously. Feel free to open an issue in this same repo if you have some ideas about it!
A lot, everything has its own package: hints, parsers, connectors...
Yes you can. You will have to write the code to parser the What you are proposing is really interesting. Maybe open a new issue with more details, scenarios that could fix, how that would work, etc.? Thanks! |
Thank you very much for the detailed answer. I'll read the architecture section and anything additional I can find and I hope I find time to play around with the APIs, before I create a more detailed issue. Thank you so far! |
Hi there,
this is issue is based on this Twitter conversation. First things first: Thank you for this project.
I'd like to know what is the exact scope of webhint? The website says "webhint is a linting tool that will help you with your site's accessibility, speed, security and more, by checking your code for best practices and common errors.". I'd like to know if it should be treated as a (pluggable?) general purpose hinter/linter?
Why do I ask?
Currently we use multiple linters. Every linter slightly differs in output/configurations/and so on. I'm looking for a tool which tries to generalize and abstract the common behavior. Ideally I would like to have a basic linting foundation which works similar to prettier: it is has some common rules/APIs and is pluggable for new languages.
I'd like to lint my CSS/HTML/JS/TS/etc. files with the same tools, especially when I have a linting rule which affects multiple languages (changing path, renaming things which correspond to each other and so on).
It would be nice if webhint could hook into existing language service (e.g. the on for TypeScript) to use them for analyzing the code and triggering refactors.
Is this in the scope of this project?
The text was updated successfully, but these errors were encountered: