Skip to content

Commit

Permalink
Merge pull request #14 from Graham42/update_lint_config
Browse files Browse the repository at this point in the history
More prettier things.
  • Loading branch information
philippotto authored Oct 30, 2017
2 parents 5baef01 + 33f16c5 commit 5ad0be1
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 43 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
"no-plusplus": 0
},
"plugins": [
"prettier",
"react"
],
"extends": ["plugin:react/recommended"]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
node_modules
bower_components
dist/
npm-debug.log
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
bower_components/
dist/
package-lock.json
# npm install will reformat package.json which can conflict with prettier
package.json
9 changes: 3 additions & 6 deletions app/styles/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ footer {
.form-control:focus {
border-color: #e0e0e0;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 8px rgba(224, 224, 224, 0.6);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(224, 224, 224, 0.6);
}

.btn,
Expand Down Expand Up @@ -231,8 +229,7 @@ li.modeNavItem.active a {
}

.transition {
transition: max-height 0.4s ease, height 0.4s ease, margin 0.4s ease,
opacity 0.75s ease;
transition: max-height 0.4s ease, height 0.4s ease, margin 0.4s ease, opacity 0.75s ease;
opacity: 1;
overflow: hidden;
}
Expand Down
8 changes: 4 additions & 4 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ module.exports = function(config) {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
// add webpack as preprocessor
"scripts/spec/*.js": ["webpack", "sourcemap"]
"scripts/spec/*.js": ["webpack", "sourcemap"],
},

webpack: {
devtool: "inline-source-map",
module: webpackConfig.module
module: webpackConfig.module,
},

webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
noInfo: true
noInfo: true,
},

// test results reporter to use
Expand All @@ -58,6 +58,6 @@ module.exports = function(config) {

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
singleRun: false,
});
};
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"babel-preset-stage-0": "^6.3.13",
"css-loader": "^0.23.1",
"eslint": "^3.14.1",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-react": "^7.4.0",
"font-awesome-webpack": "0.0.4",
"jasmine-core": "^2.4.1",
Expand All @@ -66,10 +65,9 @@
},
"scripts": {
"start": "node server.js",
"build":
"BABEL_ENV=production ./node_modules/.bin/webpack --config webpack.config.production.js && node pre-render.js",
"lint": "./node_modules/.bin/eslint .",
"test": "node_modules/karma/bin/karma start --single-run --browsers PhantomJS",
"pretty": "node_modules/.bin/prettier --write --config .prettierrc \"app/scripts/**/*.js\""
"build": "BABEL_ENV=production webpack --config webpack.config.production.js && node pre-render.js",
"lint": "eslint . && prettier --list-different '**/*.{js,jsx,ts,css,less,scss,json}'",
"test": "karma start --single-run --browsers PhantomJS",
"pretty": "prettier --write '**/*.{js,jsx,ts,css,less,scss,json}'"
}
}
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
contentBase: "./app/",
hot: true,
historyApiFallback: true
historyApiFallback: true,
}).listen(port, "localhost", function(err) {
if (err) {
console.log(err);
Expand Down
26 changes: 15 additions & 11 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ var port = 1234;

module.exports = {
port: port,
entry: ["webpack-dev-server/client?http://localhost:" + port, "webpack/hot/dev-server", "./app/scripts/index.js"],
entry: [
"webpack-dev-server/client?http://localhost:" + port,
"webpack/hot/dev-server",
"./app/scripts/index.js",
],
output: {
path: path.resolve(__dirname, "build"),
filename: "bundle.js",
publicPath: "/"
publicPath: "/",
},
resolve: {
extensions: ["", ".js"]
extensions: ["", ".js"],
},
resolveLoader: {
root: path.join(__dirname, "node_modules")
root: path.join(__dirname, "node_modules"),
},
devtool: "inline-source-map",
plugins: [new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin()],
Expand All @@ -66,21 +70,21 @@ module.exports = {
{
test: /\.jsx?$/,
loaders: ["babel"],
include: path.join(__dirname, "app", "scripts")
include: path.join(__dirname, "app", "scripts"),
},
{
test: /\.less$/,
loader: "style!css!less"
loader: "style!css!less",
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=10000&minetype=application/font-woff"
loader: "url-loader?limit=10000&minetype=application/font-woff",
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader"
loader: "file-loader",
},
{ test: /\.html/, loader: "file?name=[name].[ext]" }
]
}
{ test: /\.html/, loader: "file?name=[name].[ext]" },
],
},
};
28 changes: 14 additions & 14 deletions webpack.config.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,45 +47,45 @@ module.exports = {
output: {
path: path.join(__dirname, "dist/Piano-Trainer"),
filename: "bundle.js",
publicPath: "./"
publicPath: "./",
},
resolve: {
extensions: ["", ".js"]
extensions: ["", ".js"],
},
resolveLoader: {
root: path.join(__dirname, "node_modules")
root: path.join(__dirname, "node_modules"),
},
devtool: "source-map",
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
NODE_ENV: JSON.stringify("production"),
},
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
warnings: false,
},
}),
],
module: {
loaders: [
{
test: /\.jsx?$/,
loaders: ["babel"],
include: path.join(__dirname, "app", "scripts")
include: path.join(__dirname, "app", "scripts"),
},
{
test: /\.less$/,
loader: "style!css!less"
loader: "style!css!less",
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=10000&minetype=application/font-woff"
loader: "url-loader?limit=10000&minetype=application/font-woff",
},
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
{ test: /\.html/, loader: "file?name=[name].[ext]" }
]
}
{ test: /\.html/, loader: "file?name=[name].[ext]" },
],
},
};

0 comments on commit 5ad0be1

Please sign in to comment.