Skip to content

Commit

Permalink
Use eslint object-curly-spacing to enforce no extra space in curly br…
Browse files Browse the repository at this point in the history
…aces
  • Loading branch information
Asheem Mamoowala committed Aug 28, 2019
1 parent 6275d07 commit 3c5455a
Show file tree
Hide file tree
Showing 334 changed files with 1,779 additions and 1,779 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}],
"no-unused-vars": ["error", {"argsIgnorePattern": "^_$"}],
"no-warning-comments": "error",
"object-curly-spacing": "off",
"object-curly-spacing": ["error", "never"],
"prefer-arrow-callback": "error",
"prefer-const": ["error", {"destructuring": "all"}],
"prefer-template": "error",
Expand Down
4 changes: 2 additions & 2 deletions bench/benchmarks/expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Benchmark from '../lib/benchmark';

import spec from '../../src/style-spec/reference/latest';
import convertFunction from '../../src/style-spec/function/convert';
import { isFunction, createFunction } from '../../src/style-spec/function';
import { createPropertyExpression } from '../../src/style-spec/expression';
import {isFunction, createFunction} from '../../src/style-spec/function';
import {createPropertyExpression} from '../../src/style-spec/expression';
import fetchStyle from '../lib/fetch_style';

import type {StyleSpecification} from '../../src/style-spec/types';
Expand Down
4 changes: 2 additions & 2 deletions bench/benchmarks/filter_evaluate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import Benchmark from '../lib/benchmark';
import { VectorTile } from '@mapbox/vector-tile';
import {VectorTile} from '@mapbox/vector-tile';
import Pbf from 'pbf';
import createFilter from '../../src/style-spec/feature_filter';
import filters from '../data/filters.json';
Expand Down Expand Up @@ -30,7 +30,7 @@ export default class FilterEvaluate extends Benchmark {
}
}

this.layers.push({ features, filters: layerFilters });
this.layers.push({features, filters: layerFilters});
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {StyleSpecification} from '../../src/style-spec/types';
import Benchmark from '../lib/benchmark';
import fetchStyle from '../lib/fetch_style';
import TileParser from '../lib/tile_parser';
import { OverscaledTileID } from '../../src/source/tile_id';
import {OverscaledTileID} from '../../src/source/tile_id';

