Skip to content

Commit 14757f5

Browse files
committed
run prettier on everything
1 parent b3ba1ca commit 14757f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1801
-1515
lines changed

.babelrc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
"env": {
44
"development": {
55
"plugins": [
6-
["react-transform", {
7-
"transforms": [{
8-
"transform": "livereactload/babel-transform",
9-
"imports": ["react"]
10-
}]
11-
}]
6+
[
7+
"react-transform",
8+
{
9+
"transforms": [
10+
{
11+
"transform": "livereactload/babel-transform",
12+
"imports": ["react"]
13+
}
14+
]
15+
}
16+
]
1217
]
1318
}
1419
}

.eslintrc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"parserOptions": {
2+
"parserOptions": {
33
"ecmaVersion": 6,
44
"ecmaFeatures": {
55
"jsx": true
@@ -12,17 +12,18 @@
1212
"node": true,
1313
"mocha": true
1414
},
15-
"plugins": [
16-
"react"
17-
],
18-
rules: {
15+
"plugins": ["react"],
16+
"rules": {
1917
"jsx-quotes": ["error", "prefer-double"],
2018
"react/jsx-uses-react": 2,
2119
"react/jsx-uses-vars": 2,
22-
"no-console": ["error", { allow: ["warn", "error"] }],
23-
"no-unused-vars": ["error", {
24-
"vars": "all",
25-
"args": "none"
26-
}]
20+
"no-console": ["error", { "allow": ["warn", "error"] }],
21+
"no-unused-vars": [
22+
"error",
23+
{
24+
"vars": "all",
25+
"args": "none"
26+
}
27+
]
2728
}
2829
}

.prettierrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
trailingComma: 'all',
3+
singleQuote: true,
4+
};

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: node_js
22
node_js:
3-
- "8"
3+
- '8'
44
env:
55
- CXX=g++-4.8
66
addons:
7-
postgresql: "9.3"
7+
postgresql: '9.3'
88
apt:
99
sources:
1010
- ubuntu-toolchain-r-test

README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
11
[![Build Status](https://travis-ci.org/twinlabs/forum.svg?branch=master)](https://travis-ci.org/twinlabs/forum)
22

3-
Installation:
4-
=============
3+
# Installation:
4+
55
`npm install`
66

7-
Persistent Tests:
8-
=================
7+
# Persistent Tests:
8+
99
`npm run test:watch`
1010

11-
Run App Locally:
12-
================
11+
# Run App Locally:
12+
1313
`npm run start:dev`
1414

15-
Debug App:
16-
==========
15+
# Debug App:
16+
1717
`npm run start:debug`
1818

19-
Run Test Suite:
20-
===============
19+
# Run Test Suite:
20+
2121
`npm test`
2222

23-
Run Test Suite in Debug Mode:
24-
=============================
23+
# Run Test Suite in Debug Mode:
24+
2525
`npm run test:debug`
2626

27-
Database
28-
========
27+
# Database
2928

3029
```
3130
psql --command="create database forum;" && psql --echo-all --dbname=forum --file=tables.sql
3231
```
3332

34-
Add /build Directory
35-
====================
33+
# Add /build Directory
34+
3635
From installation directory root, `mkdir build`. This directory is needed so the app can write client-side bundles to it.
3736

38-
Register a User
39-
===============
37+
# Register a User
38+
4039
After installation, point your browser at `[root installation folder]/signup`.
4140

4241
Choose the file `duck.jpg` from your `/test/fixtures` as your authentication token.
4342

4443
After registering, login using the user/pass you signed up with.
4544

46-
Hot Reload
47-
==========
45+
# Hot Reload
46+
4847
`npm run start:dev` does 'hot reloading' by default. This is subject to change.
4948

50-
Environment Variables
51-
=====================
49+
# Environment Variables
50+
5251
`FORUM_STORAGE_ADAPTER=S3` - change this and provide another module to use your chosen storage back-end. For documentation on the default `S3` adapter, see [that module's documentation](https://www.npmjs.com/package/f.orum-storage-s3).

app.js

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,40 @@ var cssnext = require('postcss-cssnext');
1818
rootRequire('config/environments')(app);
1919
app.set('io', require('socket.io').listen(httpServer));
2020

21-
var conString = process.env.FORUM_DATABASE_URL || "postgres://postgres@localhost/forum";
21+
var conString =
22+
process.env.FORUM_DATABASE_URL || 'postgres://postgres@localhost/forum';
2223

2324
var Sequelize = require('sequelize');
2425
var sequelize = new Sequelize(conString);
2526

2627
app.use(compression());
2728
app.use(cookieParser());
28-
app.use(session({
29-
store: new pgSession({
30-
pg: pg,
31-
conString: conString,
32-
tableName: 'session'
29+
app.use(
30+
session({
31+
store: new pgSession({
32+
pg: pg,
33+
conString: conString,
34+
tableName: 'session',
35+
}),
36+
secret: app.get('sessionSecret') || 'w!** *1*h',
37+
cookie: { maxAge: 365 * 24 * 60 * 60 * 1000 }, // 1 year
38+
resave: false,
39+
saveUninitialized: false,
3340
}),
34-
secret: app.get('sessionSecret') || 'w!** *1*h',
35-
cookie: { maxAge: 365 * 24 * 60 * 60 * 1000 }, // 1 year
36-
resave: false,
37-
saveUninitialized: false
38-
}));
41+
);
3942
rootRequire('lib/authentication');
4043
app.use(passport.initialize());
4144
app.use(passport.session());
4245

4346
app.use(bodyParser.json());
44-
app.use(bodyParser.urlencoded({extended: true}));
47+
app.use(bodyParser.urlencoded({ extended: true }));
4548
app.use(multer());
4649

4750
rootRequire('config/routes')(app, passport);
4851
require('./config/socketRoutes')(app);
4952

5053
var clientConstants = {
51-
socketAddress: ''
54+
socketAddress: '',
5255
};
5356

5457
app.locals.clientConstants = JSON.stringify(clientConstants);
@@ -58,43 +61,44 @@ app.engine('html', require('ejs').renderFile);
5861
app.set('views', process.cwd() + '/templates');
5962
app.set('view engine', 'ejs.html');
6063

61-
app.use(postcssMiddleware({
62-
src: function(request) {
63-
return `${__dirname}/${request.path}`;
64-
},
65-
plugins: [cssnext]
66-
}));
64+
app.use(
65+
postcssMiddleware({
66+
src: function(request) {
67+
return `${__dirname}/${request.path}`;
68+
},
69+
plugins: [cssnext],
70+
}),
71+
);
6772

6873
app.use(express.static(__dirname + '/assets'));
6974
app.use('/stylesheets', express.static(__dirname + '/stylesheets'));
7075
app.use(express.static(__dirname + '/build'));
7176

7277
module.exports = {
73-
server: httpServer.listen(app.get('PORT'), function(){
78+
server: httpServer.listen(app.get('PORT'), function() {
7479
console.log('listening on port ' + app.get('PORT'));
7580
}),
7681
io: app.get('io'),
7782
app: app,
78-
port: app.get('PORT')
83+
port: app.get('PORT'),
7984
};
8085

8186
var rest = require('epilogue');
8287

8388
rest.initialize({
8489
app: app,
85-
sequelize: sequelize
90+
sequelize: sequelize,
8691
});
8792

8893
var checkAuth = function(req, res, context) {
8994
if (req.session.user.id) {
9095
context.continue();
9196
} else {
92-
res.json(403, { error: "Not logged in" });
97+
res.json(403, { error: 'Not logged in' });
9398
context.stop();
9499
}
95100
};
96101

97102
rootRequire('controllers/UserApi')(rest, checkAuth);
98103
rootRequire('controllers/TopicApi')(rest, checkAuth);
99104
rootRequire('controllers/PostApi')(rest, checkAuth);
100-

app/components/ConnectionBar.jsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@ var ConnectionBar = createReactClass({
88
render: function() {
99
return (
1010
<div className="connectionBar">
11-
<div style={{marginRight: '0.5em'}}>Connected:</div>
12-
{
13-
Object.keys(this.props.userList).map(function(userName, index) {
14-
return (
15-
<div
16-
key={index}
17-
className="connectionBar-name activity-users-user"
18-
>
19-
{userName}
20-
</div>
21-
);
22-
})
23-
}
11+
<div style={{ marginRight: '0.5em' }}>Connected:</div>
12+
{Object.keys(this.props.userList).map(function(userName, index) {
13+
return (
14+
<div key={index} className="connectionBar-name activity-users-user">
15+
{userName}
16+
</div>
17+
);
18+
})}
2419
</div>
2520
);
2621
},

app/components/ControlBar.jsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ var ControlBar = createReactClass({
77

88
getInitialState: function() {
99
return {
10-
lastTapped: +new Date()
11-
}
10+
lastTapped: +new Date(),
11+
};
1212
},
1313

1414
detectDoubleTap: function(event) {
15-
const delay = (+new Date()) - this.state.lastTapped;
15+
const delay = +new Date() - this.state.lastTapped;
1616

1717
if (delay < 300) {
18-
this.props.handleRootRefresh(event)
18+
this.props.handleRootRefresh(event);
1919
}
2020

2121
this.setState({
22-
lastTapped: +new Date()
22+
lastTapped: +new Date(),
2323
});
2424
},
2525

@@ -31,13 +31,11 @@ var ControlBar = createReactClass({
3131

3232
render: function() {
3333
return (
34-
<div
35-
className="controlBar"
36-
>
34+
<div className="controlBar">
3735
<a
3836
className="controlBar-control settingsControl"
3937
href="/settings"
40-
onClick={function(event){
38+
onClick={function(event) {
4139
event.preventDefault();
4240
browserHistory.push('/settings');
4341
}}
@@ -64,7 +62,7 @@ var ControlBar = createReactClass({
6462
New
6563
</a>
6664
</div>
67-
)
65+
);
6866
},
6967
});
7068

app/components/Divider.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ module.exports = createReactClass({
55
displayName: 'Divider',
66

77
render: function() {
8-
return (
9-
<div className="v-Divider" />
10-
);
11-
}
8+
return <div className="v-Divider" />;
9+
},
1210
});

app/components/Filter.jsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ var Filter = createReactClass({
1818
<button
1919
type="button"
2020
style={{
21-
'border': 'none',
22-
'backgroundColor':'transparent',
23-
'cursor': 'pointer'
21+
border: 'none',
22+
backgroundColor: 'transparent',
23+
cursor: 'pointer',
2424
}}
2525
onClick={this.props.clearFilter}
2626
>
@@ -31,19 +31,17 @@ var Filter = createReactClass({
3131

3232
render: function() {
3333
return (
34-
<InputGroup
35-
className="v-Atom filter"
36-
>
34+
<InputGroup className="v-Atom filter">
3735
<input
3836
type="text"
3937
placeholder={this.props.placeholder}
4038
ref="topicFilter"
4139
onChange={this.props.onChange}
4240
value={this.props.value}
4341
style={{
44-
'width': '100%',
45-
'border': 'none',
46-
'outline': 'none'
42+
width: '100%',
43+
border: 'none',
44+
outline: 'none',
4745
}}
4846
/>
4947
{this.renderClearFilter()}

0 commit comments

Comments
 (0)