Open Splines opened 3 weeks ago
@Splines hello. Thanks for the suggestion, I agree with adding a preprocessor. However, I am not very familiar with ERB, so if I were to implement it, it might take some time. I will refer to the code you shared. Thank you.
Hey there, thanks so much for creating this tool. I'm wondering how all the people programmed HTML all those years without a proper HTML linter? Like as if the W3C Validator is one of the top results when I search for "HTML linter" on the web 😂
I'd like to lint the HTML part of
.html.erb
files. ERB is a templating language used in Ruby on Rails projects. In order to lint.js.erb
files, I've written a customESLint plugin
, which is essentially a preprocessor (and then also a postprocessor) to strip away all the ERB parts in the code (replacing them with a dummy comment), while keeping track of the positions to correctly map line and colon numbers of ESLint messages. Here's what you can achieve with it (image should be animated):I was wondering if your project also supports some kind of mechanism such that I could use this preprocessor again (maybe with only slight changes) for
.html.erb
files. The recommended ESLint configuration basically just declares the processor.This would allow me to lint the HTML part of these files. I would then use a tool like
ERB Lint
to lint the ERB parts.