3

Looking through some HTML templates produced for a project on which I am currently working, I've found extensive use of inline styles, eg:

<div style="margin-top: 1em;"></div>

I'm looking for a linting tool to plug into our Gulp pipeline to catch these usages and throw a warning.

My google-fu seems to be failing me, so does anyone know if such a thing exists?

2
+25

Why don't you just grep (search) through all *.html files for the string style=?

Your IDE almost certainly offers you a way to do so, with Ctrl+Alt+f or Ctrl+Shift+f or Ctrl+h, or some such.

If you want to see them in context, use something like File Locator Lite for Windows or Search Monkey, which I have used on both Windows & Linux, to search for a line containing astring, but also show a few lines before and after.

Not necessary in this case, since you have a blanket ban, but always nice to know of the possibility.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.