├── .editorconfig
├── .esformatter
├── .eslintignore
├── .eslintrc
├── .jsbeautifyrc
├── .jscsrc
├── .jshintignore
├── .jshintrc
├── Beautify.md
├── Editing.md
├── Linting.md
├── Readme.md
├── app
├── .meteor
│ ├── .finished-upgraders
│ ├── .gitignore
│ ├── .id
│ ├── .meteor
│ │ ├── .finished-upgraders
│ │ ├── .gitignore
│ │ ├── .id
│ │ ├── packages
│ │ ├── platforms
│ │ ├── release
│ │ └── versions
│ ├── packages
│ ├── platforms
│ ├── release
│ └── versions
├── client
│ ├── addLink
│ │ ├── addLink.html
│ │ └── addLink.js
│ ├── client.js
│ ├── lib
│ │ ├── configuration.js
│ │ ├── helpers.js
│ │ └── router.js
│ ├── linksList
│ │ ├── linksList.html
│ │ └── linksList.js
│ ├── loginRequest.html
│ ├── main.html
│ └── styles.css
├── common
│ ├── collections.js
│ └── methods.js
└── server
│ ├── app.js
│ └── fixtures.js
├── build
└── sonar-project.properties
└── configs
├── .eslintrc-base
├── .eslintrc-base-commented
├── .jscsrc-base
└── .jshintrc-base
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 2
9 | end_of_line = lf
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
--------------------------------------------------------------------------------
/.esformatter:
--------------------------------------------------------------------------------
1 | {
2 | "preset": "default",
3 | "indent": {
4 | "value": " ",
5 | "ArrayExpression": 1,
6 | "AssignmentExpression": 1,
7 | "BinaryExpression": 1,
8 | "ConditionalExpression": 1,
9 | "CallExpression": 1,
10 | "CatchClause": 1,
11 | "DoWhileStatement": 1,
12 | "ForInStatement": 1,
13 | "ForStatement": 1,
14 | "FunctionDeclaration": 1,
15 | "FunctionExpression": 1,
16 | "IfStatement": 1,
17 | "MemberExpression": 1,
18 | "MultipleVariableDeclaration": 1,
19 | "ObjectExpression": 1,
20 | "ReturnStatement": 1,
21 | "SwitchCase": 1,
22 | "SwitchStatement": 1,
23 | "TopLevelFunctionBlock": 1,
24 | "TryStatement": 1,
25 | "VariableDeclaration.LogicalExpression": 1,
26 | "WhileStatement": 1
27 | },
28 | "lineBreak": {
29 | "value": "\n",
30 | "before": {
31 | "AssignmentExpression": ">= 1",
32 | "AssignmentOperator": 0,
33 | "BlockStatement": 0,
34 | "CallExpression": -1,
35 | "ConditionalExpression": ">=1",
36 | "CatchOpeningBrace": 0,
37 | "CatchClosingBrace": ">=1",
38 | "CatchKeyword": 0,
39 | "DeleteOperator": ">=1",
40 | "DoWhileStatement": ">=1",
41 | "DoWhileStatementOpeningBrace": 0,
42 | "DoWhileStatementClosingBrace": ">=1",
43 | "EndOfFile": -1,
44 | "EmptyStatement": -1,
45 | "FinallyKeyword": -1,
46 | "FinallyOpeningBrace": 0,
47 | "FinallyClosingBrace": ">=1",
48 | "ForInStatement": ">=1",
49 | "ForInStatementExpressionOpening": 0,
50 | "ForInStatementExpressionClosing": 0,
51 | "ForInStatementOpeningBrace": 0,
52 | "ForInStatementClosingBrace": ">=1",
53 | "ForStatement": ">=1",
54 | "ForStatementExpressionOpening": 0,
55 | "ForStatementExpressionClosing": "<2",
56 | "ForStatementOpeningBrace": 0,
57 | "ForStatementClosingBrace": ">=1",
58 | "FunctionExpression": 0,
59 | "FunctionExpressionOpeningBrace": 0,
60 | "FunctionExpressionClosingBrace": ">=1",
61 | "FunctionDeclaration": ">=1",
62 | "FunctionDeclarationOpeningBrace": 0,
63 | "FunctionDeclarationClosingBrace": ">=1",
64 | "IfStatement": ">=1",
65 | "IfStatementOpeningBrace": 0,
66 | "IfStatementClosingBrace": ">=1",
67 | "ElseIfStatement": 0,
68 | "ElseIfStatementOpeningBrace": 0,
69 | "ElseIfStatementClosingBrace": ">=1",
70 | "ElseStatement": 0,
71 | "ElseStatementOpeningBrace": 0,
72 | "ElseStatementClosingBrace": ">=1",
73 | "LogicalExpression": -1,
74 | "ObjectExpressionClosingBrace": ">=1",
75 | "Property": ">=1",
76 | "ReturnStatement": -1,
77 | "SwitchOpeningBrace": 0,
78 | "SwitchClosingBrace": ">=1",
79 | "ThisExpression": -1,
80 | "ThrowStatement": ">=1",
81 | "TryKeyword": -1,
82 | "TryOpeningBrace": 0,
83 | "TryClosingBrace": ">=1",
84 | "VariableName": ">=1",
85 | "VariableValue": 0,
86 | "VariableDeclaration": ">=1",
87 | "VariableDeclarationWithoutInit": ">=1",
88 | "WhileStatement": ">=1",
89 | "WhileStatementOpeningBrace": 0,
90 | "WhileStatementClosingBrace": ">=1"
91 | },
92 | "after": {
93 | "AssignmentExpression": ">=1",
94 | "AssignmentOperator": 0,
95 | "BlockStatement": 0,
96 | "CallExpression": -1,
97 | "CatchOpeningBrace": ">=1",
98 | "CatchClosingBrace": ">=0",
99 | "CatchKeyword": 0,
100 | "ConditionalExpression": ">=1",
101 | "DeleteOperator": ">=1",
102 | "DoWhileStatement": ">=1",
103 | "DoWhileStatementOpeningBrace": ">=1",
104 | "DoWhileStatementClosingBrace": 0,
105 | "EmptyStatement": -1,
106 | "FinallyKeyword": -1,
107 | "FinallyOpeningBrace": ">=1",
108 | "FinallyClosingBrace": ">=1",
109 | "ForInStatement": ">=1",
110 | "ForInStatementExpressionOpening": "<2",
111 | "ForInStatementExpressionClosing": -1,
112 | "ForInStatementOpeningBrace": ">=1",
113 | "ForInStatementClosingBrace": ">=1",
114 | "ForStatement": ">=1",
115 | "ForStatementExpressionOpening": "<2",
116 | "ForStatementExpressionClosing": -1,
117 | "ForStatementOpeningBrace": ">=1",
118 | "ForStatementClosingBrace": ">=1",
119 | "FunctionExpression": ">=1",
120 | "FunctionExpressionOpeningBrace": ">=1",
121 | "FunctionExpressionClosingBrace": -1,
122 | "FunctionDeclaration": ">=1",
123 | "FunctionDeclarationOpeningBrace": ">=1",
124 | "FunctionDeclarationClosingBrace": ">=1",
125 | "IfStatement": ">=1",
126 | "IfStatementOpeningBrace": ">=1",
127 | "IfStatementClosingBrace": ">=1",
128 | "ElseIfStatement": ">=1",
129 | "ElseIfStatementOpeningBrace": ">=1",
130 | "ElseIfStatementClosingBrace": ">=1",
131 | "ElseStatement": ">=1",
132 | "ElseStatementOpeningBrace": ">=1",
133 | "ElseStatementClosingBrace": ">=1",
134 | "LogicalExpression": -1,
135 | "ObjectExpressionOpeningBrace": ">=1",
136 | "Property": 0,
137 | "ReturnStatement": -1,
138 | "SwitchOpeningBrace": ">=1",
139 | "SwitchClosingBrace": ">=1",
140 | "ThisExpression": 0,
141 | "ThrowStatement": ">=1",
142 | "TryKeyword": -1,
143 | "TryOpeningBrace": ">=1",
144 | "TryClosingBrace": 0,
145 | "VariableDeclaration": ">=1",
146 | "WhileStatement": ">=1",
147 | "WhileStatementOpeningBrace": ">=1",
148 | "WhileStatementClosingBrace": ">=1"
149 | }
150 | },
151 | "whiteSpace": {
152 | "value": " ",
153 | "removeTrailing": 1,
154 | "before": {
155 | "ArrayExpressionOpening": 0,
156 | "ArrayExpressionClosing": 0,
157 | "ArrayExpressionComma": 0,
158 | "ArgumentComma": 0,
159 | "ArgumentList": 0,
160 | "ArgumentListArrayExpression": 0,
161 | "ArgumentListFunctionExpression": 0,
162 | "ArgumentListObjectExpression": 0,
163 | "AssignmentOperator": 1,
164 | "BinaryExpression": 0,
165 | "BinaryExpressionOperator": 1,
166 | "BlockComment": 1,
167 | "CallExpression": -1,
168 | "CatchParameterList": 0,
169 | "CatchOpeningBrace": 1,
170 | "CatchClosingBrace": 1,
171 | "CatchKeyword": 1,
172 | "CommaOperator": 0,
173 | "ConditionalExpressionConsequent": 1,
174 | "ConditionalExpressionAlternate": 1,
175 | "DoWhileStatementOpeningBrace": 1,
176 | "DoWhileStatementClosingBrace": 1,
177 | "DoWhileStatementConditional": 1,
178 | "EmptyStatement": 0,
179 | "ExpressionClosingParentheses": 0,
180 | "FinallyKeyword": -1,
181 | "FinallyOpeningBrace": 1,
182 | "FinallyClosingBrace": 1,
183 | "ForInStatement": 1,
184 | "ForInStatementExpressionOpening": 1,
185 | "ForInStatementExpressionClosing": 0,
186 | "ForInStatementOpeningBrace": 1,
187 | "ForInStatementClosingBrace": 1,
188 | "ForStatement": 1,
189 | "ForStatementExpressionOpening": 1,
190 | "ForStatementExpressionClosing": 0,
191 | "ForStatementOpeningBrace": 1,
192 | "ForStatementClosingBrace": 1,
193 | "ForStatementSemicolon": 0,
194 | "FunctionDeclarationOpeningBrace": 1,
195 | "FunctionDeclarationClosingBrace": 1,
196 | "FunctionExpressionOpeningBrace": 1,
197 | "FunctionExpressionClosingBrace": 1,
198 | "IfStatementConditionalOpening": 1,
199 | "IfStatementConditionalClosing": 0,
200 | "IfStatementOpeningBrace": 1,
201 | "IfStatementClosingBrace": 1,
202 | "ElseStatementOpeningBrace": 1,
203 | "ElseStatementClosingBrace": 1,
204 | "ElseIfStatementOpeningBrace": 1,
205 | "ElseIfStatementClosingBrace": 1,
206 | "MemberExpressionClosing": 0,
207 | "LineComment": 1,
208 | "LogicalExpressionOperator": 1,
209 | "Property": 1,
210 | "PropertyValue": 1,
211 | "ParameterComma": 0,
212 | "ParameterList": 0,
213 | "SwitchDiscriminantOpening": 1,
214 | "SwitchDiscriminantClosing": 0,
215 | "ThrowKeyword": 1,
216 | "TryKeyword": -1,
217 | "TryOpeningBrace": 1,
218 | "TryClosingBrace": 1,
219 | "UnaryExpressionOperator": 0,
220 | "VariableName": 1,
221 | "VariableValue": 1,
222 | "WhileStatementConditionalOpening": 1,
223 | "WhileStatementConditionalClosing": 0,
224 | "WhileStatementOpeningBrace": 1,
225 | "WhileStatementClosingBrace": 1
226 | },
227 | "after": {
228 | "ArrayExpressionOpening": 0,
229 | "ArrayExpressionClosing": 0,
230 | "ArrayExpressionComma": 1,
231 | "ArgumentComma": 1,
232 | "ArgumentList": 0,
233 | "ArgumentListArrayExpression": 0,
234 | "ArgumentListFunctionExpression": 0,
235 | "ArgumentListObjectExpression": 0,
236 | "AssignmentOperator": 1,
237 | "BinaryExpression": 0,
238 | "BinaryExpressionOperator": 1,
239 | "BlockComment": 1,
240 | "CallExpression": 0,
241 | "CatchParameterList": 0,
242 | "CatchOpeningBrace": 1,
243 | "CatchClosingBrace": 1,
244 | "CatchKeyword": 1,
245 | "CommaOperator": 1,
246 | "ConditionalExpressionConsequent": 1,
247 | "ConditionalExpressionTest": 1,
248 | "DoWhileStatementOpeningBrace": 1,
249 | "DoWhileStatementClosingBrace": 1,
250 | "DoWhileStatementBody": 1,
251 | "EmptyStatement": 0,
252 | "ExpressionOpeningParentheses": 0,
253 | "FinallyKeyword": -1,
254 | "FinallyOpeningBrace": 1,
255 | "FinallyClosingBrace": 1,
256 | "ForInStatement": 1,
257 | "ForInStatementExpressionOpening": 0,
258 | "ForInStatementExpressionClosing": 1,
259 | "ForInStatementOpeningBrace": 1,
260 | "ForInStatementClosingBrace": 1,
261 | "ForStatement": 1,
262 | "ForStatementExpressionOpening": 0,
263 | "ForStatementExpressionClosing": 1,
264 | "ForStatementClosingBrace": 1,
265 | "ForStatementOpeningBrace": 1,
266 | "ForStatementSemicolon": 1,
267 | "FunctionReservedWord": 0,
268 | "FunctionName": 1,
269 | "FunctionExpressionOpeningBrace": 1,
270 | "FunctionExpressionClosingBrace": 0,
271 | "FunctionDeclarationOpeningBrace": 1,
272 | "FunctionDeclarationClosingBrace": 1,
273 | "IfStatementConditionalOpening": 0,
274 | "IfStatementConditionalClosing": 1,
275 | "IfStatementOpeningBrace": 1,
276 | "IfStatementClosingBrace": 1,
277 | "ElseStatementOpeningBrace": 1,
278 | "ElseStatementClosingBrace": 1,
279 | "ElseIfStatementOpeningBrace": 1,
280 | "ElseIfStatementClosingBrace": 1,
281 | "MemberExpressionOpening": 0,
282 | "LogicalExpressionOperator": 1,
283 | "ObjectExpressionClosingBrace": 0,
284 | "PropertyName": 0,
285 | "PropertyValue": 0,
286 | "ParameterComma": 1,
287 | "ParameterList": 0,
288 | "SwitchDiscriminantOpening": 0,
289 | "SwitchDiscriminantClosing": 1,
290 | "ThrowKeyword": 1,
291 | "TryKeyword": -1,
292 | "TryOpeningBrace": 1,
293 | "TryClosingBrace": 1,
294 | "UnaryExpressionOperator": 0,
295 | "VariableName": 1,
296 | "WhileStatementConditionalOpening": 0,
297 | "WhileStatementConditionalClosing": 1,
298 | "WhileStatementOpeningBrace": 1,
299 | "WhileStatementClosingBrace": 1
300 | }
301 | }
302 | }
303 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | app/.meteor/**
2 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | //.eslintrc for use with v0.23.0
2 | // inspired by https://gist.github.com/cletusw/e01a85e399ab563b1236
3 | // ESLint Meteor Configuration File
4 | {
5 | // http://eslint.org/docs/rules/
6 |
7 | "ecmaFeatures": {
8 | "arrowFunctions": false, // enable arrow functions
9 | "binaryLiterals": false, // enable binary literals
10 | "blockBindings": false, // enable let and const (aka block bindings)
11 | "classes": false, // enable classes
12 | "defaultParams": false, // enable default function parameters
13 | "destructuring": false, // enable destructuring
14 | "forOf": false, // enable for-of loops
15 | "generators": false, // enable generators
16 | "modules": false, // enable modules and global strict mode
17 | "objectLiteralComputedProperties": false, // enable computed object literal property names
18 | "objectLiteralDuplicateProperties": false, // enable duplicate object literal properties in strict mode
19 | "objectLiteralShorthandMethods": false, // enable object literal shorthand methods
20 | "objectLiteralShorthandProperties": false, // enable object literal shorthand properties
21 | "octalLiterals": false, // enable octal literals
22 | "regexUFlag": false, // enable the regular expression u flag
23 | "regexYFlag": false, // enable the regular expression y flag
24 | "restParams": false, // enable the rest parameters
25 | "spread": false, // enable the spread operator
26 | "superInFunctions": false, // enable super references inside of functions
27 | "templateStrings": false, // enable template strings
28 | "unicodeCodePointEscapes": false, // enable code point escapes
29 | "globalReturn": false, // allow return statements in the global scope
30 | "jsx": false // enable JSX
31 | },
32 |
33 | "env": {
34 | "browser": false, // browser global variables.
35 | "node": false, // Node.js global variables and Node.js-specific rules.
36 | "worker": false, // web workers global variables.
37 | "amd": false, // defines require() and define() as global variables as per the amd spec.
38 | "mocha": false, // adds all of the Mocha testing global variables.
39 | "jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
40 | "phantomjs": false, // phantomjs global variables.
41 | "jquery": false, // jquery global variables.
42 | "prototypejs": false, // prototypejs global variables.
43 | "shelljs": false, // shelljs global variables.
44 | "meteor": true, // meteor global variables.
45 | "mongo": false, // mongo global variables.
46 | "applescript": false, // applescript global variables.
47 | "es6": false // enable all ECMAScript 6 features except for modules.
48 | },
49 |
50 | "globals": {
51 | "meteor": true
52 | },
53 |
54 | "plugins": [
55 | // (must run `npm install eslint-plugin-*` as well )
56 | ],
57 |
58 | "rules": {
59 | /////////// Rules ///////////
60 | // Rules in ESLint are divided into several categories to help you better understand their value.
61 | // Additionally, not all rules are enabled by default.
62 | // Those that are not enabled by default are marked as being off.
63 | // use 0 for no action, 1 for warning, 2 for error
64 |
65 | /////////// Possible Errors ///////////
66 | // The following rules point out areas where you might have made mistakes.
67 | "comma-dangle": 0, // disallow or enforce trailing commas
68 | "no-comma-dangle": 0, // (deprecated) disallow trailing commas in object literals (off by default)
69 | "no-cond-assign": 0, // disallow assignment in conditional expressions
70 | "no-console": 0, // disallow use of console (off by default in the node environment)
71 | "no-constant-condition": 0, // disallow use of constant expressions in conditions
72 | "no-control-regex": 0, // disallow control characters in regular expressions
73 | "no-debugger": 0, // disallow use of debugger
74 | "no-dupe-args": 0, // disallow duplicate arguments in functions
75 | "no-dupe-keys": 0, // disallow duplicate keys when creating object literals
76 | "no-duplicate-case": 0, // disallow a duplicate case label.
77 | "no-empty-character-class": 0, // disallow the use of empty character classes in regular expressions
78 | "no-empty-class": 0, // (deprecated) disallow the use of empty character classes in regular expressions (off by default)
79 | "no-empty": 0, // disallow empty statements
80 | "no-ex-assign": 0, // disallow assigning to the exception in a catch block
81 | "no-extra-boolean-cast": 0, // disallow double-negation boolean casts in a boolean context
82 | "no-extra-parens": 0, // disallow unnecessary parentheses (off by default)
83 | "no-extra-semi": 0, // disallow unnecessary semicolons
84 | "no-func-assign": 0, // disallow overwriting functions written as function declarations
85 | "no-inner-declarations": 0, // disallow function or variable declarations in nested blocks
86 | "no-invalid-regexp": 0, // disallow invalid regular expression strings in the RegExp constructor
87 | "no-irregular-whitespace": 0, // disallow irregular whitespace outside of strings and comments
88 | "no-negated-in-lhs": 0, // disallow negation of the left operand of an in expression
89 | "no-obj-calls": 0, // disallow the use of object properties of the global object (Math and JSON) as functions
90 | "no-regex-spaces": 0, // disallow multiple spaces in a regular expression literal
91 | "no-reserved-keys": 0, // disallow reserved words being used as object literal keys (off by default)
92 | "no-sparse-arrays": 0, // disallow sparse arrays
93 | "no-unreachable": 0, // disallow unreachable statements after a return, throw, continue, or break statement
94 | "use-isnan": 0, // disallow comparisons with the value NaN
95 | "valid-jsdoc": 0, // Ensure JSDoc comments are valid (off by default)
96 | "valid-typeof": 0, // Ensure that the results of typeof are compared against a valid string
97 |
98 | /////////// Best Practices ///////////
99 | // These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns.
100 | "accessor-pairs": 0, // Enforces getter/setter pairs in objects (off by default)
101 | "block-scoped-var": 0, // treat var statements as if they were block scoped (off by default)
102 | "complexity": 0, // specify the maximum cyclomatic complexity allowed in a program (off by default)
103 | "consistent-return": 0, // require return statements to either always or never specify values
104 | "curly": [
105 | 2,
106 | "multi-line"
107 | ], // specify curly brace conventions for all control statements
108 | "default-case": 0, // require default case in switch statements (off by default)
109 | "dot-notation": 0, // encourages use of dot notation whenever possible
110 | "dot-location": 0, // enforces consistent newlines before or after dots (off by default)
111 | "eqeqeq": 2, // require the use of === and !==
112 | "guard-for-in": 0, // make sure for-in loops have an if statement (off by default)
113 | "no-alert": 0, // disallow the use of alert, confirm, and prompt
114 | "no-caller": 0, // disallow use of arguments.caller or arguments.callee
115 | "no-div-regex": 0, // disallow division operators explicitly at beginning of regular expression (off by default)
116 | "no-else-return": 0, // disallow else after a return in an if (off by default)
117 | "no-empty-label": 0, // disallow use of labels for anything other than loops and switches
118 | "no-eq-null": 0, // disallow comparisons to null without a type-checking operator (off by default)
119 | "no-eval": 0, // disallow use of eval()
120 | "no-extend-native": 0, // disallow adding to native types
121 | "no-extra-bind": 0, // disallow unnecessary function binding
122 | "no-fallthrough": 0, // disallow fallthrough of case statements
123 | "no-floating-decimal": 0, // disallow the use of leading or trailing decimal points in numeric literals (off by default)
124 | "no-implied-eval": 0, // disallow use of eval()-like methods
125 | "no-iterator": 0, // disallow usage of __iterator__ property
126 | "no-labels": 0, // disallow use of labeled statements
127 | "no-lone-blocks": 0, // disallow unnecessary nested blocks
128 | "no-loop-func": 0, // disallow creation of functions within loops
129 | "no-multi-spaces": 0, // disallow use of multiple spaces
130 | "no-multi-str": 0, // disallow use of multiline strings
131 | "no-native-reassign": 0, // disallow reassignments of native objects
132 | "no-new-func": 0, // disallow use of new operator for Function object
133 | "no-new-wrappers": 0, // disallows creating new instances of String,Number, and Boolean
134 | "no-new": 0, // disallow use of new operator when not part of the assignment or comparison
135 | "no-octal-escape": 0, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
136 | "no-octal": 0, // disallow use of octal literals
137 | "no-param-reassign": 0, // disallow reassignment of function parameters (off by default)
138 | "no-process-env": 0, // disallow use of process.env (off by default)
139 | "no-proto": 0, // disallow usage of __proto__ property
140 | "no-redeclare": 0, // disallow declaring the same variable more than once
141 | "no-return-assign": 0, // disallow use of assignment in return statement
142 | "no-script-url": 0, // disallow use of javascript: urls.
143 | "no-self-compare": 0, // disallow comparisons where both sides are exactly the same (off by default)
144 | "no-sequences": 0, // disallow use of comma operator
145 | "no-throw-literal": 0, // restrict what can be thrown as an exception (off by default)
146 | "no-unused-expressions": 0, // disallow usage of expressions in statement position
147 | "no-void": 0, // disallow use of void operator (off by default)
148 | "no-warning-comments": 0, // disallow usage of configurable warning terms in comments e.g. TODO or FIXME (off by default)
149 | "no-with": 0, // disallow use of the with statement
150 | "radix": 0, // require use of the second argument for parseInt() (off by default)
151 | "vars-on-top": 0, // requires to declare all vars on top of their containing scope (off by default)
152 | "wrap-iife": 0, // require immediate function invocation to be wrapped in parentheses (off by default)
153 | "yoda": 0, // require or disallow Yoda conditions
154 |
155 | /////////// Strict Mode ///////////
156 | // These rules relate to using strict mode.
157 | "global-strict": 0, // (deprecated) require or disallow the "use strict" pragma in the global scope (on by default)(off by default in the node environment)
158 | "no-extra-strict": 0, // (deprecated) disallow unnecessary use of "use strict"; when already in strict mode
159 | "strict": 0, // controls location of Use Strict Directives
160 |
161 | /////////// Variables ///////////
162 | // These rules have to do with variable declarations.
163 | "no-catch-shadow": 0, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
164 | "no-delete-var": 0, // disallow deletion of variables
165 | "no-label-var": 0, // disallow labels that share a name with a variable
166 | "no-shadow-restricted-names": 0, // disallow shadowing of names such as arguments
167 | "no-shadow": 0, // disallow declaration of variables already declared in the outer scope
168 | "no-undef-init": 0, // disallow use of undefined when initializing variables
169 | "no-undef": 0, // disallow use of undeclared variables unless mentioned in a /*global */ block
170 | "no-undefined": 0, // disallow use of undefined variable (off by default)
171 | "no-unused-vars": 0, // disallow declaration of variables that are not used in the code
172 | "no-use-before-define": 0, // disallow use of variables before they are defined
173 |
174 | /////////// Node.js ///////////
175 | // These rules are specific to JavaScript running on Node.js.
176 | "handle-callback-err": 0, // enforces error handling in callbacks (off by default) (on by default in the node environment)
177 | "no-mixed-requires": 0, // disallow mixing regular variable and require declarations (off by default) (on by default in the node environment)
178 | "no-new-require": 0, // disallow use of new operator with the require function (off by default) (on by default in the node environment)
179 | "no-path-concat": 0, // disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment)
180 | "no-process-exit": 0, // disallow process.exit() (on by default in the node environment)
181 | "no-restricted-modules": 0, // restrict usage of specified node modules (off by default)
182 | "no-sync": 0, // disallow use of synchronous methods (off by default)
183 |
184 | /////////// Stylistic Issues ///////////
185 | // These rules are purely matters of style and are quite subjective.
186 | "brace-style": 0, // enforce one true brace style (off by default)
187 | "camelcase": 2, // require camel case names
188 | "comma-spacing": [
189 | 2, {
190 | "before": false,
191 | "after": true
192 | }
193 | ], // enforce spacing before and after comma
194 | "comma-style": 0, // enforce one true comma style (off by default)
195 | "computed-property-spacing": 0, // require or disallow padding inside computed properties (off by default)
196 | "consistent-this": 0, // enforces consistent naming when capturing the current execution context (off by default)
197 | "eol-last": 0, // enforce newline at the end of file, with no multiple empty lines
198 | "func-names": 0, // require function expressions to have a name (off by default)
199 | "func-style": 0, // enforces use of function declarations or expressions (off by default)
200 | "indent": [
201 | 2,
202 | 2
203 | ], // this option sets a specific tab width for your code (off by default)
204 | "key-spacing": 0, // enforces spacing between keys and values in object literal properties
205 | "lines-around-comment": 0, // enforces empty lines around comments (off by default)
206 | "linebreak-style": 0, // disallow mixed LF and CRLF as linebreaks (off by default)
207 | "max-nested-callbacks": 0, // specify the maximum depth callbacks can be nested (off by default)
208 | "new-cap": 0, // require a capital letter for constructors
209 | "new-parens": 0, // disallow the omission of parentheses when invoking a constructor with no arguments
210 | "newline-after-var": 0, // allow/disallow an empty newline after var statement (off by default)
211 | "no-array-constructor": 0, // disallow use of the Array constructor
212 | "no-continue": 0, // disallow use of the continue statement (off by default)
213 | "no-inline-comments": 0, // disallow comments inline after code (off by default)
214 | "no-lonely-if": 0, // disallow if as the only statement in an else block (off by default)
215 | "no-mixed-spaces-and-tabs": 2, // disallow mixed spaces and tabs for indentation
216 | "no-multiple-empty-lines": 0, // disallow multiple empty lines (off by default)
217 | "no-nested-ternary": 0, // disallow nested ternary expressions (off by default)
218 | "no-new-object": 0, // disallow use of the Object constructor
219 | "no-space-before-semi": 0, // (deprecated) disallow space before semicolon (off by default)
220 | "no-spaced-func": 0, // disallow space between function identifier and application
221 | "no-ternary": 0, // disallow the use of ternary operators (off by default)
222 | "no-trailing-spaces": 2, // disallow trailing whitespace at the end of lines
223 | "no-underscore-dangle": 0, // disallow dangling underscores in identifiers
224 | "no-unneeded-ternary": 0, // disallow the use of Boolean literals in conditional expressions (off by default)
225 | "no-wrap-func": 0, // (deprecated) disallow wrapping of non-IIFE statements in parens
226 | "object-curly-spacing": 0, // require or disallow padding inside curly braces (off by default)
227 | "one-var": 0, // allow or disallow one variable declaration per function (off by default)
228 | "operator-assignment": 0, // require assignment operator shorthand where possible or prohibit it entirely (off by default)
229 | "operator-linebreak": 0, // enforce operators to be placed before or after line breaks (off by default)
230 | "padded-blocks": 0, // enforce padding within blocks (off by default)
231 | "quote-props": 0, // require quotes around object literal property names (off by default)
232 | "quotes": [
233 | 1,
234 | "single"
235 | ], // specify whether backticks, double or single quotes should be used
236 | "semi-spacing": [
237 | 2,
238 | {"before": false, "after": true}
239 | ], // enforce spacing before and after semicolons
240 | "semi": [
241 | 2,
242 | "always"
243 | ], // require or disallow use of semicolons instead of ASI
244 | "sort-vars": 0, // sort variables within the same declaration block (off by default)
245 | "space-after-function-name": 0, // (deprecated) require a space after function names (off by default)
246 | "space-after-keywords": [
247 | 2,
248 | "always"
249 | ], // require a space after certain keywords (off by default)
250 | "space-before-blocks": 0, // require or disallow space before blocks (off by default)
251 | "space-before-function-paren": [
252 | 2,
253 | "always"
254 | ], // require or disallow space before function opening parenthesis (off by default)
255 | "space-before-function-parentheses": 0, // (deprecated) require or disallow space before function parentheses (off by default)
256 | "space-in-brackets": [2, "always", {
257 | "singleValue": false,
258 | "objectsInArrays": false,
259 | "arraysInArrays": false,
260 | "arraysInObjects": false,
261 | "objectsInObjects": false,
262 | "propertyName": false
263 | }], // (deprecated) require or disallow spaces inside brackets (off by default)
264 | "space-in-parens": [
265 | 0,
266 | "never"
267 | ], // require or disallow spaces inside parentheses (off by default)
268 | "space-infix-ops": 0, // require spaces around operators
269 | "space-return-throw-case": 0, // require a space after return, throw, and case
270 | "space-unary-ops": 0, // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
271 | "space-unary-word-ops": 0, // (deprecated) Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
272 | "spaced-comment": 0, // require or disallow a space immediately following the // or /* in a comment (off by default)
273 | "spaced-line-comment": 0, // (deprecated) require or disallow a space immediately following the // in a line comment (off by default)
274 | "wrap-regex": 0, // require regex literals to be wrapped in parentheses (off by default)
275 |
276 | /////////// ECMAScript 6 ///////////
277 | // These rules are only relevant to ES6 environments and are off by default.
278 | "generator-star-spacing": 0, // enforce the spacing around the * in generator functions (off by default)
279 | "generator-star": 0, // (deprecated) enforce the position of the * in generator functions (off by default)
280 | "no-var": 0, // require let or const instead of var (off by default)
281 | "object-shorthand": 0, // require method and property shorthand syntax for object literals (off by default)
282 | "prefer-const": 0, // suggest using of const declaration for variables that are never modified after declared (off by default)
283 |
284 | /////////// Legacy ///////////
285 | // The following rules are included for compatibility with JSHint and JSLint. While the names of the rules may not match up with the JSHint/JSLint counterpart, the functionality is the same.
286 | "max-depth": 0, // specify the maximum depth that blocks can be nested (off by default)
287 | "max-len": [
288 | 1,
289 | 80,
290 | 2
291 | ], // specify the maximum length of a line in your program (off by default)
292 | "max-params": 0, // limits the number of parameters that can be used in the function declaration. (off by default)
293 | "max-statements": 0, // specify the maximum number of statement allowed in a function (off by default)
294 | "no-bitwise": 0, // disallow use of bitwise operators (off by default)
295 | "no-plusplus": 0 // disallow use of unary operators, ++ and -- (off by default)
296 | }
297 | }
298 |
--------------------------------------------------------------------------------
/.jsbeautifyrc:
--------------------------------------------------------------------------------
1 | {
2 | "indent_size": 2,
3 | "indent_char": " ",
4 | "indent_level": 0,
5 | "var_line_reindented": true,
6 | "chain_extra_indentation": 2,
7 | "indent_with_tabs": false,
8 | "preserve_newlines": true,
9 | "max_preserve_newlines": 2,
10 | "jslint_happy": true,
11 | "brace_style": "collapse",
12 | "keep_array_indentation": false,
13 | "keep_function_indentation": false,
14 | "eval_code": false,
15 | "unescape_strings": false,
16 | "break_chained_methods": false,
17 | "space_before_conditional": true,
18 | "wrap_line_length": 0
19 | }
20 |
--------------------------------------------------------------------------------
/.jscsrc:
--------------------------------------------------------------------------------
1 | //.jscsrc
2 | // tested with jscs v1.11.3
3 | {
4 | "excludeFiles": [".meteor/**"],
5 | //"disallowAnonymousFunctions": true, // Requires that a function expression be named.
6 | //"disallowCapitalizedComments": true, // Requires the first alphabetical character of a comment to be lowercase.
7 | //"disallowCommaBeforeLineBreak": true, // Disallows commas as last token on a line in lists.
8 | //"disallowCurlyBraces": true, // Disallows curly braces after statements.
9 | //"disallowDanglingUnderscores": true, // Disallows identifiers that start or end in _. Some popular identifiers are automatically listed as exceptions
10 | //"disallowEmptyBlocks": true, // Disallows empty blocks (except for catch blocks).
11 | //"disallowFunctionDeclarations": true, // Disallows function declarations.
12 | //"disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"], // Disallows implicit type conversion.
13 | //"disallowKeywordsInComments": true, // Disallows keywords in your comments, such as TODO or FIXME
14 | //"disallowKeywordsOnNewLine": ["else"], // Disallows placing keywords on a new line.
15 | //"disallowKeywords": ["with"], // Disallows usage of specified keywords.
16 | "disallowMixedSpacesAndTabs": true, // Requires lines to not contain both spaces and tabs consecutively,
17 | //"disallowMultipleLineBreaks": true, // Disallows multiple blank lines in a row.
18 | //"disallowMultipleLineStrings": true, // Disallows strings that span multiple lines without using concatenation.
19 | //"disallowMultipleVarDecl": true, // Disallows multiple var declaration (except for-loop).
20 | //"disallowNewlineBeforeBlockStatements": true, // Disallows newline before opening curly brace of all block statements.
21 | //"disallowOperatorBeforeLineBreak": true, // Requires putting certain operators on the next line rather than on the current line before a line break.
22 | //"disallowPaddingNewlinesBeforeKeywords": true, // Disallow an empty line above the specified keywords.
23 | //"disallowPaddingNewlinesInBlocks": true, // Disallows blocks from beginning and ending with 2 newlines.
24 | //"disallowPaddingNewLinesInObjects": true, // Disallows newline inside curly braces of all objects.
25 | //"disallowQuotedKeysInObjects": true, // Disallows quoted keys in object if possible.
26 | //"disallowSemicolons": true, // Disallows lines from ending in a semicolon.
27 | //"disallowSpaceAfterBinaryOperators": true, // Requires sticking binary operators to the right.
28 | //"disallowSpaceAfterKeywords": true, // Disallows space after keyword.
29 | //"disallowSpaceAfterLineComment": true, // Requires that a line comment (//) not be followed by a space.
30 | //"disallowSpaceAfterObjectKeys": true, // Disallows space after object keys.
31 | "disallowSpaceAfterPrefixUnaryOperators": true, // Requires sticking unary operators to the right.
32 | //"disallowSpaceBeforeBinaryOperators": true, // Requires sticking binary operators to the left.
33 | //"disallowSpaceBeforeBlockStatements": true, // Disallows space before block statements (for loops, control structures).
34 | //"disallowSpaceBeforeKeywords": true, // Disallows space before keyword.
35 | //"disallowSpaceBeforeObjectValues": true, // Disallows space after object keys.
36 | //"disallowSpaceBeforePostfixUnaryOperators": true, // Requires sticking unary operators to the left.
37 | //"disallowSpaceBetweenArguments": true, // Ensure there are no spaces after argument separators in call expressions.
38 | //"disallowSpacesInAnonymousFunctionExpression": { // Disallows space before () or {} in anonymous function expressions.
39 | // "beforeOpeningRoundBrace": true,
40 | // "beforeOpeningCurlyBrace": true
41 | //},
42 | //"disallowSpacesInCallExpression": true, // Disallows space before () in call expressions.
43 | //"disallowSpacesInConditionalExpression": true, // Disallows space before and/or after ? or : in conditional expressions.
44 | //"disallowSpacesInForStatement": true, // Disallow spaces in between for statement.
45 | //"disallowSpacesInFunctionDeclaration": { // Disallows space before () or {} in function declarations.
46 | // "beforeOpeningRoundBrace": true,
47 | // "beforeOpeningCurlyBrace": true
48 | // },
49 | //"disallowSpacesInFunctionExpression": { // Disallows space before () or {} in function expressions (both named and anonymous).
50 | // "beforeOpeningRoundBrace": true,
51 | // "beforeOpeningCurlyBrace": true
52 | // },
53 | //"disallowSpacesInFunction": { // Disallows space before () or {} in function expressions (both named and anonymous).
54 | // "beforeOpeningRoundBrace": true,
55 | // "beforeOpeningCurlyBrace": true
56 | // },
57 | //"disallowSpacesInNamedFunctionExpression": { // Disallows space before () or {} in named function expressions.
58 | // "beforeOpeningRoundBrace": true,
59 | // "beforeOpeningCurlyBrace": true
60 | // },
61 | "disallowSpacesInsideArrayBrackets": true, // Disallows space after opening array square bracket and before closing.
62 | //"disallowSpacesInsideBrackets": true, // Disallows space after opening square bracket and before closing.
63 | //"disallowSpacesInsideObjectBrackets": true, // Disallows space after opening object curly brace and before closing.
64 | //"disallowSpacesInsideParentheses": true, // Disallows space after opening round bracket and before closing.
65 | //"disallowTrailingComma": true, // Disallows an extra comma following the final element of an array or object literal.
66 | "disallowTrailingWhitespace": true, // Requires all lines to end on a non-whitespace character
67 | //"disallowYodaConditions": true, // Requires the variable to be the left hand operator when doing a boolean comparison
68 | "maximumLineLength": 80, // Requires all lines to be at most the number of characters specified
69 | //"requireAlignedObjectValues": "all", // Requires proper alignment in object literals.
70 | //"requireAnonymousFunctions": true, // Requires that a function expression be anonymous.
71 | //"requireBlocksOnNewline": true, // Requires blocks to begin and end with a newline
72 | "requireCamelCaseOrUpperCaseIdentifiers": true, // Requires identifiers to be camelCased or UPPERCASE_WITH_UNDERSCORES
73 | //"requireCapitalizedComments": true, // Requires the first alphabetical character of a comment to be uppercase, unless it is part of a multi-line textblock.
74 | //"requireCapitalizedConstructors": true, // Requires constructors to be capitalized (except for this)
75 | //"requireCommaBeforeLineBreak": true, // Requires commas as last token on a line in lists.
76 | //"requireCurlyBraces": true, // Requires curly braces after statements.
77 | //"requireDotNotation": true, // Requires member expressions to use dot notation when possible
78 | //"requireFunctionDeclarations": true, // Requires function declarations by disallowing assignment of functions
79 | //"requireKeywordsOnNewLine": ["else"], // Requires placing keywords on a new line.
80 | //"requireLineBreakAfterVariableAssignment": true, // Requires placing line feed after assigning a variable.
81 | //"requireLineFeedAtFileEnd": true, // Requires placing line feed at file end.
82 | //"requireMultipleVarDecl": true, // Requires multiple var declaration.
83 | //"requireNewlineBeforeBlockStatements": true, // Requires newline before opening curly brace of all block statements.
84 | //"requireOperatorBeforeLineBreak": true, // Requires operators to appear before line breaks and not after.
85 | //"requirePaddingNewlinesBeforeKeywords": true, // Requires an empty line above the specified keywords unless the keyword is the first expression in a block.
86 | //"requirePaddingNewlinesInBlocks": true, // Requires blocks to begin and end with 2 newlines
87 | //"requirePaddingNewLinesInObjects": true, // Requires newline inside curly braces of all objects.
88 | //"requireParenthesesAroundIIFE": true, // Requires parentheses around immediately invoked function expressions.
89 | //"requireQuotedKeysInObjects": true, // Requires quoted keys in objects.
90 | "requireSpaceAfterBinaryOperators": true, // Disallows sticking binary operators to the right.
91 | //"requireSpaceAfterKeywords": true, // Requires space after keyword.
92 | //"requireSpaceAfterLineComment": true, // Requires that a line comment (//) be followed by a space.
93 | //"requireSpaceAfterObjectKeys": true, // Requires space after object keys.
94 | //"requireSpaceAfterPrefixUnaryOperators": true, // Disallows sticking unary operators to the right.
95 | "requireSpaceBeforeBinaryOperators": true, // Disallows sticking binary operators to the left.
96 | //"requireSpaceBeforeBlockStatements": true, // Requires space before block statements (for loops, control structures).
97 | //"requireSpaceBeforeKeywords": true, // Requires space before keyword.
98 | "requireSpaceBeforeObjectValues": true,
99 | // Requires space after object keys.
100 | "requireSpaceBeforePostfixUnaryOperators": true, // Disallows sticking unary operators to the left.
101 | "requireSpaceBetweenArguments": true, // Ensure there are spaces after argument separators in call expressions.
102 | //"requireSpacesInAnonymousFunctionExpression": { // Requires space before () or {} in anonymous function expressions.
103 | // "beforeOpeningRoundBrace": true,
104 | // "beforeOpeningCurlyBrace": true
105 | //},
106 | //"requireSpacesInCallExpression": true, // Requires space before () in call expressions.
107 | //"requireSpacesInConditionalExpression": true, // Requires space before and/or after ? or : in conditional expressions.
108 | //"requireSpacesInForStatement": true, // Requires spaces inbetween for statement.
109 | //"requireSpacesInFunctionDeclaration": { // Requires space before () or {} in function declarations.
110 | // "beforeOpeningRoundBrace": true,
111 | // "beforeOpeningCurlyBrace": true
112 | //},
113 | //"requireSpacesInFunctionExpression": { // Requires space before () or {} in function expressions (both named and anonymous).
114 | // "beforeOpeningRoundBrace": true,
115 | // "beforeOpeningCurlyBrace": true
116 | //},
117 | //"requireSpacesInFunction": { // Requires space before () or {} in function expressions (both named and anonymous).
118 | // "beforeOpeningRoundBrace": true,
119 | // "beforeOpeningCurlyBrace": true
120 | //},
121 | //"requireSpacesInNamedFunctionExpression": { // Requires space before () or {} in named function expressions.
122 | // "beforeOpeningRoundBrace": true,
123 | // "beforeOpeningCurlyBrace": true
124 | //},
125 | //"requireSpacesInsideArrayBrackets": "all", // Requires space after opening array square bracket and before closing.
126 | //"requireSpacesInsideBrackets": true, // Requires space after opening square bracket and before closing.
127 | "requireSpacesInsideObjectBrackets": "all", // Requires space after opening object curly brace and before closing.
128 | //"requireSpacesInsideParentheses": "all", // Requires space after opening round bracket and before closing.
129 | //"requireTrailingComma": true, // Requires an extra comma following the final element of an array or object literal.
130 | //"requireYodaConditions": true, // Requires the variable to be the right hand operator when doing a boolean comparison
131 | "safeContextKeyword": ["self"], // Option to check var that = this expressions
132 | "validateIndentation": 2 // Validates indentation for switch statements and block statements
133 | //"validateLineBreaks": "LF", // Option to check line break characters
134 | //"validateParameterSeparator": ", ", // Enable validation of separators between function parameters. Will ignore newlines.
135 | //"validateQuoteMarks": true // Requires all quote marks to be either the supplied value, or consistent if true
136 | }
137 |
--------------------------------------------------------------------------------
/.jshintignore:
--------------------------------------------------------------------------------
1 | .meteor
2 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | //.jshintrc
2 | {
3 | // JSHint Meteor Configuration File
4 | // Match the Meteor Style Guide
5 | //
6 | // By @raix with contributions from @aldeed and @awatson1978
7 | // Source https://github.com/raix/Meteor-jshintrc
8 | //
9 | // See http://jshint.com/docs/ for more details
10 |
11 | "maxerr": 50,
12 | // {int} Maximum error before stopping
13 |
14 | // Enforcing
15 | "bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.)
16 | "camelcase": true, // true: Identifiers must be in camelCase
17 | "curly": true, // true: Require {} for every new block or scope
18 | "eqeqeq": true, // true: Require triple equals (===) for comparison
19 | "forin": true, // true: Require filtering for..in loops with obj.hasOwnProperty()
20 | "immed": false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
21 | "indent": 2, // {int} Number of spaces to use for indentation
22 | "latedef": true, // true: Require variables/functions to be defined before being used
23 | "newcap": false, // true: Require capitalization of all constructor functions e.g. `new F()`
24 | "noarg": true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
25 | "noempty": true, // true: Prohibit use of empty blocks
26 | "nonew": false, // true: Prohibit use of constructors for side-effects (without assignment)
27 | "plusplus": false, // true: Prohibit use of `++` & `--`
28 | "quotmark": true, // Quotation mark consistency:
29 | // false : do nothing (default)
30 | // true : ensure whatever is used is consistent
31 | // "single" : require single quotes
32 | // "double" : require double quotes
33 | "undef": false, // true: Require all non-global variables to be declared (prevents global leaks)
34 | "unused": true, // true: Require all defined variables be used
35 | "strict": false, // true: Requires all functions run in ES5 Strict Mode
36 | "trailing": true, // true: Prohibit trailing whitespaces
37 | "maxparams": false, // {int} Max number of formal params allowed per function
38 | "maxdepth": false, // {int} Max depth of nested blocks (within functions)
39 | "maxstatements": false, // {int} Max number statements per function
40 | "maxcomplexity": false, // {int} Max cyclomatic complexity per function
41 | "maxlen": 80, // {int} Max number of characters per line
42 |
43 | // Relaxing
44 | "asi": false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
45 | "boss": false, // true: Tolerate assignments where comparisons would be expected
46 | "debug": false, // true: Allow debugger statements e.g. browser breakpoints.
47 | "eqnull": false, // true: Tolerate use of `== null`
48 | "es5": false, // true: Allow ES5 syntax (ex: getters and setters)
49 | "esnext": false, // true: Allow ES.next (ES6) syntax (ex: `const`)
50 | "moz": false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
51 | // (ex: `for each`, multiple try/catch, function expression…)
52 | "evil": false, // true: Tolerate use of `eval` and `new Function()`
53 | "expr": false, // true: Tolerate `ExpressionStatement` as Programs
54 | "funcscope": false, // true: Tolerate defining variables inside control statements"
55 | "globalstrict": true, // true: Allow global "use strict" (also enables 'strict')
56 | "iterator": false, // true: Tolerate using the `__iterator__` property
57 | "lastsemic": false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
58 | "laxbreak": false, // true: Tolerate possibly unsafe line breakings
59 | "laxcomma": false, // true: Tolerate comma-first style coding
60 | "loopfunc": false, // true: Tolerate functions being defined in loops
61 | "multistr": false, // true: Tolerate multi-line strings
62 | "proto": false, // true: Tolerate using the `__proto__` property
63 | "scripturl": false, // true: Tolerate script-targeted URLs
64 | "smarttabs": false, // true: Tolerate mixed tabs/spaces when used for alignment
65 | "shadow": false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
66 | "sub": false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
67 | "supernew": false, // true: Tolerate `new function () { ... };` and `new Object;`
68 | "validthis": false, // true: Tolerate using this in a non-constructor function
69 |
70 | // Environments
71 | "browser": true, // Web Browser (window, document, etc)
72 | "couch": false, // CouchDB
73 | "devel": true, // Development/debugging (alert, confirm, etc)
74 | "dojo": false, // Dojo Toolkit
75 | "jquery": false, // jQuery
76 | "mootools": false, // MooTools
77 | "node": false, // Node.js
78 | "nonstandard": false, // Widely adopted globals (escape, unescape, etc)
79 | "prototypejs": false, // Prototype and Scriptaculous
80 | "rhino": false, // Rhino
81 | "worker": false, // Web Workers
82 | "wsh": false, // Windows Scripting Host
83 | "yui": false, // Yahoo User Interface
84 | //"meteor" : false, // Meteor.js
85 |
86 | // Legacy
87 | "nomen": false, // true: Prohibit dangling `_` in variables
88 | "onevar": false, // true: Allow only one `var` statement per function
89 | "passfail": false, // true: Stop on first error
90 | "white": true, // true: Check against strict whitespace and indentation rules
91 |
92 | // Custom globals, from http://docs.meteor.com, in alphabetical order
93 | "globals": {
94 | "Accounts": false,
95 | "App": false, //mobile-config.js
96 | "Assets": false,
97 | "Blaze": false, //UI is being renamed Blaze
98 | "check": false,
99 | "DDP": false,
100 | "Deps": false,
101 | "EJSON": false,
102 | "Email": false,
103 | "Handlebars": false, // https://github.com/meteor/meteor/wiki/Handlebars
104 | "HTTP": false,
105 | "Match": false,
106 | "Meteor": false,
107 | "Mongo": false, //Meteor.Collection renamed to Mongo.Collection
108 | "Package": false,
109 | "ReactiveVar": false,
110 | "Session": false,
111 | "Template": false,
112 | "Tracker": false, //Deps renamed to Tracker
113 | "UI": false, // Meteor internals
114 | "DDPServer": false,
115 | "global": false,
116 | "Log": false,
117 | "MongoInternals": false,
118 | "process": false,
119 | "WebApp": false,
120 | "WebAppInternals": false, // globals useful when creating Meteor packages
121 | "Npm": false,
122 | "Tinytest": false, // Velocity support
123 | "MochaWeb": false, // common Meteor packages
124 | "Random": false,
125 | "_": false, // Underscore.js
126 | "$": false, // jQuery
127 | "Router": false // iron-router
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/Beautify.md:
--------------------------------------------------------------------------------
1 | # Beautifying Meteor Projects
2 |
3 | Beautifying your code means you get it in shape to meet certain style (or quality) criteria.
4 |
5 | A convenient tool to use is [js-beautify](https://github.com/beautify-web/js-beautify). It can be configured using a `.jsbeautifyrc` file in the root of your project.
6 |
7 | Similar to `.editorconfig` it is not capable of automatically meeting every style convention, but most of the big ones.
8 |
--------------------------------------------------------------------------------
/Editing.md:
--------------------------------------------------------------------------------
1 | # Editing with style support
2 |
3 | Most editor allow you to define certain style aspects, such as how many spaces to use for indenting code. When using different editors or using different editors it can become quite tedious to manage the correct editor settings by hand. [Editorconfig](http://editorconfig.org/) is a simple tool to take care of unified editor settings across different editors or machines.
4 |
5 | The [list of supported options](https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties) is different between editors.
6 |
7 | Note that only a small fraction of what can be part of a style guide can be addressed using editor settings or even editorconfig. Try to include tools to [beautify code adhering to style conventions](Beautify.md).
8 |
--------------------------------------------------------------------------------
/Linting.md:
--------------------------------------------------------------------------------
1 | # Linting Meteor Projects
2 |
3 | Linting your files means you check whether you meet the conventions you defined for your code. It's like doing a quality check.
4 |
5 | There are several tools you can use to lint JavaScript code:
6 |
7 | * [JSHint](http://jshint.com/)
8 | * [JSCS](http://jscs.info/)
9 | * [ESLint](http://eslint.org/)
10 |
11 | They have slightly different approaches. They all have in common that they can check whether code adheres to certain quality or styles standards.
12 |
13 | If you only wish to pick one, I'd recommend [ESLint](http://eslint.org/).
14 |
15 | ## Usage
16 |
17 | ### Prerequisites
18 |
19 | Make sure that `npm` is available on your machine as all of these tools come as node packages.
20 |
21 | ### [JSHint](http://jshint.com/)
22 |
23 | JSHint is a tool that helps to detect errors and potential problems in JavaScript code.
24 |
25 | ### Installation
26 |
27 | Issue the following command inside a terminal:
28 |
29 | `$ npm install -g jshint`
30 |
31 | ### Configuration
32 |
33 | In order to use JShint you need a `.jshintrc file in the root directory. It can be used to configure [77 options](http://jshint.com/docs/options/).
34 |
35 | In order to exclude files or directories from linting you can use a `.jshintignore` file.
36 |
37 | ### Linting
38 |
39 | Inside the root directory of your project issue
40 |
41 | `$ jshint . `
42 |
43 | ## [JSCS](http://jscs.info/) - JavaScript Code Style
44 |
45 | JSCS is a code style linter for programmatically enforcing a style guide.
46 |
47 | ### Installation
48 |
49 | Issue the following command inside a terminal:
50 |
51 | `$ npm install -g jscs`
52 |
53 | ### Configuration
54 |
55 | In order to use JavaScript Code Style (jscs) you need a `.jscsrc` file in the root directory. It can be used to configure [100 rules](http://jscs.info/rules.html).
56 |
57 | In order to exclude files or directories from linting you can set the `excludeFiles` option to an array of files or locations.
58 |
59 | ### Linting
60 |
61 | Inside the root directory of your project issue
62 |
63 | `$ jscs . `
64 |
65 | ## [ESLint](http://eslint.org/)
66 |
67 | ### Installation
68 |
69 | Issue the following command inside a terminal:
70 |
71 | `$ npm install -g eslint`
72 |
73 | ### Configuration
74 |
75 | In order to use ESlint you need a `.eslintrc file in the root directory. It can be used to configure [143 rules](http://eslint.org/docs/rules/).
76 |
77 | In order to exclude files or directories from linting you can use a `.eslintgnore` file.
78 |
79 | ### Linting
80 |
81 | Inside the root directory of your project issue
82 |
83 | `$ eslint . `
84 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # Meteor code in style
2 |
3 | This repository contains a simple Meteor application that shows how to
4 |
5 | * set defaults for your editor of choice
6 | * perform linting on Meteor (JavaScript) code
7 | * utilize js-beautify to format code according to style requirements
8 |
9 | You can find the associated slides [on slideshare](http://de.slideshare.net/stephanhochhaus/writing-meteor-code-with-style) and [an associated post on my blog](https://www.yauh.de/writing-clean-javascript-code-with-eslint-and-js-beautify/). Also this repository contains a sample Meteor application so you can get started with some style experiments on your own.
10 |
11 | ## Why worry about style?
12 |
13 | Two reasons why you should decide on a style and enforce it:
14 |
15 | 1. It becomes easier to understand code written by other developers
16 | 1. (Dumb) compile errors can be avoided
17 |
18 | Style includes naming conventions, formatting, commenting, patterns, and other areas teams would like to keep consistent.
19 |
20 | ## How to find the right style?
21 |
22 | A good coding style minimizes ambiguity and makes it easy for team members to read other developer's code.
23 |
24 | For Meteor projects it is a good idea to look at [the offical MDG Style Guide](https://github.com/meteor/meteor/wiki/Meteor-Style-Guide).
25 |
26 | ## How to enforce a certain style?
27 |
28 | Before there were computers there were code reviews to identify violations of style guidelines. Static code analysis tools will produce reports of all found violations.
29 |
30 | Enforcing a certain style becomes easier when using a [supporting editor configuration](Editing.md) as well as tools that are capable of [pointing out violations of style rules](Linting.md). Ideally the editor is capable of [beautifiying the code adhering to style conventions](Beautify.md).
31 |
--------------------------------------------------------------------------------
/app/.meteor/.finished-upgraders:
--------------------------------------------------------------------------------
1 | # This file contains information which helps Meteor properly upgrade your
2 | # app when you run 'meteor update'. You should check it into version control
3 | # with your project.
4 |
5 | notices-for-0.9.0
6 | notices-for-0.9.1
7 | 0.9.4-platform-file
8 |
--------------------------------------------------------------------------------
/app/.meteor/.gitignore:
--------------------------------------------------------------------------------
1 | local
2 |
--------------------------------------------------------------------------------
/app/.meteor/.id:
--------------------------------------------------------------------------------
1 | # This file contains a token that is unique to your project.
2 | # Check it into your repository along with the rest of this directory.
3 | # It can be used for purposes such as:
4 | # - ensuring you don't accidentally deploy one app on top of another
5 | # - providing package authors with aggregated statistics
6 |
7 | 13u0roxd07n2fojjw7k
8 |
--------------------------------------------------------------------------------
/app/.meteor/.meteor/.finished-upgraders:
--------------------------------------------------------------------------------
1 | # This file contains information which helps Meteor properly upgrade your
2 | # app when you run 'meteor update'. You should check it into version control
3 | # with your project.
4 |
5 | notices-for-0.9.0
6 | notices-for-0.9.1
7 | 0.9.4-platform-file
8 |
--------------------------------------------------------------------------------
/app/.meteor/.meteor/.gitignore:
--------------------------------------------------------------------------------
1 | local
2 |
--------------------------------------------------------------------------------
/app/.meteor/.meteor/.id:
--------------------------------------------------------------------------------
1 | # This file contains a token that is unique to your project.
2 | # Check it into your repository along with the rest of this directory.
3 | # It can be used for purposes such as:
4 | # - ensuring you don't accidentally deploy one app on top of another
5 | # - providing package authors with aggregated statistics
6 |
7 | 13u0roxd07n2fojjw7k
8 |
--------------------------------------------------------------------------------
/app/.meteor/.meteor/packages:
--------------------------------------------------------------------------------
1 | # Meteor packages used by this project, one per line.
2 | # Check this file (and the other files in this directory) into your repository.
3 | #
4 | # 'meteor add' and 'meteor remove' will edit this file for you,
5 | # but you can also edit it by hand.
6 |
7 | meteor-platform
8 | twbs:bootstrap
9 | accounts-password
10 | ian:accounts-ui-bootstrap-3
11 | iron:router
12 |
--------------------------------------------------------------------------------
/app/.meteor/.meteor/platforms:
--------------------------------------------------------------------------------
1 | server
2 | browser
3 |
--------------------------------------------------------------------------------
/app/.meteor/.meteor/release:
--------------------------------------------------------------------------------
1 | METEOR@1.0.3.1
2 |
--------------------------------------------------------------------------------
/app/.meteor/.meteor/versions:
--------------------------------------------------------------------------------
1 | accounts-base@1.1.3
2 | accounts-password@1.0.6
3 | anti:i18n@0.4.3
4 | application-configuration@1.0.4
5 | autoupdate@1.1.5
6 | base64@1.0.2
7 | binary-heap@1.0.2
8 | blaze@2.0.4
9 | blaze-tools@1.0.2
10 | boilerplate-generator@1.0.2
11 | callback-hook@1.0.2
12 | check@1.0.4
13 | ddp@1.0.14
14 | deps@1.0.6
15 | ejson@1.0.5
16 | email@1.0.5
17 | fastclick@1.0.2
18 | follower-livedata@1.0.3
19 | geojson-utils@1.0.2
20 | handlebars@1.0.2
21 | html-tools@1.0.3
22 | htmljs@1.0.3
23 | http@1.0.10
24 | ian:accounts-ui-bootstrap-3@1.2.33
25 | id-map@1.0.2
26 | iron:controller@1.0.7
27 | iron:core@1.0.7
28 | iron:dynamic-template@1.0.7
29 | iron:layout@1.0.7
30 | iron:location@1.0.7
31 | iron:middleware-stack@1.0.7
32 | iron:router@1.0.7
33 | iron:url@1.0.7
34 | jquery@1.11.3
35 | json@1.0.2
36 | launch-screen@1.0.1
37 | livedata@1.0.12
38 | localstorage@1.0.2
39 | logging@1.0.6
40 | meteor@1.1.4
41 | meteor-platform@1.2.1
42 | minifiers@1.1.3
43 | minimongo@1.0.6
44 | mobile-status-bar@1.0.2
45 | mongo@1.0.11
46 | npm-bcrypt@0.7.7
47 | observe-sequence@1.0.4
48 | ordered-dict@1.0.2
49 | random@1.0.2
50 | reactive-dict@1.0.5
51 | reactive-var@1.0.4
52 | reload@1.1.2
53 | retry@1.0.2
54 | routepolicy@1.0.4
55 | service-configuration@1.0.3
56 | session@1.0.5
57 | sha@1.0.2
58 | spacebars@1.0.5
59 | spacebars-compiler@1.0.4
60 | srp@1.0.2
61 | stylus@1.0.6
62 | templating@1.0.11
63 | tracker@1.0.5
64 | twbs:bootstrap@3.3.2
65 | ui@1.0.5
66 | underscore@1.0.2
67 | url@1.0.3
68 | webapp@1.1.6
69 | webapp-hashing@1.0.2
70 |
--------------------------------------------------------------------------------
/app/.meteor/packages:
--------------------------------------------------------------------------------
1 | # Meteor packages used by this project, one per line.
2 | # Check this file (and the other files in this directory) into your repository.
3 | #
4 | # 'meteor add' and 'meteor remove' will edit this file for you,
5 | # but you can also edit it by hand.
6 |
7 | meteor-platform
8 | twbs:bootstrap
9 | accounts-password
10 | ian:accounts-ui-bootstrap-3
11 | iron:router
12 |
--------------------------------------------------------------------------------
/app/.meteor/platforms:
--------------------------------------------------------------------------------
1 | server
2 | browser
3 |
--------------------------------------------------------------------------------
/app/.meteor/release:
--------------------------------------------------------------------------------
1 | METEOR@1.0.3.1
2 |
--------------------------------------------------------------------------------
/app/.meteor/versions:
--------------------------------------------------------------------------------
1 | accounts-base@1.1.3
2 | accounts-password@1.0.6
3 | anti:i18n@0.4.3
4 | application-configuration@1.0.4
5 | autoupdate@1.1.5
6 | base64@1.0.2
7 | binary-heap@1.0.2
8 | blaze@2.0.4
9 | blaze-tools@1.0.2
10 | boilerplate-generator@1.0.2
11 | callback-hook@1.0.2
12 | check@1.0.4
13 | ddp@1.0.14
14 | deps@1.0.6
15 | ejson@1.0.5
16 | email@1.0.5
17 | fastclick@1.0.2
18 | follower-livedata@1.0.3
19 | geojson-utils@1.0.2
20 | handlebars@1.0.2
21 | html-tools@1.0.3
22 | htmljs@1.0.3
23 | http@1.0.10
24 | ian:accounts-ui-bootstrap-3@1.2.33
25 | id-map@1.0.2
26 | iron:controller@1.0.7
27 | iron:core@1.0.7
28 | iron:dynamic-template@1.0.7
29 | iron:layout@1.0.7
30 | iron:location@1.0.7
31 | iron:middleware-stack@1.0.7
32 | iron:router@1.0.7
33 | iron:url@1.0.7
34 | jquery@1.11.3
35 | json@1.0.2
36 | launch-screen@1.0.1
37 | livedata@1.0.12
38 | localstorage@1.0.2
39 | logging@1.0.6
40 | meteor@1.1.4
41 | meteor-platform@1.2.1
42 | minifiers@1.1.3
43 | minimongo@1.0.6
44 | mobile-status-bar@1.0.2
45 | mongo@1.0.11
46 | npm-bcrypt@0.7.7
47 | observe-sequence@1.0.4
48 | ordered-dict@1.0.2
49 | random@1.0.2
50 | reactive-dict@1.0.5
51 | reactive-var@1.0.4
52 | reload@1.1.2
53 | retry@1.0.2
54 | routepolicy@1.0.4
55 | service-configuration@1.0.3
56 | session@1.0.5
57 | sha@1.0.2
58 | spacebars@1.0.5
59 | spacebars-compiler@1.0.4
60 | srp@1.0.2
61 | stylus@1.0.6
62 | templating@1.0.11
63 | tracker@1.0.5
64 | twbs:bootstrap@3.3.2
65 | ui@1.0.5
66 | underscore@1.0.2
67 | url@1.0.3
68 | webapp@1.1.6
69 | webapp-hashing@1.0.2
70 |
--------------------------------------------------------------------------------
/app/client/addLink/addLink.html:
--------------------------------------------------------------------------------
1 |
2 | We are sooo happy that you want to contribute a link to our collection!Send us your best links
5 |
6 |
7 |
23 |
24 |
8 |
16 |
17 |
18 | {{#each links}}
19 | {{> link }}
20 | {{/each}}
21 |
22 | Votes
9 | Link
10 | Category
11 | Submitted by
12 | {{#if currentUser}}
13 | Action
14 | {{/if}}
15 |
30 |
43 |
44 |
--------------------------------------------------------------------------------
/app/client/linksList/linksList.js:
--------------------------------------------------------------------------------
1 | Template.linkList.helpers({
2 | links: function () {
3 | return LinksCollection.find({}, {
4 | sort: {
5 | votes: -1
6 | }
7 | });
8 | }
9 | });
10 |
11 | Template.linkList.events({
12 | 'click button#show-more': function () {
13 | var newLimit = Session.get('linksLimit') + 10;
14 | Session.set('linksLimit', newLimit);
15 | }
16 | });
17 |
18 | Template.link.events({
19 | 'click button.btn-danger': function (evt) {
20 | // delete link
21 | evt.preventDefault();
22 | Meteor.call('RemoveLink', {
23 | linkId: this._id
24 | }, function (error) {
25 |
26 | if (error) {
27 | return alert('Error: ' + error.error);
28 | } else {
29 | console.log('yeah, deleted');
30 | }
31 | });
32 | },
33 | 'click button.btn-success': function (evt) {
34 | // upvote link
35 | evt.preventDefault();
36 | Meteor.call('AddVote', {
37 | linkId: this._id
38 | }, function (error) {
39 |
40 | if (error) {
41 | return alert('Error: ' + error.error);
42 | } else {
43 | console.log('yeah, upvoted');
44 | $(evt.currentTarget).addClass('disabled');
45 | }
46 | });
47 | }
48 | });
--------------------------------------------------------------------------------
/app/client/loginRequest.html:
--------------------------------------------------------------------------------
1 |
2 | {{votes}}
31 | {{text}}
32 | {{category}}
33 | {{creator}}
34 | {{#if currentUser}}
35 |
36 |
37 | {{#if isMyLink}}
38 |
39 | {{/if}}
40 |
41 | {{/if}}
42 | Quick, come join us!
4 |
5 |
6 | Please register an account and login so that you can start adding links (plus you get to vote on links and
7 | make
8 | them become much more popular).