From ed968bfc1598a53f3919118e9232594ae33285d9 Mon Sep 17 00:00:00 2001 From: Mahboob Ur Rasheed Date: Sun, 24 Jul 2016 11:49:24 +0500 Subject: [PATCH] feature/scss linting (#403) Lint SCSS/CSS files --- package.json | 12 +++++---- src/components/Ayah/style.scss | 2 +- src/styles/fonts/_fonts.scss | 1 - src/styles/main.scss | 34 -------------------------- src/styles/partials/_navbar-brand.scss | 1 - webpack/.stylelintrc | 7 ++++++ 6 files changed, 15 insertions(+), 42 deletions(-) create mode 100644 webpack/.stylelintrc diff --git a/package.json b/package.json index 46366c901..76cfa11be 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,12 @@ "scripts": { "test": "./node_modules/karma/bin/karma start", "test:ci:unit": "./node_modules/karma/bin/karma start --browsers PhantomJS --single-run; npm run test:ci:lint", - "test:ci:functional": "node ./nightwatch.js -c ./nightwatch.json -e production", - "test:ci:lint": "eslint ./src/**/*.js", "test:dev:unit": "./node_modules/karma/bin/karma start", + "test:ci:functional": "node ./nightwatch.js -c ./nightwatch.json -e production", "test:dev:functional": "node ./nightwatch.js -c ./nightwatch.json", + "test:ci:lint": "eslint ./src/**/*.js", "test:dev:lint": "eslint ./src/scripts/**/*.js", + "test:stylelint": "stylelint './src/**/*.scss' --config webpack/.stylelintrc", "dev": "node webpack/dev-server.js & PORT=8000 node start.js", "start": "NODE_PATH=\"./src\" node ./start", "build": "node ./node_modules/webpack/bin/webpack.js --config webpack/prod.config.js", @@ -139,6 +140,7 @@ "path": "^0.11.14", "phantomjs-polyfill": "0.0.1", "piping": "^0.3.0", + "pre-commit": "^1.1.3", "react-addons-test-utils": "^0.14.7", "react-transform-catch-errors": "^1.0.0", "react-transform-hmr": "^1.0.1", @@ -149,11 +151,11 @@ "selenium-server": "^2.48.2", "sinon": "^1.15.3", "sinon-chai": "^2.8.0", + "stylelint-webpack-plugin": "^0.2.0", "webpack-dev-server": "^1.6.5" }, "pre-commit": [ - "lint", - "validate", - "test" + "test:dev:lint", + "test:stylelint" ] } diff --git a/src/components/Ayah/style.scss b/src/components/Ayah/style.scss index f76320937..11c5b7089 100644 --- a/src/components/Ayah/style.scss +++ b/src/components/Ayah/style.scss @@ -91,7 +91,7 @@ b{ float: right; - border-color:: transparent; + border-color: transparent; border-width: 0px 0px 1px 0px; border-style: solid; &.active { diff --git a/src/styles/fonts/_fonts.scss b/src/styles/fonts/_fonts.scss index b00d7cadb..c1ef8d838 100644 --- a/src/styles/fonts/_fonts.scss +++ b/src/styles/fonts/_fonts.scss @@ -1,4 +1,3 @@ -//@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Montserrat); @font-face{ font-family: 'Montserrat'; src: url('./static/fonts/montserrat/Montserrat-Regular.otf'); diff --git a/src/styles/main.scss b/src/styles/main.scss index f83a5e3ff..f52f30248 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -1,6 +1,4 @@ -//@import 'bootstrap'; $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; -//@import '~bootstrap-sass/assets/stylesheets/bootstrap'; @import 'mixins/center'; @import 'components/SurahNav'; @@ -44,38 +42,6 @@ a:hover{ display: none; } } - .right-side{ - padding-top: 190px; - width: 83.33333333%; - float: right; - display: block; - position: relative; - background-color: #fff; - transition: width 0.5s; - min-height: 100vh; - z-index: 9999; - - .navbar-brand{ - display: none; - } - - @media (max-width: $screen-sm-max) { - width: 100%; - padding-top: 150px; - - .navbar-brand{ - display: block; - } - } - - &.active{ - width: 99%; - - .navbar{ - width: 99; // This is almost like `noop` to get the css working - } - } - } } .form-control:focus{ diff --git a/src/styles/partials/_navbar-brand.scss b/src/styles/partials/_navbar-brand.scss index b73100571..33214c595 100644 --- a/src/styles/partials/_navbar-brand.scss +++ b/src/styles/partials/_navbar-brand.scss @@ -18,7 +18,6 @@ } img { display: inline !important; - height: 100%; &.logo{ height: 80%; vertical-align: top; diff --git a/webpack/.stylelintrc b/webpack/.stylelintrc new file mode 100644 index 000000000..78c5d9e14 --- /dev/null +++ b/webpack/.stylelintrc @@ -0,0 +1,7 @@ +{ + "rules": { + "unit-no-unknown": true, + "no-duplicate-selectors": true, + "block-no-empty": true + } +}