Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit 0bf1aac

Browse files
author
Kamil Kisiela
committed
Add travis and eslint
1 parent 9564786 commit 0bf1aac

File tree

4 files changed

+196
-4
lines changed

4 files changed

+196
-4
lines changed

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.meteor
2+
tests
3+
**/tests
4+
5+
**/*.md
6+
**/*.html
7+
**/*.css
8+
**/*.json
9+
**/*.yaml
10+
**/*.yml

.eslintrc

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "eslint:recommended",
4+
"env": {
5+
"browser": true,
6+
"node": true,
7+
"meteor": true,
8+
"mongo": true,
9+
"jasmine": true,
10+
"es6": true
11+
},
12+
"globals": {
13+
// thrid-party packages globals
14+
"angular2now": false,
15+
"angular": false
16+
},
17+
"rules": {
18+
"no-unused-vars": [
19+
1,
20+
{
21+
"vars": "all",
22+
"args": "after-used"
23+
}
24+
],
25+
"curly": 2,
26+
// Require Following Curly Brace Conventions
27+
"eqeqeq": 2,
28+
// Require === and !==
29+
"no-alert": 2,
30+
// Disallow Use of Alert
31+
"no-caller": 2,
32+
// Disallow Use of caller/callee
33+
"no-else-return": 2,
34+
// Disallow return in else
35+
"no-eval": 2,
36+
// Disallow eval()
37+
"no-implied-eval": 2,
38+
// Disallow Implied eval()
39+
"no-labels": 2,
40+
// Disallow use of labeled statements
41+
"no-lone-blocks": 2,
42+
// Disallow Unnecessary Nested Blocks
43+
"no-loop-func": 2,
44+
// Disallow Functions in Loops
45+
"no-magic-numbers": 1,
46+
// Disallow Magic Numbers
47+
"no-multi-spaces": 2,
48+
// Disallow multiple spaces
49+
"no-native-reassign": 2,
50+
// Disallow Reassignment of Native Objects
51+
"no-new-func": 2,
52+
// Disallow Function Constructor
53+
"no-new-wrappers": 2,
54+
// Disallow Primitive Wrapper Instances
55+
"no-new": 2,
56+
// Disallow new For Side Effects
57+
"no-param-reassign": 2,
58+
// Disallow Reassignment of Function Parameters
59+
"no-proto": 2,
60+
// Disallow Use of __proto__
61+
"no-return-assign": 2,
62+
// Disallow Assignment in return Statement
63+
"no-script-url": 2,
64+
// Disallow use of javascript: urls
65+
"no-self-compare": 2,
66+
// Disallow comparisons where both sides are exactly the same
67+
"no-throw-literal": 2,
68+
// Restrict what can be thrown as an exception
69+
"no-unused-expressions": 2,
70+
// Disallow usage of expressions in statement position
71+
"no-useless-call": 2,
72+
// Disallow unnecessary .call() and .apply()
73+
"no-useless-concat": 2,
74+
// Disallow unnecessary concatenation of literals or template literals
75+
"no-void": 2,
76+
// Disallow use of the void operator
77+
"no-with": 2,
78+
// No with statements
79+
"vars-on-top": 2,
80+
// Require Variable Declarations to be at the top of their scope
81+
"wrap-iife": 2,
82+
// Require immediate function invocation to be wrapped in parentheses
83+
"array-bracket-spacing": [
84+
2,
85+
"never"
86+
],
87+
// Disallow or enforce spaces inside of brackets
88+
"block-spacing": [
89+
2,
90+
"always"
91+
],
92+
// Disallow or enforce spaces inside of single line blocks
93+
"camelcase": [
94+
2,
95+
{
96+
"properties": "always"
97+
}
98+
],
99+
// Require Camelcase
100+
"comma-spacing": [
101+
2,
102+
{
103+
"before": false,
104+
"after": true
105+
}
106+
],
107+
// Enforces spacing around commas
108+
"computed-property-spacing": [
109+
2,
110+
"never"
111+
],
112+
// Disallow or enforce spaces inside of computed properties
113+
"consistent-this": [
114+
2,
115+
"self"
116+
],
117+
// Require Consistent This
118+
"max-nested-callbacks": [
119+
2,
120+
3
121+
],
122+
// Set Maximum Depth of Nested Callbacks
123+
"new-parens": 2,
124+
// Require Parens for Constructors
125+
"newline-after-var": 2,
126+
// Require or disallow an empty newline after variable declarations
127+
"no-array-constructor": 2,
128+
// Disallow creation of dense arrays using the Array constructor
129+
"no-inline-comments": 2,
130+
// Disallows comments after code. Comments must come on their own lines
131+
"no-multiple-empty-lines": [
132+
2,
133+
{
134+
"max": 2
135+
}
136+
],
137+
// Disallows multiple blank lines
138+
"no-nested-ternary": 2,
139+
// Disallow Nested Ternaries
140+
"no-new-object": 2,
141+
// Disallow the use of the Object constructor
142+
"no-unneeded-ternary": 2,
143+
// Disallow conditional expressions that can be expressed with simpler constructs
144+
"object-curly-spacing": [
145+
2,
146+
"never"
147+
],
148+
// Disallow or enforce spaces inside of curly braces in objects.
149+
"one-var": [
150+
2,
151+
"never"
152+
],
153+
// Require or Disallow One Variable Declaration per Scope
154+
"wrap-regex": 2,
155+
// Require Regex Literals to be Wrapped
156+
"arrow-parens": [
157+
2,
158+
"always"
159+
],
160+
// Require parens in arrow function arguments
161+
"constructor-super": 2,
162+
// Verify calls of super() in constructors
163+
"no-class-assign": 2,
164+
// Disallow modifying variables of class declarations
165+
"no-const-assign": 2,
166+
// Disallow modifying variables that are declared using const
167+
"no-dupe-class-members": 2,
168+
// Disallow duplicate name in class members
169+
"no-this-before-super": 2,
170+
// Disallow use of this/super before calling super() in constructors
171+
}
172+
}

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- "0.12"
4+
before_install:
5+
- "curl -L https://raw.githubusercontent.com/arunoda/travis-ci-meteor-packages/master/configure.sh | /bin/sh"
6+
- "npm install -g velocity-cli"
7+
before_script:
8+
- "export PATH=$HOME/.meteor:$PATH"
9+
script:
10+
- "velocity test-package ./ --ci"

lib/client/run/md-theme-manipulator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SetModule('formlyMaterial')
44
.config((formlyConfigProvider) => {
55

66
const addIfNotPresent = (nodes, attr, val) => {
7-
angular.forEach(nodes, node => {
7+
angular.forEach((nodes, node) => {
88
if (!node.getAttribute(attr)) {
99
node.setAttribute(attr, val)
1010
}
@@ -52,10 +52,11 @@ SetModule('formlyMaterial')
5252
return matchingNgModelNodes
5353
};
5454

55-
formlyConfigProvider.templateManipulators.preWrapper.push((template, options, scope) => {
55+
formlyConfigProvider.templateManipulators.preWrapper.push((template, options) => {
5656
if (angular.isDefined(options.templateOptions.theme)) {
5757
const node = document.createElement('div');
5858
const skip = options.extras && options.extras.skipNgModelAttrsManipulator;
59+
5960
if (skip === true) {
6061
return template
6162
}
@@ -70,9 +71,8 @@ SetModule('formlyMaterial')
7071

7172
return node.innerHTML;
7273

73-
} else {
74-
return template;
7574
}
75+
return template;
7676
});
7777

7878
});

0 commit comments

Comments
 (0)