Skip to content

Commit

Permalink
fix: extend scss lint to webpack dev and prod env
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpicado committed Jul 22, 2017
1 parent d72ee76 commit e84ff19
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -74,10 +74,10 @@
"eslint-plugin-import": "2.6.1",
"eslint-plugin-react": "7.1.0",
"extract-text-webpack-plugin": "3.0.0",
"github-markdown-css": "2.8.0",
"file-loader": "0.11.2",
"flow-runtime": "0.13.0",
"friendly-errors-webpack-plugin": "1.6.1",
"github-markdown-css": "2.8.0",
"html-webpack-plugin": "2.29.0",
"in-publish": "2.0.0",
"localstorage-memory": "1.0.2",
Expand All @@ -99,6 +99,7 @@
"style-loader": "0.18.2",
"stylelint": "7.13.0",
"stylelint-config-standard": "16.0.0",
"stylelint-webpack-plugin": "0.8.0",
"url-loader": "0.5.8",
"webpack": "3.2.0",
"webpack-dev-server": "2.5.0",
Expand All @@ -124,7 +125,7 @@
"test-only": "mocha ./test/functional ./test/unit",
"lint": "eslint .",
"lint:css": "stylelint 'src/**/*.scss' --syntax scss",
"pre:webpack": "npm run lint:css && npm run lint",
"pre:webpack": "npm run lint",
"build:webui": "npm run pre:webpack && rimraf static/* && webpack --config tools/webpack.prod.config.babel.js --debug",
"dev:webui": "babel-node tools/dev.server.js",
"prepublish": "in-publish && npm run build:webui || not-in-publish",
Expand Down
2 changes: 0 additions & 2 deletions src/webui/src/components/PackageDetail/packageDetail.scss
@@ -1,7 +1,6 @@
@import '../../styles/variable';

.pkgDetail {

.title {
font-size: 28px;
color: $text-black;
Expand All @@ -10,5 +9,4 @@
.readme {
margin-bottom: 5em;
}

}
10 changes: 10 additions & 0 deletions tools/webpack.config.js
@@ -1,4 +1,5 @@
const env = require('../src/config/env');
const StyleLintPlugin = require('stylelint-webpack-plugin');

const isDev = process.env.NODE_ENV === 'development';

Expand All @@ -14,6 +15,15 @@ module.exports = {
extensions: ['.js', '.jsx'],
},

plugins: [
new StyleLintPlugin({
files: ['src/**/*.scss'],
failOnError: false,
emitErrors: true,
syntax: 'scss',
}),
],

module: {
rules: [
/* Pre loader */
Expand Down
7 changes: 7 additions & 0 deletions tools/webpack.dev.config.babel.js
Expand Up @@ -3,6 +3,7 @@ import HTMLWebpackPlugin from 'html-webpack-plugin';
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
import baseConfig from './webpack.config';
import env from '../src/config/env';
import StyleLintPlugin from 'stylelint-webpack-plugin';

export default {
...baseConfig,
Expand Down Expand Up @@ -36,5 +37,11 @@ export default {
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new FriendlyErrorsPlugin(),
new StyleLintPlugin({
files: ['src/**/*.scss'],
failOnError: false,
emitErrors: false,
syntax: 'scss',
}),
],
};
16 changes: 15 additions & 1 deletion yarn.lock
Expand Up @@ -5107,6 +5107,10 @@ querystringify@~1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz#6286242112c5b712fa654e526652bf6a13ff05cb"

ramda@^0.24.1:
version "0.24.1"
resolved "https://registry.npmjs.org/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857"

randomatic@^1.1.3:
version "1.1.7"
resolved "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c"
Expand Down Expand Up @@ -6018,7 +6022,17 @@ stylelint-config-standard@16.0.0:
version "16.0.0"
resolved "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-16.0.0.tgz#bb7387bff1d7dd7186a52b3ebf885b2405d691bf"

stylelint@7.13.0:
stylelint-webpack-plugin@0.8.0:
version "0.8.0"
resolved "https://registry.npmjs.org/stylelint-webpack-plugin/-/stylelint-webpack-plugin-0.8.0.tgz#948aec50e0d3b512374cce067cbbde3661c7d410"
dependencies:
arrify "^1.0.1"
minimatch "^3.0.3"
object-assign "^4.1.0"
ramda "^0.24.1"
stylelint "^7.7.0"

stylelint@7.13.0, stylelint@^7.7.0:
version "7.13.0"
resolved "https://registry.npmjs.org/stylelint/-/stylelint-7.13.0.tgz#111f97b6da72e775c80800d6bb6f5f869997785d"
dependencies:
Expand Down

0 comments on commit e84ff19

Please sign in to comment.