Skip to content

A CSSLint fork supporting modern CSS, primarily used in the Stylus extension

License

Notifications You must be signed in to change notification settings

openstyles/csslint-mod

Repository files navigation

A fork of the original CSSLint Build v0.10.0 15-August-2013 01:07:22, heavily modified since then as a part of Stylus extension, now extracted to a separate repo.

  • Supports modern CSS syntax including nesting, grids, complex selectors in pseudo selectors like :has().
  • Verifies function arguments including the modern color-mix(), hwb(), etc.
  • Partly rewritten and mostly refactored to use modern JS.
  • Small minified size: ~80kB parser with all the CSS specs and grammar, ~26kB rule checker.
  • Somewhat optimized for speed: ~2x faster than stylelint with a dozen of simple rules and up to 10x in the subsequent runs while editing the CSS in the browser thanks to a primitive cache that reuses results from the previous run.
  • New rules:
  • No support for CLI or extra formatters.

WIP:

  • Get CSS specs from MDN or csstree or W3C. Doesn't seem entirely straightforward so far: there are mistakes/omissions in some definitions.

TODO:

  • Make the embedded /* csslint */ comments work with caching.
  • Update the old CSSLint rules and remove the obsolete ones.
  • Adopt the most popular/useful rules from other linters.
  • Check validity of calc() and other math functions.
  • Restore the JSDoc comments from the original CSSLint?

About

A CSSLint fork supporting modern CSS, primarily used in the Stylus extension

Resources

License

Stars

Watchers

Forks

Packages

No packages published