Skip to content

Commit 2f88234

Browse files
authored
Merge pull request #6 from abdonrd/abdonrd-patch-1
Update .travis.yml and add ESLint
2 parents 39ee6c7 + ea8567a commit 2f88234

File tree

4 files changed

+42
-15
lines changed

4 files changed

+42
-15
lines changed

.eslintrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "ibmresearch/html",
3+
"globals": {
4+
"Polymer": false
5+
}
6+
}

.travis.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
sudo: required
2-
dist: trusty
31
language: node_js
4-
node_js:
5-
- '6'
2+
dist: trusty
3+
sudo: false
4+
node_js: stable
5+
cache:
6+
directories:
7+
- "node_modules"
68
addons:
7-
firefox: '46.0'
9+
firefox: latest
810
apt:
911
sources:
10-
- google-chrome
12+
- google-chrome
1113
packages:
12-
- google-chrome-stable
13-
cache:
14-
directories:
15-
- node_modules
14+
- google-chrome-stable
1615
install:
17-
- npm install -g web-component-tester
18-
- npm install -g bower
19-
- bower install
16+
- npm install -g polymer-cli
17+
- npm install -g eslint eslint-plugin-html eslint-config-ibmresearch
18+
- polymer install --variants
19+
before_script:
20+
- eslint . --ext js,html --ignore-path .gitignore
2021
script:
21-
- xvfb-run wct
22+
- xvfb-run polymer test

gdg-logo.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
</template>
4444

4545
<script>
46+
/* global WebFont:false */
47+
4648
Polymer({
4749
is: 'gdg-logo',
4850

@@ -118,6 +120,7 @@
118120
}
119121
},
120122

123+
// eslint-disable-next-line max-len
121124
_computedResourcesLoaded: function(_fontLoaded, _gdgIconLoaded, _gdgLogotypeLoaded) {
122125
if (_fontLoaded && _gdgIconLoaded && _gdgLogotypeLoaded) {
123126
this._drawImage();
@@ -153,10 +156,17 @@
153156
},
154157

155158
_drawImage: function() {
159+
var canvasWith;
160+
156161
var ctx = this._canvas.getContext('2d');
157162
ctx.font = '128px "Product Sans"';
158163

159-
var canvasWith = this.name ? (ctx.measureText(this.name).width + 460 + 128) : (532 + 15);
164+
if (this.name) {
165+
canvasWith = ctx.measureText(this.name).width + 460 + 128;
166+
} else {
167+
canvasWith = 532 + 15;
168+
}
169+
160170
this._canvas.setAttribute('width', canvasWith * this._scale);
161171
this._canvas.setAttribute('height', 190 * this._scale);
162172

test/.eslintrc.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"env": {
3+
"mocha": true
4+
},
5+
"globals": {
6+
"assert": false,
7+
"fixture": false,
8+
"WCT": false
9+
}
10+
}

0 commit comments

Comments
 (0)