Skip to content

Commit e76dfdd

Browse files
silverwindjeffliu27
authored andcommitted
replace lesshint with stylelint (go-gitea#7305)
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.
1 parent 6fdc06d commit e76dfdd

File tree

12 files changed

+1446
-236
lines changed

12 files changed

+1446
-236
lines changed

.lesshintrc.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

.stylelintrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extends: stylelint-config-standard
2+
3+
rules:
4+
block-closing-brace-empty-line-before: null
5+
color-hex-length: null
6+
comment-empty-line-before: null
7+
declaration-empty-line-before: null
8+
indentation: 4
9+
no-descending-specificity: null
10+
rule-empty-line-before: null
11+
selector-pseudo-element-colon-notation: null

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ js: npm
392392

393393
.PHONY: css
394394
css: npm
395-
npx lesshint public/less/
395+
npx stylelint public/less
396396
npx lessc --clean-css="--s0 -b" public/less/index.less public/css/index.css
397397
$(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;)
398398
npx postcss --use autoprefixer --no-map --replace public/css/*

0 commit comments

Comments
 (0)