Skip to content

Commit

Permalink
replace lesshint with stylelint (go-gitea#7305)
Browse files Browse the repository at this point in the history
New CSS linter which is much more powerfull than the previous one.
Configuration is default but I had to remove a few rules that were
throwing too many or weird errors.

More importantly, the linter will exit with code 1 on errors so now our
build will fail if the CSS linter fails which should eliminate linter
errors being introduced without notice.
  • Loading branch information
silverwind authored and jonasfranz committed Jun 27, 2019
1 parent da23041 commit c37ec66
Show file tree
Hide file tree
Showing 12 changed files with 1,446 additions and 236 deletions.
12 changes: 0 additions & 12 deletions .lesshintrc.json

This file was deleted.

11 changes: 11 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: stylelint-config-standard

rules:
block-closing-brace-empty-line-before: null
color-hex-length: null
comment-empty-line-before: null
declaration-empty-line-before: null
indentation: 4
no-descending-specificity: null
rule-empty-line-before: null
selector-pseudo-element-colon-notation: null
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ js: npm

.PHONY: css
css: npm
npx lesshint public/less/
npx stylelint public/less
npx lessc --clean-css="--s0 -b" public/less/index.less public/css/index.css
$(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),npx lessc --clean-css="--s0 -b" public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
npx postcss --use autoprefixer --no-map --replace public/css/*
Expand Down
Loading

0 comments on commit c37ec66

Please sign in to comment.