Skip to content

Commit

Permalink
Merge pull request #7809 from AnalyticalGraphicsInc/eslint-updates
Browse files Browse the repository at this point in the history
eslint configuration updates and fixes
  • Loading branch information
Hannah authored May 3, 2019
2 parents 284b70b + 8034629 commit a35f010
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 28 deletions.
24 changes: 12 additions & 12 deletions Apps/Sandcastle/gallery/Imagery Layers Split.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,31 @@
var moveActive = false;

function move(movement) {
if(!moveActive) {
return;
}

var relativeOffset = movement.endPosition.x ;
var splitPosition = (slider.offsetLeft + relativeOffset) / slider.parentElement.offsetWidth;
slider.style.left = 100.0 * splitPosition + '%';
viewer.scene.imagerySplitPosition = splitPosition;
if(!moveActive) {
return;
}

var relativeOffset = movement.endPosition.x ;
var splitPosition = (slider.offsetLeft + relativeOffset) / slider.parentElement.offsetWidth;
slider.style.left = 100.0 * splitPosition + '%';
viewer.scene.imagerySplitPosition = splitPosition;
}

handler.setInputAction(function() {
moveActive = true;
moveActive = true;
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
handler.setInputAction(function() {
moveActive = true;
moveActive = true;
}, Cesium.ScreenSpaceEventType.PINCH_START);

handler.setInputAction(move, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
handler.setInputAction(move, Cesium.ScreenSpaceEventType.PINCH_MOVE);

handler.setInputAction(function() {
moveActive = false;
moveActive = false;
}, Cesium.ScreenSpaceEventType.LEFT_UP);
handler.setInputAction(function() {
moveActive = false;
moveActive = false;
}, Cesium.ScreenSpaceEventType.PINCH_END);

//Sandcastle_End
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Vector3DTilePolygons.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ define([
var minimumHeights = polygons._polygonMinimumHeights;
var maximumHeights = polygons._polygonMaximumHeights;
if (defined(minimumHeights) && defined(maximumHeights)) {
minimumHeights = arraySlice(minimumHeights);
maximumHeights = arraySlice(maximumHeights);
minimumHeights = arraySlice(minimumHeights);
maximumHeights = arraySlice(maximumHeights);

transferrableObjects.push(minimumHeights.buffer, maximumHeights.buffer);
parameters.minimumHeights = minimumHeights;
Expand Down
22 changes: 11 additions & 11 deletions Specs/DataSources/KmlDataSourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3866,16 +3866,16 @@ defineSuite([
});
});

it('can load styles from a KML file with namespaces', function() {
return KmlDataSource.load('Data/KML/namespaced.kml', options).then(function(dataSource) {
console.debug(dataSource.entities.values[2]);
var polyline = dataSource.entities.values[2].polyline;
var expectedColor = Color.fromBytes(0xff, 0x00, 0xff, 0x00);
var polylineColor = polyline.material.color.getValue();
expect(polylineColor).toEqual(expectedColor);
expect(polyline.width.getValue()).toEqual(10);
});
});
it('can load styles from a KML file with namespaces', function() {
return KmlDataSource.load('Data/KML/namespaced.kml', options).then(function(dataSource) {
console.debug(dataSource.entities.values[2]);
var polyline = dataSource.entities.values[2].polyline;
var expectedColor = Color.fromBytes(0xff, 0x00, 0xff, 0x00);
var polylineColor = polyline.material.color.getValue();
expect(polylineColor).toEqual(expectedColor);
expect(polyline.width.getValue()).toEqual(10);
});
});

it('Boolean values can use true string', function() {
var kml = '<?xml version="1.0" encoding="UTF-8"?>\
Expand Down Expand Up @@ -3960,7 +3960,7 @@ defineSuite([
return KmlDataSource.load(parser.parseFromString(kml, 'text/xml'), options).then(function(dataSource) {
expect(dataSource.entities.values.length).toEqual(1);
expect(console.warn.calls.count()).toEqual(1);
expect(console.warn).toHaveBeenCalledWith('KML - Unsupported Icon refreshMode: onInterval');
expect(console.warn).toHaveBeenCalledWith('KML - Unsupported Icon refreshMode: onInterval');
});
});

Expand Down
2 changes: 1 addition & 1 deletion Specs/customizeJasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define([
define(deps, function() {
var args = arguments;
if (focus) {
fdescribe(name, function() {
fdescribe(name, function() { //eslint-disable-line
suite.apply(null, args);
}, categories);
} else {
Expand Down
5 changes: 5 additions & 0 deletions Tools/eslint-config-cesium/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Log
==========

### 7.0.0 - 2019-05-03
* Update Node ecmaVersion to '2019'.
* Enable [no-tabs](https://eslint.org/docs/rules/no-tabs).
* Enabled [no-restricted-globals](https://eslint.org/docs/rules/no-restricted-globals) for jasmine `fit` and `fdescribe`.

### 6.0.1 - 2019-01-23
* Allow ES6 global variables in Node.js code.

Expand Down
2 changes: 2 additions & 0 deletions Tools/eslint-config-cesium/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ module.exports = {
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
'no-new': 'error',
'no-sequences': 'error',
'no-tabs': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-restricted-globals': ["error", "fdescribe", "fit"],
'no-unused-expressions': 'error',
'no-unused-vars': ['error', {vars: 'all', args: 'all'}],
'no-useless-escape': 'off',
Expand Down
2 changes: 1 addition & 1 deletion Tools/eslint-config-cesium/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
es6: true
},
parserOptions: {
ecmaVersion: 2017
ecmaVersion: 2019
},
rules: {
'global-require': 'error',
Expand Down
2 changes: 1 addition & 1 deletion Tools/eslint-config-cesium/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-cesium",
"version": "6.0.1",
"version": "7.0.0",
"description": "ESLint shareable configs for Cesium",
"homepage": "http://cesiumjs.org",
"license": "Apache-2.0",
Expand Down

0 comments on commit a35f010

Please sign in to comment.