Skip to content

Commit 673e873

Browse files
authored
Merge pull request #1647 from VikramTiwari/feature_standard_linter
Feature standard linter
2 parents 417c4aa + 9987bb0 commit 673e873

File tree

31 files changed

+608
-694
lines changed

31 files changed

+608
-694
lines changed

.jshintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.jshintrc

Lines changed: 0 additions & 92 deletions
This file was deleted.

app.js

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
'use strict';
1+
'use strict'
22

3-
import 'angular/angular-csp.css';
4-
import 'angular-ui-select/select.min.css';
5-
import 'bootstrap/dist/css/bootstrap.min.css';
3+
import 'angular/angular-csp.css'
4+
import 'angular-ui-select/select.min.css'
5+
import 'bootstrap/dist/css/bootstrap.min.css'
66

7-
import jQuery from 'jquery';
8-
import 'angular';
9-
import 'angular-ui-select/select';
10-
import 'angular-mocks';
11-
import 'angular-cookies';
12-
import 'angular-resource';
13-
import 'angular-sanitize';
14-
import 'angular-ui-router';
15-
import 'angular-jwt';
16-
import 'angular-bootstrap/ui-bootstrap-tpls';
7+
import jQuery from 'jquery'
8+
import 'angular'
9+
import 'angular-ui-select/select'
10+
import 'angular-mocks'
11+
import 'angular-cookies'
12+
import 'angular-resource'
13+
import 'angular-sanitize'
14+
import 'angular-ui-router'
15+
import 'angular-jwt'
16+
import 'angular-bootstrap/ui-bootstrap-tpls'
1717

18-
window.$ = jQuery;
18+
window.$ = jQuery
1919

2020
angular.element(document).ready(function () {
21-
//Fixing facebook bug with redirect
22-
if (window.location.hash === '#_=_') window.location.hash = '#!';
23-
24-
//Then init the app
25-
angular.bootstrap(document, ['mean']);
26-
27-
});
28-
29-
function processModules(modules) {
30-
31-
var packageModules = ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.router', 'ui.select', 'ngSanitize'], m, mn;
32-
for (var index in modules) {
33-
m = modules[index];
34-
mn = 'mean.' + m.name;
35-
angular.module(mn, m.angularDependencies || []);
36-
packageModules.push(mn);
37-
}
38-
39-
var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/);
40-
req.keys().map(req);
41-
req = require.context('./node_modules', true, /\/meanio-(.*)\/public\/(?!tests|assets|views)(.*)\.js$/);
42-
req.keys().map(req);
43-
angular.module('mean', packageModules);
21+
// Fixing facebook bug with redirect
22+
if (window.location.hash === '#_=_') window.location.hash = '#!'
23+
24+
// Then init the app
25+
angular.bootstrap(document, ['mean'])
26+
})
27+
28+
function processModules (modules) {
29+
var packageModules = ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.router', 'ui.select', 'ngSanitize']
30+
var m
31+
var mn
32+
for (var index in modules) {
33+
m = modules[index]
34+
mn = 'mean.' + m.name
35+
angular.module(mn, m.angularDependencies || [])
36+
packageModules.push(mn)
37+
}
38+
39+
var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/)
40+
req.keys().map(req)
41+
req = require.context('./node_modules', true, /\/meanio-(.*)\/public\/(?!tests|assets|views)(.*)\.js$/)
42+
req.keys().map(req)
43+
angular.module('mean', packageModules)
4444
}
4545

4646
jQuery.ajax('/_getModules', {
47-
dataType: 'json',
48-
async: false,
49-
success: processModules
50-
});
47+
dataType: 'json',
48+
async: false,
49+
success: processModules
50+
})

config/env/default.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
'use strict';
1+
'use strict'
22

3-
var path = require('path'),
4-
rootPath = path.normalize(__dirname + '/../..');
3+
var path = require('path')
4+
var rootPath = path.join(__dirname, '/../..')
55

66
module.exports = {
77
root: rootPath,
@@ -45,20 +45,20 @@ module.exports = {
4545
public: {
4646
languages: [{
4747
locale: 'en',
48-
direction: 'ltr',
48+
direction: 'ltr'
4949
}, {
5050
locale: 'he',
51-
direction: 'rtl',
51+
direction: 'rtl'
5252
}],
5353
currentLanguage: 'en',
5454
loginPage: '/auth/login',
5555
cssFramework: 'bootstrap'
5656
},
5757
clusterSticky: false,
5858
stickyOptions: {
59-
proxy: false, //activate layer 4 patching
60-
header: 'x-forwarded-for', //provide here your header containing the users ip
61-
num: (process.env.CPU_COUNT || require('os').cpus().length) - 1,
59+
proxy: false, // activate layer 4 patching
60+
header: 'x-forwarded-for', // provide here your header containing the users ip
61+
num: (process.env.CPU_COUNT || require('os').cpus().length) - 1
6262
},
6363
// The session cookie name
6464
sessionName: 'connect.sid',
@@ -67,4 +67,4 @@ module.exports = {
6767
json: {limit: '100kb'},
6868
urlencoded: {limit: '100kb', extended: true}
6969
}
70-
};
70+
}

