From d4f1329e8b1f818dadd56f0c5c0c21a3132b4758 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Thu, 31 Oct 2019 11:17:34 +0100 Subject: [PATCH 1/4] Internal: Enabled stylelint in the package. --- package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package.json b/package.json index f8f38c7c..9b91da0b 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", "lint-staged": "^7.0.0", + "stylelint": "^11.1.1", "postcss-loader": "^3.0.0", "raw-loader": "^3.1.0", "style-loader": "^1.0.0", @@ -72,11 +73,15 @@ "scripts": { "build": "webpack --mode production", "lint": "eslint --quiet '**/*.js'", + "stylelint": "stylelint --quiet 'theme/**/*.css' 'docs/**/*.css'", "preversion": "npm run build; if [ -n \"$(git status src/ckeditor.js build/ --porcelain)\" ]; then git add -u src/ckeditor.js build/ && git commit -m 'Internal: Build.'; fi" }, "lint-staged": { "**/*.js": [ "eslint --quiet" + ], + "**/*.css": [ + "stylelint --quiet" ] }, "eslintIgnore": [ From 9563f6fab2456a38b0c68e1d39f4fc9ab37dc931 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 10:51:56 +0100 Subject: [PATCH 2/4] Internal: Allowed empty input in the stylelint script to avoid errors when no files are found. Added missing stylelint-config-recommended dependency. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9b91da0b..45158b89 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "scripts": { "build": "webpack --mode production", "lint": "eslint --quiet '**/*.js'", - "stylelint": "stylelint --quiet 'theme/**/*.css' 'docs/**/*.css'", + "stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css' 'docs/**/*.css'", "preversion": "npm run build; if [ -n \"$(git status src/ckeditor.js build/ --porcelain)\" ]; then git add -u src/ckeditor.js build/ && git commit -m 'Internal: Build.'; fi" }, "lint-staged": { @@ -81,7 +81,7 @@ "eslint --quiet" ], "**/*.css": [ - "stylelint --quiet" + "stylelint --quiet --allow-empty-input" ] }, "eslintIgnore": [ From 3ee373ba8483de0b2c4e5972c77e478c60908df9 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 11:00:37 +0100 Subject: [PATCH 3/4] Internal: Added the stylelintrc config. [skip ci] --- .stylelintrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .stylelintrc diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 00000000..4b350399 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,6 @@ +{ + "extends": "stylelint-config-recommended", + "rules": { + "at-rule-no-unknown": null + } +} From 26fe76cf052800dc48ac974df19371804955636d Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 12:53:56 +0100 Subject: [PATCH 4/4] Used the external stylelint-config-ckeditor5 package for stylelint configuration. --- .stylelintrc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 4b350399..1d86a41f 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,6 +1,3 @@ { - "extends": "stylelint-config-recommended", - "rules": { - "at-rule-no-unknown": null - } + "extends": "stylelint-config-ckeditor5" }