Skip to content

Commit

Permalink
added linting for atom
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylanb-dev committed Jan 30, 2016
1 parent 593a666 commit b63a7a3
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 49 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The MIT License (MIT)
Copyright (c) 2015 Mark Fayngersh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
Expand All @@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Expand Down
6 changes: 3 additions & 3 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html>
<head>
<title>Essential React Template</title>
<link rel="stylesheet" href="/style.css" charset="utf-8">
<link rel='stylesheet' href='/style.css' charset='utf-8'>
</head>
<body>
<div id="app"></div>
<div id='app'></div>

<script src="/app.js"></script>
<script src='/app.js'></script>
</body>
</html>
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"devDependencies": {
"autoprefixer": "^6.0.2",
"ava": "^0.11.0",
"babel-eslint": "^4.1.6",
"babel-loader": "^6.2.1",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-preset-es2015": "^6.3.13",
Expand All @@ -39,6 +40,9 @@
"coveralls": "^2.11.2",
"css-loader": "^0.18.0",
"enzyme": "^1.4.0",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^4.0.0",
"eslint-plugin-react": "^3.16.1",
"extract-text-webpack-plugin": "^0.8.2",
"nyc": "^5.3.0",
"postcss-loader": "^0.6.0",
Expand Down
29 changes: 14 additions & 15 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var express = require('express');
var express = require("express");
var app = express();


Expand All @@ -12,26 +12,25 @@ var app = express();
************************************************************/

// Serve application file depending on environment
app.get('/app.js', function(req, res) {
app.get("/app.js", function(req, res) {
if (process.env.PRODUCTION) {
res.sendFile(__dirname + '/build/app.js');
res.sendFile(__dirname + "/build/app.js");
} else {
res.redirect('//localhost:9090/build/app.js');
res.redirect("//localhost:9090/build/app.js");
}
});

// Serve aggregate stylesheet depending on environment
app.get('/style.css', function(req, res) {
app.get("/style.css", function(req, res) {
if (process.env.PRODUCTION) {
res.sendFile(__dirname + '/build/style.css');
res.sendFile(__dirname + "/build/style.css");
} else {
res.redirect('//localhost:9090/build/style.css');
res.redirect("//localhost:9090/build/style.css");
}
});

// Serve index page
app.get('*', function(req, res) {
res.sendFile(__dirname + '/build/index.html');
app.get("*", function(req, res) {
res.sendFile(__dirname + "/build/index.html");
});


Expand All @@ -44,16 +43,16 @@ app.get('*', function(req, res) {
*************************************************************/

if (!process.env.PRODUCTION) {
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.local.config');
var webpack = require("webpack");
var WebpackDevServer = require("webpack-dev-server");
var config = require("./webpack.local.config");

new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
noInfo: true,
historyApiFallback: true
}).listen(9090, 'localhost', function (err, result) {
}).listen(9090, "localhost", function (err, result) {
if (err) {
console.log(err);
}
Expand All @@ -72,5 +71,5 @@ var server = app.listen(port, function () {
var host = server.address().address;
var port = server.address().port;

console.log('Essential React listening at http://%s:%s', host, port);
console.log("Essential React listening at http://%s:%s", host, port);
});
2 changes: 1 addition & 1 deletion src/common/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

body {
margin: 0;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-weight: 300;
background-color: #f1f1f1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
export default class App extends React.Component {
render() {
return (
<div id="container">
<div id='container'>
{this.props.children}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/common/components/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import HomePage from '../../pages/home/page';


export default (
<Route path="/" component={App}>
<Route path='/' component={App}>
<IndexRoute component={LoginPage} />
<Route path="home" component={HomePage} />
<Route path='home' component={HomePage} />
</Route>
);
16 changes: 7 additions & 9 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@
*/

// Polyfill
import "babel-polyfill";
import 'babel-polyfill';

// Libraries
import React from "react";
import ReactDOM from "react-dom";
import { Router } from "react-router";
import createBrowserHistory from 'history/lib/createBrowserHistory'
import React from 'react';
import ReactDOM from 'react-dom';
import { Router } from 'react-router';
import createBrowserHistory from 'history/lib/createBrowserHistory';

// Routes
import Routes from './common/components/Routes';

// Base styling
import "./common/base.css";
import './common/base.css';


// ID of the DOM element to mount app on
const DOM_APP_EL_ID = "app";


const DOM_APP_EL_ID = 'app';

// Render the router
ReactDOM.render((
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import styles from "./style.css";
import React from 'react';
import styles from './style.css';


export default class HomePage extends React.Component {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/login/page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import styles from "./style.css";
import React from 'react';
import styles from './style.css';


export default class LoginPage extends React.Component {
Expand Down
16 changes: 8 additions & 8 deletions webpack.local.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {

// Efficiently evaluate modules with source maps
devtool: "eval",
devtool: 'eval',

// Set entry point to ./src/main and include necessary files for hot load
entry: [
"webpack-dev-server/client?http://localhost:9090",
"webpack/hot/only-dev-server",
"./src/main"
'webpack-dev-server/client?http://localhost:9090',
'webpack/hot/only-dev-server',
'./src/main'
],

// This will not actually create a bundle.js file in ./build. It is used
// by the dev server for dynamic hot loading.
output: {
path: __dirname + "/build/",
filename: "app.js",
publicPath: "http://localhost:9090/build/"
path: __dirname + '/build/',
filename: 'app.js',
publicPath: 'http://localhost:9090/build/'
},

// Necessary plugins for hot load
Expand All @@ -41,7 +41,7 @@ module.exports = {
// Transform source code using Babel and React Hot Loader
module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: ["react-hot", "babel-loader?presets[]=es2015,presets[]=react,presets[]=stage-0,plugins[]=transform-runtime"] },
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: ['react-hot', 'babel-loader?presets[]=es2015,presets[]=react,presets[]=stage-0,plugins[]=transform-runtime'] },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader') }
]
},
Expand Down
8 changes: 4 additions & 4 deletions webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin');
* This is the Webpack configuration file for production.
*/
module.exports = {
entry: "./src/main",
entry: './src/main',

output: {
path: __dirname + "/build/",
filename: "app.js"
path: __dirname + '/build/',
filename: 'app.js'
},

plugins: [
Expand All @@ -18,7 +18,7 @@ module.exports = {

module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel-loader?presets[]=es2015,presets[]=react,presets[]=stage-0,plugins[]=transform-runtime" },
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader?presets[]=es2015,presets[]=react,presets[]=stage-0,plugins[]=transform-runtime' },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader') }
]
},
Expand Down

0 comments on commit b63a7a3

Please sign in to comment.