Skip to content
This repository has been archived by the owner on Dec 30, 2018. It is now read-only.

Commit

Permalink
feat: from eslint to standard
Browse files Browse the repository at this point in the history
  • Loading branch information
vesparny committed Jan 7, 2016
1 parent 84a76f9 commit 91685f0
Show file tree
Hide file tree
Showing 21 changed files with 173 additions and 219 deletions.
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

43 changes: 0 additions & 43 deletions .jsbeautifyrc

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="3.2.1"></a>
## [3.2.1](https://github.com/vesparny/react-kickstart/compare/3.2.0...v3.2.1) (2016-01-07)


### Bug Fixes

* put fastclick back ([84a76f9](https://github.com/vesparny/react-kickstart/commit/84a76f9))



<a name="3.2.0"></a>
# [3.2.0](https://github.com/vesparny/react-kickstart/compare/3.1.1...v3.2.0) (2016-01-07)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Please do the following:

* Follow the existing styles (we have an `.editorconfig` file and we are using `eslint`).
* Follow the existing styles (we have an `.editorconfig` file and we are using [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)).
* Add tests if needed.
* Document your changes in the README (try to follow the convention you see in the rest of the file).
* Use the command `npm run c` when ready to commit your changes. This will help you to provide proper commit messages that will be taken into account while generating the changelog.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Dependency status](https://david-dm.org/vesparny/react-kickstart/status.svg)](https://david-dm.org/vesparny/react-kickstart "Dependency status")
[![Dev dependency status](https://david-dm.org/vesparny/react-kickstart/dev-status.svg)](https://david-dm.org/vesparny/react-kickstart#info=devDependencies "Dev dependency status")

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

## Minimal
It contains just the necessary to get started with React, I decided not to include flux libraries or other complicated stuff like server-rendering in here.
Expand All @@ -22,7 +23,6 @@ See a [working demo](http://vesparny.github.io/react-kickstart/)
* [babeljs](https://babeljs.io/)
* unit tests ([tape](https://github.com/substack/tape/) + [sinon](http://sinonjs.org/)) examples with both [shallow-rendering](https://facebook.github.io/react/docs/test-utils.html#shallow-rendering) and [jsdom](https://github.com/tmpvar/jsdom)
* code coverage with [isparta](https://github.com/douglasduteil/isparta)
* eslint configuration
* development and production build

## Usage
Expand Down Expand Up @@ -57,7 +57,7 @@ npm run build
npm run build:start
```

**Run eslint**
**Run code style check**
```
npm run lint
```
Expand Down
25 changes: 12 additions & 13 deletions devServer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.config.dev');
var express = require('express')
var webpack = require('webpack')
var config = require('./webpack.config.dev')

var app = express();
var app = express()

var compiler = webpack(config);
var compiler = webpack(config)

app.use(require('webpack-dev-middleware')(compiler, {
publicPath: config.output.publicPath,
Expand All @@ -18,15 +17,15 @@ app.use(require('webpack-dev-middleware')(compiler, {
chunkModules: false,
modules: false
}
}));
}))

app.use(require('webpack-hot-middleware')(compiler));
app.use(require('webpack-hot-middleware')(compiler))

app.use(express.static(__dirname + '/dist'));
app.use(express.static(__dirname + '/dist'))

app.listen(config._hotPort, 'localhost', function(err) {
app.listen(config._hotPort, 'localhost', function (err) {
if (err) {
console.log(err);
console.log(err)
}
console.info("==> 🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.", config._hotPort, config._hotPort);
});
console.info('==> 🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.', config._hotPort, config._hotPort)
})
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-kickstart",
"version": "3.2.0",
"version": "3.2.1",
"description": "just another react + webpack boilerplate.",
"private": true,
"author": "Alessandro Arnodo <alessandro@arnodo.net> (https://alessandro.arnodo.net)",
Expand All @@ -21,10 +21,15 @@
"build:start": "better-npm-run build:start",
"build": "rimraf dist && better-npm-run build",
"release": "npm run lint && npm run test && npm run build && rimraf gh-pages && mkdir gh-pages && cd gh-pages && cp -r ../dist/* . && git init . && git remote add origin git@github.com:vesparny/react-kickstart.git && git checkout -b gh-pages && git add . && git commit -m 'publishing' && git push origin gh-pages -f",
"lint": "eslint .",
"lint": "standard",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -w",
"c": "git-cz"
},
"standard": {
"globals": [
"__DEV__"
]
},
"betterScripts": {
"build": {
"command": "webpack --config webpack.config.prod.js --progress --profile --colors",
Expand Down Expand Up @@ -63,7 +68,6 @@
"autoprefixer": "^6.2.3",
"babel-cli": "^6.4.0",
"babel-core": "^6.4.0",
"babel-eslint": "^5.0.0-beta6",
"babel-loader": "^6.2.1",
"babel-plugin-react-transform": "^2.0.0",
"babel-polyfill": "^6.3.14",
Expand All @@ -74,9 +78,6 @@
"commitizen": "^2.4.6",
"conventional-changelog": "^0.5.3",
"css-loader": "^0.23.1",
"eslint": "^1.10.3",
"eslint-config-vesparny": "^1.2.1",
"eslint-plugin-react": "^3.14.0",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"glob": "^6.0.1",
Expand All @@ -94,6 +95,7 @@
"redbox-react": "^1.2.0",
"rimraf": "^2.5.0",
"sinon": "^1.17.2",
"standard": "^5.4.1",
"stats-webpack-plugin": "^0.2.2",
"style-loader": "^0.13.0",
"tap-spec": "^4.1.1",
Expand Down
22 changes: 11 additions & 11 deletions prodServer.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
var path = require('path');
var express = require('express');
var app = express();
var path = require('path')
var express = require('express')
var app = express()

app.use(express.static(__dirname + '/dist'));
app.use(express.static(__dirname + '/dist'))

app.get('*', function(req, res) {
res.sendFile(path.join(__dirname, 'dist/index.html'));
});
app.get('*', function (req, res) {
res.sendFile(path.join(__dirname, 'dist/index.html'))
})

app.listen(8000, 'localhost', function(err) {
app.listen(8000, 'localhost', function (err) {
if (err) {
console.log(err);
console.log(err)
}
console.info("==> 🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.", 8000, 8000);
});
console.info('==> 🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.', 8000, 8000)
})
8 changes: 4 additions & 4 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, {PropTypes} from 'react';
import React, {PropTypes} from 'react'

const App = ({children}) =>
<div>
{children}
</div>;
</div>

App.propTypes = typeof __DEV__ && {
children: PropTypes.object.isRequired
};
}

export default App;
export default App
18 changes: 9 additions & 9 deletions src/components/Counter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {PropTypes} from 'react';
import style from './Counter.css';
import React, {PropTypes} from 'react'
import style from './Counter.css'

const Counter = React.createClass({

Expand All @@ -8,14 +8,14 @@ const Counter = React.createClass({
onIncrement: PropTypes.func.isRequired
},

increment() {
increment () {
// maybe I'd like to do something here
// for the moment I just call the callback passed from the parent
return this.props.onIncrement();
return this.props.onIncrement()
},

render() {
const {count} = this.props;
render () {
const {count} = this.props

return (
<div className={style.counter}>
Expand All @@ -25,8 +25,8 @@ const Counter = React.createClass({
Increment
</button>
</div>
);
)
}
});
})

export default Counter;
export default Counter
36 changes: 18 additions & 18 deletions src/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import React from 'react';
import Counter from './Counter';
import React from 'react'
import Counter from './Counter'
import {
version,
dependencies,
homepage,
devDependencies
} from '../../package.json';
import style from './Home.css';
} from '../../package.json'
import style from './Home.css'

const Home = React.createClass({

getInitialState() {
getInitialState () {
return {
counter: 0
};
}
},

getVersion() {
return version;
getVersion () {
return version
},

increment() {
increment () {
this.setState({
counter: this.state.counter += 1
});
})
},

render() {
render () {
const deps = Object.keys(dependencies)
.map((dep, i) => <li key={i}><b>{dep}</b> : {dependencies[dep]}</li>);
.map((dep, i) => <li key={i}><b>{dep}</b> : {dependencies[dep]}</li>)
const devDeps = Object.keys(devDependencies)
.map((dep, i) => <li key={i + 10}><b>{dep}</b> : {devDependencies[dep]}</li>);
.map((dep, i) => <li key={i + 10}><b>{dep}</b> : {devDependencies[dep]}</li>)

return (
<section className={style.section}>
<div>
<h1>
<a href={homepage}>&#9883; react-kickstart</a>
<a href={homepage}>&#9883 react-kickstart</a>
</h1>
<h2 className={style.h2} >version {version}</h2>
<a href={homepage}>GitHub</a>
<br />
<a href="https://twitter.com/vesparny">@vesparny</a>
<a href='https://twitter.com/vesparny'>@vesparny</a>
<Counter
count={this.state.counter}
onIncrement={this.increment}
Expand All @@ -57,8 +57,8 @@ const Home = React.createClass({
</div>
</div>
</section>
);
)
}
});
})

export default Home;
export default Home
22 changes: 11 additions & 11 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import 'babel-polyfill';
import 'normalize.css';
import './globals.css';
import React from 'react';
import ReactDOM from 'react-dom';
import 'babel-polyfill'
import 'normalize.css'
import './globals.css'
import React from 'react'
import ReactDOM from 'react-dom'
// only for GitHub pages
// do prefer import { browserHistory } from 'react-router'
import Router, {hashHistory} from 'react-router';
import attachFastClick from 'fastclick';
import routes from './routes';
import Router, {hashHistory} from 'react-router'
import attachFastClick from 'fastclick'
import routes from './routes'

// Remove 300ms tap delay on mobile devices
attachFastClick.attach(document.body);
attachFastClick.attach(document.body)

// Expose globally
window.React = React;
window.React = React

ReactDOM.render(
<Router
children={routes}
history={hashHistory} />,
document.getElementById('root'));
document.getElementById('root'))
Loading

0 comments on commit 91685f0

Please sign in to comment.