config/env/development.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
'use strict'
22

33
module.exports = {
44
db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-dev',
@@ -58,6 +58,6 @@ module.exports = {
5858
user: 'EMAIL_ID',
5959
pass: 'PASSWORD'
6060
}
61-
},
61+
},
6262
secret: 'SOME_TOKEN_SECRET'
63-
};
63+
}

config/env/production.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
'use strict'
22

33
module.exports = {
44
db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-prod',
@@ -78,4 +78,4 @@ module.exports = {
7878
}
7979
},
8080
secret: 'SOME_TOKEN_SECRET'
81-
};
81+
}

config/env/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
'use strict'
22

33
module.exports = {
44
db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-test',
@@ -60,4 +60,4 @@ module.exports = {
6060
}
6161
},
6262
secret: 'SOME_TOKEN_SECRET'
63-
};
63+
}

config/express.js

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,68 @@
11
/* globals require */
2-
'use strict';
2+
'use strict'
33

44
/**
55
* Module dependencies.
66
*/
7-
var mean = require('meanio'),
8-
compression = require('compression'),
9-
consolidate = require('consolidate'),
10-
express = require('express'),
11-
helpers = require('view-helpers'),
12-
flash = require('connect-flash'),
13-
modRewrite = require('connect-modrewrite'),
14-
// seo = require('mean-seo'),
15-
config = mean.getConfig(),
16-
bodyParser = require('body-parser'),
17-
helmet = require('helmet');
18-
19-
20-
module.exports = function(app, db) {
21-
22-
app.use(bodyParser.json(config.bodyParser.json));
23-
app.use(bodyParser.urlencoded(config.bodyParser.urlencoded));
24-
25-
app.use(helmet());
26-
27-
app.set('showStackError', true);
7+
var mean = require('meanio')
8+
var compression = require('compression')
9+
var consolidate = require('consolidate')
10+
var express = require('express')
11+
var helpers = require('view-helpers')
12+
var flash = require('connect-flash')
13+
var modRewrite = require('connect-modrewrite')
14+
// seo = require('mean-seo'),
15+
var config = mean.getConfig()
16+
var bodyParser = require('body-parser')
17+
var helmet = require('helmet')
18+
19+
module.exports = function (app, db) {
20+
app.use(bodyParser.json(config.bodyParser.json))
21+
app.use(bodyParser.urlencoded(config.bodyParser.urlencoded))
22+
23+
app.use(helmet())
24+
25+
app.set('showStackError', true)
2826

2927
// Prettify HTML
30-
app.locals.pretty = true;
28+
app.locals.pretty = true
3129

3230
// cache=memory or swig dies in NODE_ENV=production
33-
app.locals.cache = 'memory';
31+
app.locals.cache = 'memory'
3432

3533
// Should be placed before express.static
3634
// To ensure that all assets and data are compressed (utilize bandwidth)
3735
app.use(compression({
3836
// Levels are specified in a range of 0 to 9, where-as 0 is
3937
// no compression and 9 is best compression, but slowest
4038
level: 9
41-
}));
39+
}))
4240

4341
// Enable compression on bower_components
44-
app.use('/bower_components', express.static(config.root + '/bower_components'));
42+
app.use('/bower_components', express.static(config.root + '/bower_components'))
4543

46-
app.use('/bundle', express.static(config.root + '/bundle'));
44+
app.use('/bundle', express.static(config.root + '/bundle'))
4745

4846
// Adds logging based on logging config in config/env/ entry
49-
require('./middlewares/logging')(app, config.logging);
47+
require('./middlewares/logging')(app, config.logging)
5048

5149
// assign the template engine to .html files
52-
app.engine('html', consolidate[config.templateEngine]);
50+
app.engine('html', consolidate[config.templateEngine])
5351

5452
// set .html as the default extension
55-
app.set('view engine', 'html');
56-
53+
app.set('view engine', 'html')
5754

5855
// Dynamic helpers
59-
app.use(helpers(config.app.name));
56+
app.use(helpers(config.app.name))
6057

6158
// Connect flash for flash messages
62-
app.use(flash());
59+
app.use(flash())
6360

6461
app.use(modRewrite([
65-
66-
'!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.swf|\\.jp(e?)g|\\.JP(E?)G|\\.PNG|\\.png|\\.ico|\\.gif|\\.svg|\\.eot|\\.ttf|\\.woff|\\.txt|\\.pdf$ / [L]'
6762

68-
]));
63+
'!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.swf|\\.jp(e?)g|\\.JP(E?)G|\\.PNG|\\.png|\\.ico|\\.gif|\\.svg|\\.eot|\\.ttf|\\.woff|\\.txt|\\.pdf$ / [L]'
64+
65+
]))
6966

70-
// app.use(seo());
71-
};
67+
// app.use(seo())
68+
}

0 commit comments

Comments
 (0)