From 28dd22b19bcc5f1b9d8f04db85f558b172ed8c28 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Thu, 31 Oct 2019 11:17:42 +0100 Subject: [PATCH 1/4] Internal: Enabled stylelint in the package. --- package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cc19e8c..2246d62 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "eslint": "^5.5.0", "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", - "lint-staged": "^7.0.0" + "lint-staged": "^7.0.0", + "stylelint": "^11.1.1" }, "engines": { "node": ">=8.0.0", @@ -50,11 +51,15 @@ "theme" ], "scripts": { - "lint": "eslint --quiet '**/*.js'" + "lint": "eslint --quiet '**/*.js'", + "stylelint": "stylelint --quiet 'theme/**/*.css' 'docs/**/*.css'" }, "lint-staged": { "**/*.js": [ "eslint --quiet" + ], + "**/*.css": [ + "stylelint --quiet" ] }, "eslintIgnore": [ From 629dc088633796d6d892c53c9c0fb99b25763d0f Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 10:52:04 +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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2246d62..12a3ea3 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", "lint-staged": "^7.0.0", - "stylelint": "^11.1.1" + "stylelint": "^11.1.1", + "stylelint-config-recommended": "^3.0.0" }, "engines": { "node": ">=8.0.0", @@ -52,14 +53,14 @@ ], "scripts": { "lint": "eslint --quiet '**/*.js'", - "stylelint": "stylelint --quiet 'theme/**/*.css' 'docs/**/*.css'" + "stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css' 'docs/**/*.css'" }, "lint-staged": { "**/*.js": [ "eslint --quiet" ], "**/*.css": [ - "stylelint --quiet" + "stylelint --quiet --allow-empty-input" ] }, "eslintIgnore": [ From 60dcf8432e8df86bce2bbaa4fdcee45a9991c57f Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 11:00:46 +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 0000000..4b35039 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,6 @@ +{ + "extends": "stylelint-config-recommended", + "rules": { + "at-rule-no-unknown": null + } +} From b918c7040ebe2ff07c7ccb702cd1f8de2566200c Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 12:54:04 +0100 Subject: [PATCH 4/4] Used the external stylelint-config-ckeditor5 package for stylelint configuration. --- .stylelintrc | 5 +---- package.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 4b35039..1d86a41 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,6 +1,3 @@ { - "extends": "stylelint-config-recommended", - "rules": { - "at-rule-no-unknown": null - } + "extends": "stylelint-config-ckeditor5" } diff --git a/package.json b/package.json index 12a3ea3..1cccfc8 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "husky": "^1.3.1", "lint-staged": "^7.0.0", "stylelint": "^11.1.1", - "stylelint-config-recommended": "^3.0.0" + "stylelint-config-ckeditor5": "^1.0.0" }, "engines": { "node": ">=8.0.0",