Skip to content

Commit af69a68

Browse files
committed
style(jscs): update jscs definition to use settings closer to the angular repo
1 parent 75ba13d commit af69a68

File tree

4 files changed

+72
-40
lines changed

4 files changed

+72
-40
lines changed

Diff for: app/templates/.jscs.json

+37-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
11
{
2-
"preset": "google",
32
"maximumLineLength": {
43
"value": 100,
54
"allowComments": true,
65
"allowRegex": true
76
},
8-
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
9-
"requireSpacesInsideObjectBrackets": "all",
10-
"disallowSpacesInsideObjectBrackets": "nested",
11-
"requireSpacesInConditionalExpression": true
7+
"disallowMixedSpacesAndTabs": true,
8+
"disallowMultipleLineStrings": true,
9+
"disallowNewlineBeforeBlockStatements": true,
10+
"disallowSpaceAfterObjectKeys": true,
11+
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
12+
"disallowSpaceBeforeBinaryOperators": [","],
13+
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
14+
"disallowSpacesInAnonymousFunctionExpression": {
15+
"beforeOpeningRoundBrace": true
16+
},
17+
"disallowSpacesInFunctionDeclaration": {
18+
"beforeOpeningRoundBrace": true
19+
},
20+
"disallowSpacesInNamedFunctionExpression": {
21+
"beforeOpeningRoundBrace": true
22+
},
23+
"disallowSpacesInsideArrayBrackets": true,
24+
"disallowSpacesInsideParentheses": true,
25+
"disallowTrailingComma": true,
26+
"disallowTrailingWhitespace": true,
27+
"requireCommaBeforeLineBreak": true,
28+
"requireLineFeedAtFileEnd": true,
29+
"requireSpaceAfterBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
30+
"requireSpaceBeforeBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
31+
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
32+
"requireSpaceBeforeBlockStatements": true,
33+
"requireSpacesInConditionalExpression": {
34+
"afterTest": true,
35+
"beforeConsequent": true,
36+
"afterConsequent": true,
37+
"beforeAlternate": true
38+
},
39+
"requireSpacesInFunction": {
40+
"beforeOpeningCurlyBrace": true
41+
},
42+
"validateLineBreaks": "LF",
43+
"validateParameterSeparator": ", "
1244
}

Diff for: app/templates/server/api/thing/thing.controller(noModels).js

+17-17
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
// Get list of things
1313
exports.index = function(req, res) {
1414
res.json([{
15-
name : 'Development Tools',
16-
info : 'Integration with popular tools such as Bower, Grunt, Karma, Mocha, JSHint, ' +
17-
'Node Inspector, Livereload, Protractor, Jade, Stylus, Sass, CoffeeScript, and Less.'
15+
name: 'Development Tools',
16+
info: 'Integration with popular tools such as Bower, Grunt, Karma, Mocha, JSHint, ' +
17+
'Node Inspector, Livereload, Protractor, Jade, Stylus, Sass, CoffeeScript, and Less.'
1818
}, {
19-
name : 'Server and Client integration',
20-
info : 'Built with a powerful and fun stack: MongoDB, Express, AngularJS, and Node.'
19+
name: 'Server and Client integration',
20+
info: 'Built with a powerful and fun stack: MongoDB, Express, AngularJS, and Node.'
2121
}, {
22-
name : 'Smart Build System',
23-
info : 'Build system ignores `spec` files, allowing you to keep tests alongside code. ' +
24-
'Automatic injection of scripts and styles into your index.html'
22+
name: 'Smart Build System',
23+
info: 'Build system ignores `spec` files, allowing you to keep tests alongside code. ' +
24+
'Automatic injection of scripts and styles into your index.html'
2525
}, {
26-
name : 'Modular Structure',
27-
info : 'Best practice client and server structures allow for more code reusability and ' +
28-
'maximum scalability'
26+
name: 'Modular Structure',
27+
info: 'Best practice client and server structures allow for more code reusability and ' +
28+
'maximum scalability'
2929
}, {
30-
name : 'Optimized Build',
31-
info : 'Build process packs up your templates as a single JavaScript payload, minifies ' +
32-
'your scripts/css/images, and rewrites asset names for caching.'
30+
name: 'Optimized Build',
31+
info: 'Build process packs up your templates as a single JavaScript payload, minifies ' +
32+
'your scripts/css/images, and rewrites asset names for caching.'
3333
}, {
34-
name : 'Deployment Ready',
35-
info : 'Easily deploy your app to Heroku or Openshift with the heroku and openshift ' +
36-
'subgenerators'
34+
name: 'Deployment Ready',
35+
info: 'Easily deploy your app to Heroku or Openshift with the heroku and openshift ' +
36+
'sub-generators'
3737
}]);
3838
};

