ソースを参照

Merge pull request #5701 from ckeditor/i/5696

Internal: Enabled style linter in the project. Closes #5696.
Aleksander Nowodzinski 6 年 前
コミット
600e556987
5 ファイル変更452 行追加438 行削除
  1. 3 0
      .stylelintrc
  2. 40 40
      docs/assets/snippet-styles.css
  3. 6 0
      package.json
  4. 5 0
      scripts/switch-to-dev-dev.sh
  5. 398 398
      yarn.lock

+ 3 - 0
.stylelintrc

@@ -0,0 +1,3 @@
+{
+	"extends": "stylelint-config-ckeditor5"
+}

+ 40 - 40
docs/assets/snippet-styles.css

@@ -69,6 +69,46 @@ It breaks CKEditor 5 (see how <p><code>[]</code></p> looks). */
 	margin-left: 0;
 }
 
+.demo-row {
+	width: 100%;
+	display: -ms-flexbox;
+	display: flex;
+}
+
+.demo-row__half {
+	width: 50%;
+}
+
+.demo-row__half:first-of-type {
+	padding-right: .5rem;
+}
+
+.demo-row__half:last-of-type {
+	padding-left: .5rem;
+}
+
+.demo-row__third {
+	width: 33.3333%;
+}
+
+.demo-row__third > div {
+	padding: 2.5rem;
+	border: 1px solid rgba(0, 0, 0, 0.15);
+}
+
+.demo-row__third:nth-of-type(2) {
+	padding-left: 1rem;
+	padding-right: 1rem;
+}
+
+.demo-row h3 {
+	margin: 0;
+}
+
+.demo-row p {
+	margin-bottom: 0;
+}
+
 /* examples/builds/inline-editor.html */
 .live-snippet .image-style-left, .live-snippet .image-style-right {
 	float: left;
@@ -162,43 +202,3 @@ https://github.com/ckeditor/ckeditor5/issues/1545 */
 .live-snippet .document-editor {
 	margin: 1.5em 0;
 }
-
-.demo-row {
-	width: 100%;
-	display: -ms-flexbox;
-	display: flex;
-}
-
-.demo-row__half {
-	width: 50%;
-}
-
-.demo-row__half:first-of-type {
-	padding-right: .5rem;
-}
-
-.demo-row__half:last-of-type {
-	padding-left: .5rem;
-}
-
-.demo-row__third {
-	width: 33.3333%;
-}
-
-.demo-row__third > div {
-	padding: 2.5rem;
-	border: 1px solid rgba(0, 0, 0, 0.15);
-}
-
-.demo-row__third:nth-of-type(2) {
-	padding-left: 1rem;
-	padding-right: 1rem;
-}
-
-.demo-row h3 {
-	margin: 0;
-}
-
-.demo-row p {
-	margin-bottom: 0;
-}

+ 6 - 0
package.json

@@ -101,6 +101,8 @@
     "react": "^16.9.0",
     "react-dom": "^16.9.0",
     "style-loader": "^1.0.0",
+    "stylelint": "^11.1.1",
+    "stylelint-config-ckeditor5": "^1.0.0",
     "svgo": "^1.1.0",
     "uglifyjs-webpack-plugin": "^1.3.0",
     "umberto": "^1.2.0",
@@ -120,6 +122,7 @@
   },
   "scripts": {
     "lint": "eslint --quiet '**/*.js'",
+    "stylelint": "stylelint --quiet --allow-empty-input 'packages/**/*.css' 'docs/**/*.css'",
     "test": "node --max_old_space_size=4096 node_modules/@ckeditor/ckeditor5-dev-tests/bin/test.js",
     "manual": "node --max_old_space_size=4096 node_modules/@ckeditor/ckeditor5-dev-tests/bin/test-manual.js",
     "bootstrap": "mrgit sync && yarn install",
@@ -144,6 +147,9 @@
   "lint-staged": {
     "**/*.js": [
       "eslint --quiet"
+    ],
+    "**/*.css": [
+      "stylelint --quiet --allow-empty-input"
     ]
   },
   "eslintIgnore": [

+ 5 - 0
scripts/switch-to-dev-dev.sh

@@ -38,6 +38,11 @@ echo "Linking eslint-config-ckeditor5..."
 rm -rf node_modules/eslint-config-ckeditor5
 ln -s ../../ckeditor5-dev/packages/eslint-config-ckeditor5 node_modules/
 
+echo "Linking stylelint-config-ckeditor5..."
+
+rm -rf node_modules/stylelint-config-ckeditor5
+ln -s ../../ckeditor5-dev/packages/stylelint-config-ckeditor5 node_modules/
+
 echo "Linking jsdoc-plugins..."
 
 rm -rf node_modules/@ckeditor/jsdoc-plugins

ファイルの差分が大きいため隠しています
+ 398 - 398
yarn.lock


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません