Skip to content
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

Add stylelint engine for .css linting #532

Merged
merged 2 commits into from
Jun 21, 2021
Merged

Conversation

Iain-S
Copy link
Contributor

@Iain-S Iain-S commented Jun 9, 2021

Issues with CSSLint

Running CSSLint via codeclimate has several issues:

  1. Most importantly, I can't get it to pay attention to .csslintrc so we have no way to ignore rules (I'm pretty sure it also ignores commandline args when run via codeclimate so we can't do --ignore="rule1","rule2").
  2. CSSLint isn't maintained so many of the rule violations are actually CSSLint bugs.
  3. When run via codeclimate, it doesn't print the name of the broken rule, only the offending file and linenumber.
  4. If you install csslint with npm, the default formatting still doesn't print the rule name. I had to do csslint --format=compact public/css/ | sed 's/line/\n\nline/g' to get a useful output. The standalone csslint does at least adhere to .csslintrc.

All in all, I'm not sure the codeclimate csslint plugin is that useful as a CI tool. Though you may still want to use it to find the * and *= issues (though even this is disputed).

stylelint

Stylelint doesn't pick up all of the same issues as CSSLint but

  1. The VSCode plugin is nice.
  2. The standalone stylelint comandline tool has a --fix option to automatically fix some issues.
  3. When run with codeclimate -e, stylelint does print the name of the broken rule(s).

@codeclimate
Copy link

codeclimate bot commented Jun 9, 2021

Code Climate has analyzed commit 4c2ea2f and detected 0 issues on this pull request.

View more on Code Climate.

@yeban yeban merged commit 2572fed into wurmlab:master Jun 21, 2021
@yeban
Copy link
Collaborator

yeban commented Jun 21, 2021

Thanks!

yeban added a commit that referenced this pull request Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants