loleaflet: introduce "stylelint" a modern linter for CSS

Change-Id: I8a7427eeb3b838baac8a6669d5313dc0d53d9ddd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102199
Tested-by: Pedro Silva <pedro.silva@collabora.com>
Reviewed-by: Pedro Silva <pedro.silva@collabora.com>
This commit is contained in:
Henry Castro
2020-09-07 15:22:38 -04:00
committed by Pedro Silva
parent 175ac6e740
commit d7353acf96
4 changed files with 18 additions and 2 deletions

View File

@ -1,6 +1,5 @@
node_modules
node_cache
.*
tmp/**/*
*.iml
*.sublime-*

View File

@ -0,0 +1,13 @@
{
"rules": {
"indentation": "tab",
"string-quotes": "single",
"no-duplicate-selectors": true,
"selector-combinator-space-after": "always",
"selector-attribute-quotes": "always",
"selector-attribute-brackets-space-inside": "never",
"function-url-quotes": ["always", {
"except": ["empty"]
}]
}
}

View File

@ -447,6 +447,8 @@ $(INTERMEDIATE_DIR)/loleaflet-src.js: $(call prereq_loleaflet)
$(DIST_FOLDER)/bundle.css: $(call prereq_css)
@mkdir -p $(dir $@)
@echo "Checking for CSS errors..."
@$(NODE) node_modules/stylelint/bin/stylelint.js --config $(srcdir)/.stylelintrc.json $(srcdir)/css/*.css
$(call bundle_css)
$(DIST_FOLDER)/bundle.js: $(INTERMEDIATE_DIR)/loleaflet-src.js $(call prereq_all)

View File

@ -23,7 +23,9 @@
"uglifycss": "0.0.29",
"uglifyify": "5.0.2",
"vex-js": "4.1.0",
"typescript": "3.9.5"
"typescript": "3.9.5",
"stylelint-config-standard": "20.0.0",
"stylelint": "13.7.0"
},
"repository": {
"type": "git",