export default class Layout extends Benchmark {
tiles: Array<{tileID: OverscaledTileID, buffer: ArrayBuffer}>;
Expand Down
4 changes: 2 additions & 2 deletions bench/benchmarks/layout_dds.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Benchmark from '../lib/benchmark';
import TileParser from '../lib/tile_parser';
import { OverscaledTileID } from '../../src/source/tile_id';
import {OverscaledTileID} from '../../src/source/tile_id';

const LAYER_COUNT = 2;

Expand All @@ -18,7 +18,7 @@ export default class LayoutDDS extends Benchmark {
const styleJSON = {
"version": 8,
"sources": {
"mapbox": { "type": "vector", "url": "mapbox://mapbox.mapbox-streets-v7" }
"mapbox": {"type": "vector", "url": "mapbox://mapbox.mapbox-streets-v7"}
},
"layers": []
};
Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/paint_states.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class PaintStates extends Benchmark {
this.map._sourcesDirty = true;
this.map._render();
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.setFeatureState({ source: 'land', id: i }, { bench: true });
this.map.setFeatureState({source: 'land', id: i}, {bench: true});
}
this.map._render();
}
Expand Down
12 changes: 6 additions & 6 deletions bench/benchmarks/remove_paint_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ export class PropertyLevelRemove extends RemovePaintState {
bench() {

for (let i = 0; i < this.numFeatures; i += 50) {
this.map.setFeatureState({ source: 'land', id: i }, { bench: true });
this.map.setFeatureState({source: 'land', id: i}, {bench: true});
}
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.removeFeatureState({ source: 'land', id: i }, 'bench');
this.map.removeFeatureState({source: 'land', id: i}, 'bench');
}
this.map._render();

Expand All @@ -86,10 +86,10 @@ export class FeatureLevelRemove extends RemovePaintState {
bench() {

for (let i = 0; i < this.numFeatures; i += 50) {
this.map.setFeatureState({ source: 'land', id: i }, { bench: true });
this.map.setFeatureState({source: 'land', id: i}, {bench: true});
}
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.removeFeatureState({ source: 'land', id: i });
this.map.removeFeatureState({source: 'land', id: i});
}
this.map._render();

Expand All @@ -100,10 +100,10 @@ export class SourceLevelRemove extends RemovePaintState {
bench() {

for (let i = 0; i < this.numFeatures; i += 50) {
this.map.setFeatureState({ source: 'land', id: i }, { bench: true });
this.map.setFeatureState({source: 'land', id: i}, {bench: true});
}
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.removeFeatureState({ source: 'land', id: i });
this.map.removeFeatureState({source: 'land', id: i});
}
this.map._render();

Expand Down
4 changes: 2 additions & 2 deletions bench/benchmarks/symbol_layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import Layout from './layout';
import SymbolBucket from '../../src/data/bucket/symbol_bucket';
import { performSymbolLayout } from '../../src/symbol/symbol_layout';
import { OverscaledTileID } from '../../src/source/tile_id';
import {performSymbolLayout} from '../../src/symbol/symbol_layout';
import {OverscaledTileID} from '../../src/source/tile_id';

export default class SymbolLayout extends Layout {
parsedTiles: Array<any>;
Expand Down
6 changes: 3 additions & 3 deletions bench/benchmarks/worker_transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type {StyleSpecification} from '../../src/style-spec/types';
import Benchmark from '../lib/benchmark';
import fetchStyle from '../lib/fetch_style';
import TileParser from '../lib/tile_parser';
import { OverscaledTileID } from '../../src/source/tile_id';
import { serialize, deserialize } from '../../src/util/web_worker_transfer';
import { values } from '../../src/util/util';
import {OverscaledTileID} from '../../src/source/tile_id';
import {serialize, deserialize} from '../../src/util/web_worker_transfer';
import {values} from '../../src/util/util';

export default class WorkerTransfer extends Benchmark {
parser: TileParser;
Expand Down
10 changes: 5 additions & 5 deletions bench/benchmarks_view.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import * as d3 from 'd3';
import { kde, probabilitiesOfSuperiority, summaryStatistics, regression } from './lib/statistics';
import {kde, probabilitiesOfSuperiority, summaryStatistics, regression} from './lib/statistics';

const versionColor = d3.scaleOrdinal(['#1b9e77', '#7570b3', '#d95f02']);
const formatSample = d3.format(".3r");
Expand Down Expand Up @@ -224,12 +224,12 @@ class StatisticsPlot extends React.Component {
strokeWidth={bandwidth}
strokeOpacity={1} />
<use href="#up-arrow" // mean
style={{ stroke: color, fill: color, fillOpacity: 0.4 }}
style={{stroke: color, fill: color, fillOpacity: 0.4}}
transform={mean >= tMax ? 'translate(-10, 0)' : `translate(-5, ${t(mean)}) rotate(90)`}
x={0}
y={0} />
<use href="#up-arrow" // trimmed mean
style={{ stroke: color, fill: color }}
style={{stroke: color, fill: color}}
transform={`translate(-5, ${t(trimmedMean)}) rotate(90)`}
x={0}
y={0} />
Expand Down Expand Up @@ -275,7 +275,7 @@ class StatisticsPlot extends React.Component {
}

componentDidMount() {
this.setState({ width: this.ref.clientWidth });
this.setState({width: this.ref.clientWidth});
}
}

Expand Down Expand Up @@ -342,7 +342,7 @@ class RegressionPlot extends React.Component {
}

componentDidMount() {
this.setState({ width: this.ref.clientWidth });
this.setState({width: this.ref.clientWidth});
}
}

Expand Down
2 changes: 1 addition & 1 deletion bench/lib/fetch_style.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import type {StyleSpecification} from '../../src/style-spec/types';
import { RequestManager } from '../../src/util/mapbox';
import {RequestManager} from '../../src/util/mapbox';

const requestManager = new RequestManager();

Expand Down
8 changes: 4 additions & 4 deletions bench/lib/locations_with_tile_id.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import MercatorCoordinate from '../../src/geo/mercator_coordinate';
import { OverscaledTileID } from '../../src/source/tile_id';
import {OverscaledTileID} from '../../src/source/tile_id';

export default function locationsWithTileID(locations) {
return locations.map(feature => {
const { coordinates } = feature.geometry;
const { zoom } = feature.properties;
const { x, y } = MercatorCoordinate.fromLngLat({
const {coordinates} = feature.geometry;
const {zoom} = feature.properties;
const {x, y} = MercatorCoordinate.fromLngLat({
lng: coordinates[0],
lat: coordinates[1]
});
Expand Down
2 changes: 1 addition & 1 deletion bench/lib/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function leastSquaresRegression(data) {
const slope = covariance / varianceX;
const intercept = meanY - slope * meanX;

return { correlation, slope, intercept, data };
return {correlation, slope, intercept, data};
}

export function kde(samples, summary, ticks) {
Expand Down
12 changes: 6 additions & 6 deletions bench/lib/tile_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import assert from 'assert';

import deref from '../../src/style-spec/deref';
import Style from '../../src/style/style';
import { Evented } from '../../src/util/evented';
import { RequestManager } from '../../src/util/mapbox';
import {Evented} from '../../src/util/evented';
import {RequestManager} from '../../src/util/mapbox';
import WorkerTile from '../../src/source/worker_tile';
import StyleLayerIndex from '../../src/style/style_layer_index';

import type { StyleSpecification } from '../../src/style-spec/types';
import type { WorkerTileResult } from '../../src/source/worker_source';
import type { OverscaledTileID } from '../../src/source/tile_id';
import type { TileJSON } from '../../src/types/tilejson';
import type {StyleSpecification} from '../../src/style-spec/types';
import type {WorkerTileResult} from '../../src/source/worker_source';
import type {OverscaledTileID} from '../../src/source/tile_id';
import type {TileJSON} from '../../src/types/tilejson';

class StubMap extends Evented {
_requestManager: RequestManager;
Expand Down
2 changes: 1 addition & 1 deletion debug/7438.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
hash: true
});

map.addControl(new mapboxgl.ScaleControl({ unit: 'nautical' }));
map.addControl(new mapboxgl.ScaleControl({unit: 'nautical'}));

</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion debug/extrusion-query.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
window.addEventListener('mousemove', function(e) {
e.point = new mapboxgl.Point(e.clientX, e.clientY);
console.time('query');
const features = map.queryRenderedFeatures(e.point, { layers: ['3d-buildings'] });
const features = map.queryRenderedFeatures(e.point, {layers: ['3d-buildings']});
console.timeEnd('query');

for (const feature of hovered) {
Expand Down
2 changes: 1 addition & 1 deletion debug/multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"type": "line",
"source": "streets",
"source-layer": "road",
"paint": { "line-color": "rgb(55,89,144)", "line-width": 4 }
"paint": {"line-color": "rgb(55,89,144)", "line-width": 4}
}]
};

Expand Down
6 changes: 3 additions & 3 deletions debug/query_features.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@

map.addControl(new mapboxgl.NavigationControl());

var emptyFc = { type: 'FeatureCollection', features: [] };
var emptyFc = {type: 'FeatureCollection', features: []};

map.on('style.load', function() {
map.addSource('queried', { type: 'geojson', data: emptyFc });
map.addSource('queried', {type: 'geojson', data: emptyFc});
map.addLayer({
"id": "query",
"type": "line",
Expand All @@ -42,7 +42,7 @@
}
}, 'country-label-sm');

map.addSource('boxsource', { type: 'geojson', data: emptyFc });
map.addSource('boxsource', {type: 'geojson', data: emptyFc});
map.addLayer({
"id": "box",
"type": "fill",
Expand Down
2 changes: 1 addition & 1 deletion debug/textsize.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"features": [
{
"type": "Feature",
"properties": { "x": 0 },
"properties": {"x": 0},
"geometry": {
"type": "LineString",
"coordinates": [
Expand Down
2 changes: 1 addition & 1 deletion debug/threejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
this.scene = new THREE.Scene();

var geometry = new THREE.BoxGeometry(1, 1, 1);
var material = new THREE.MeshPhongMaterial({ color: 0xeeeeff });
var material = new THREE.MeshPhongMaterial({color: 0xeeeeff});
this.cube = new THREE.Mesh(geometry, material);
this.scene.add(this.cube);

Expand Down
2 changes: 1 addition & 1 deletion debug/update_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

setInterval(() => {
currentImage = (currentImage + 1) % frameCount;
map.getSource("radar").updateImage({ url: getPath() });
map.getSource("radar").updateImage({url: getPath()});
}, 200);
});

Expand Down
2 changes: 1 addition & 1 deletion src/data/bucket/circle_attributes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { createLayout } from '../../util/struct_array';
import {createLayout} from '../../util/struct_array';

const layout = createLayout([
{name: 'a_pos', components: 2, type: 'Int16'}
Expand Down
10 changes: 5 additions & 5 deletions src/data/bucket/circle_bucket.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @flow

import { CircleLayoutArray } from '../array_types';
import {CircleLayoutArray} from '../array_types';

import { members as layoutAttributes } from './circle_attributes';
import {members as layoutAttributes} from './circle_attributes';
import SegmentVector from '../segment';
import { ProgramConfigurationSet } from '../program_configuration';
import { TriangleIndexArray } from '../index_array_type';
import {ProgramConfigurationSet} from '../program_configuration';
import {TriangleIndexArray} from '../index_array_type';
import loadGeometry from '../load_geometry';
import EXTENT from '../extent';
import { register } from '../../util/web_worker_transfer';
import {register} from '../../util/web_worker_transfer';
import EvaluationParameters from '../../style/evaluation_parameters';

import type {
Expand Down
2 changes: 1 addition & 1 deletion src/data/bucket/fill_attributes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { createLayout } from '../../util/struct_array';
import {createLayout} from '../../util/struct_array';

const layout = createLayout([
{name: 'a_pos', components: 2, type: 'Int16'}
Expand Down
10 changes: 5 additions & 5 deletions src/data/bucket/fill_bucket.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// @flow

import { FillLayoutArray } from '../array_types';
import {FillLayoutArray} from '../array_types';

import { members as layoutAttributes } from './fill_attributes';
import {members as layoutAttributes} from './fill_attributes';
import SegmentVector from '../segment';
import { ProgramConfigurationSet } from '../program_configuration';
import { LineIndexArray, TriangleIndexArray } from '../index_array_type';
import {ProgramConfigurationSet} from '../program_configuration';
import {LineIndexArray, TriangleIndexArray} from '../index_array_type';
import earcut from 'earcut';
import classifyRings from '../../util/classify_rings';
import assert from 'assert';
const EARCUT_MAX_RINGS = 500;
import { register } from '../../util/web_worker_transfer';
import {register} from '../../util/web_worker_transfer';
import {hasPattern, addPatternDependencies} from './pattern_bucket_features';
import loadGeometry from '../load_geometry';
import EvaluationParameters from '../../style/evaluation_parameters';
Expand Down
2 changes: 1 addition & 1 deletion src/data/bucket/fill_extrusion_attributes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { createLayout } from '../../util/struct_array';
import {createLayout} from '../../util/struct_array';

const layout = createLayout([
{name: 'a_pos', components: 2, type: 'Int16'},
Expand Down
10 changes: 5 additions & 5 deletions src/data/bucket/fill_extrusion_bucket.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// @flow

import { FillExtrusionLayoutArray } from '../array_types';
import {FillExtrusionLayoutArray} from '../array_types';

import { members as layoutAttributes } from './fill_extrusion_attributes';
import {members as layoutAttributes} from './fill_extrusion_attributes';
import SegmentVector from '../segment';
import { ProgramConfigurationSet } from '../program_configuration';
import { TriangleIndexArray } from '../index_array_type';
import {ProgramConfigurationSet} from '../program_configuration';
import {TriangleIndexArray} from '../index_array_type';
import EXTENT from '../extent';
import earcut from 'earcut';
import mvt from '@mapbox/vector-tile';
const vectorTileFeatureTypes = mvt.VectorTileFeature.types;
import classifyRings from '../../util/classify_rings';
import assert from 'assert';
const EARCUT_MAX_RINGS = 500;
import { register } from '../../util/web_worker_transfer';
import {register} from '../../util/web_worker_transfer';
import {hasPattern, addPatternDependencies} from './pattern_bucket_features';
import loadGeometry from '../load_geometry';
import EvaluationParameters from '../../style/evaluation_parameters';
Expand Down
Loading

0 comments on commit 3c5455a

Please sign in to comment.