Diff for: app/templates/server/config/environment/index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ var all = {
3939
safe: true
4040
}
4141
}
42-
},
43-
<% if (filters.facebookAuth) { %>
42+
}<% if (filters.facebookAuth) { %>,
43+
4444
facebook: {
4545
clientID: process.env.FACEBOOK_ID || 'id',
4646
clientSecret: process.env.FACEBOOK_SECRET || 'secret',
4747
callbackURL: (process.env.DOMAIN || '') + '/auth/facebook/callback'
48-
},
49-
<% } %><% if (filters.twitterAuth) { %>
48+
}<% } %><% if (filters.twitterAuth) { %>,
49+
5050
twitter: {
5151
clientID: process.env.TWITTER_ID || 'id',
5252
clientSecret: process.env.TWITTER_SECRET || 'secret',
5353
callbackURL: (process.env.DOMAIN || '') + '/auth/twitter/callback'
54-
},
55-
<% } %><% if (filters.googleAuth) { %>
54+
}<% } %><% if (filters.googleAuth) { %>,
55+
5656
google: {
5757
clientID: process.env.GOOGLE_ID || 'id',
5858
clientSecret: process.env.GOOGLE_SECRET || 'secret',

Diff for: app/templates/server/config/seed(models).js

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,31 @@ var Thing = sqldb.Thing;
2020
.then(function() {
2121
<% if (filters.mongooseModels) { %>Thing.create({<% }
2222
if (filters.sequelizeModels) { %>Thing.bulkCreate([{<% } %>
23-
name : 'Development Tools',
24-
info : 'Integration with popular tools such as Bower, Grunt, Karma, ' +
23+
name: 'Development Tools',
24+
info: 'Integration with popular tools such as Bower, Grunt, Karma, ' +
2525
'Mocha, JSHint, Node Inspector, Livereload, Protractor, Jade, ' +
2626
'Stylus, Sass, CoffeeScript, and Less.'
2727
}, {
28-
name : 'Server and Client integration',
29-
info : 'Built with a powerful and fun stack: MongoDB, Express, ' +
28+
name: 'Server and Client integration',
29+
info: 'Built with a powerful and fun stack: MongoDB, Express, ' +
3030
'AngularJS, and Node.'
3131
}, {
32-
name : 'Smart Build System',
33-
info : 'Build system ignores `spec` files, allowing you to keep ' +
32+
name: 'Smart Build System',
33+
info: 'Build system ignores `spec` files, allowing you to keep ' +
3434
'tests alongside code. Automatic injection of scripts and ' +
3535
'styles into your index.html'
3636
}, {
37-
name : 'Modular Structure',
38-
info : 'Best practice client and server structures allow for more ' +
37+
name: 'Modular Structure',
38+
info: 'Best practice client and server structures allow for more ' +
3939
'code reusability and maximum scalability'
4040
}, {
41-
name : 'Optimized Build',
42-
info : 'Build process packs up your templates as a single JavaScript ' +
41+
name: 'Optimized Build',
42+
info: 'Build process packs up your templates as a single JavaScript ' +
4343
'payload, minifies your scripts/css/images, and rewrites asset ' +
4444
'names for caching.'
4545
}, {
46-
name : 'Deployment Ready',
47-
info : 'Easily deploy your app to Heroku or Openshift with the heroku ' +
46+
name: 'Deployment Ready',
47+
info: 'Easily deploy your app to Heroku or Openshift with the heroku ' +
4848
'and openshift subgenerators'
4949
<% if (filters.mongooseModels) { %>});<% }
5050
if (filters.sequelizeModels) { %>}]);<% } %>

0 commit comments

Comments
 (0)