Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ib/eslint #7463

Merged
merged 3 commits into from Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/gallery/build-tools/constants.js
Expand Up @@ -4,7 +4,7 @@ const PORT = 3000;
const INPUT_DIR = 'src';
const IMAGE_DIR = 'images';

/* eslint-disable */
/* eslint-disable-next-line */
const MAPBOX_TOKEN = process.env.MapboxAccessToken;
if (!MAPBOX_TOKEN) {
console.log('Missing environment variable: MapboxAccessToken');
Expand Down
2 changes: 1 addition & 1 deletion examples/layer-browser/src/app.js
Expand Up @@ -160,7 +160,7 @@ export default class App extends PureComponent {
return new Layer(layerProps);
}

/* eslint-disable max-depth */
/* eslint-disable-next-line max-depth */
_renderExamples() {
let index = 1;
const layers = [
Expand Down
2 changes: 1 addition & 1 deletion examples/layer-browser/src/components/layer-controls.js
Expand Up @@ -215,7 +215,7 @@ export default class LayerControls extends PureComponent {
);
}

/* eslint-disable complexity */
/* eslint-disable-next-line complexity */
_renderSetting({settingName, value, propType, data, transitions}) {
const originalValue = value;

Expand Down
2 changes: 1 addition & 1 deletion examples/layer-browser/src/examples/additional-layers.js
Expand Up @@ -122,8 +122,8 @@ const TripsLayerExample = {
}
};

/* eslint-disable quote-props */
export default {
/* eslint-disable-next-line quote-props */
'Geo Layers': {
S2Layer: S2LayerExample,
QuadkeyLayer: QuadkeyLayerExample,
Expand Down
3 changes: 1 addition & 2 deletions examples/website/plot/plot-layer/surface-layer.js
Expand Up @@ -41,7 +41,6 @@ export default class SurfaceLayer extends Layer {
const attributeManager = this.getAttributeManager();
const noAlloc = true;

/* eslint-disable max-len */
attributeManager.add({
indices: {size: 1, isIndexed: true, update: this.calculateIndices, noAlloc},
positions: {size: 4, accessor: 'getPosition', update: this.calculatePositions, noAlloc},
Expand Down Expand Up @@ -176,7 +175,7 @@ export default class SurfaceLayer extends Layer {
}

// the fourth component is a flag for invalid z (NaN or Infinity)
/* eslint-disable max-statements */
/* eslint-disable-next-line max-statements */
calculatePositions(attribute) {
const {vertexCount} = this.state;
const {uCount, vCount, getPosition, xScale, yScale, zScale} = this.props;
Expand Down
1 change: 0 additions & 1 deletion examples/website/point-cloud/app.js
@@ -1,4 +1,3 @@
/* eslint-disable no-unused-vars */
import React, {useState, useEffect} from 'react';
import {render} from 'react-dom';
import DeckGL from '@deck.gl/react';
Expand Down
1 change: 0 additions & 1 deletion examples/website/tagmap/app.js
@@ -1,4 +1,3 @@
/* eslint-disable max-len */
import React from 'react';
import {render} from 'react-dom';
import {StaticMap} from 'react-map-gl';
Expand Down
1 change: 0 additions & 1 deletion examples/website/tagmap/tagmap-layer/tagmap-layer.js
@@ -1,4 +1,3 @@
/* eslint-disable max-len */
import {CompositeLayer} from '@deck.gl/core';
import {TextLayer} from '@deck.gl/layers';
import {scaleQuantile} from 'd3-scale';
Expand Down
1 change: 0 additions & 1 deletion examples/website/tagmap/tagmap-layer/tagmap-wrapper.js
@@ -1,5 +1,4 @@
/* create a tagmap instance, set colorscheme, sizeMeasurer */
/* eslint-disable max-len */
/* global document */
import TagMap from 'tagmap.js';
import RBush from 'rbush';
Expand Down
Expand Up @@ -57,7 +57,7 @@ export function pointToDensityGridDataCPU(props, aggregationParams) {
* @param {function} getPosition - position accessor
* @returns {object} - grid hash and cell dimension
*/
/* eslint-disable max-statements, complexity */
/* eslint-disable-next-line max-statements, complexity */
function pointsToGridHashing(props, aggregationParams) {
const {data = [], cellSize} = props;
const {attributes, viewport, projectPoints, numInstances} = aggregationParams;
Expand Down
1 change: 0 additions & 1 deletion modules/aggregation-layers/src/index.ts
Expand Up @@ -17,7 +17,6 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
/* eslint-disable max-len */

export {default as ScreenGridLayer} from './screen-grid-layer/screen-grid-layer';
export {default as CPUGridLayer} from './cpu-grid-layer/cpu-grid-layer';
Expand Down
Expand Up @@ -6,7 +6,7 @@ function toFinite(n) {
}

// Parse input data to build positions, wights and bounding box.
/* eslint-disable max-statements */
/* eslint-disable-next-line max-statements */
export function getBoundingBox(attributes, vertexCount) {
// TODO - value might not exist (e.g. attribute transition)
const positions = attributes.positions.value;
Expand Down
8 changes: 6 additions & 2 deletions modules/core/package.json
Expand Up @@ -37,8 +37,12 @@
"dependencies": {
"@loaders.gl/core": "^3.2.10",
"@loaders.gl/images": "^3.2.10",
"@luma.gl/constants": "9.0.0-alpha.9",
"@luma.gl/core": "9.0.0-alpha.9",
"@luma.gl/api": "9.0.0-alpha.8",
"@luma.gl/constants": "9.0.0-alpha.8",
"@luma.gl/core": "9.0.0-alpha.8",
"@luma.gl/gltools": "9.0.0-alpha.8",
"@luma.gl/shadertools": "9.0.0-alpha.8",
"@luma.gl/webgl": "9.0.0-alpha.8",
"@math.gl/core": "^3.6.2",
"@math.gl/sun": "^3.6.2",
"@math.gl/web-mercator": "^3.6.2",
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/lib/attribute/attribute-manager.ts
Expand Up @@ -172,7 +172,8 @@ export default class AttributeManager {
debug(TRACE_INVALIDATE, this, 'all');
}

// Ensure all attribute buffers are updated from props or data.
/** Ensure all attribute buffers are updated from props or data. */
/* eslint-disable complexity */
update({
data,
numInstances,
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/lib/composite-layer.ts
Expand Up @@ -151,8 +151,8 @@ export default abstract class CompositeLayer<PropsT = {}> extends Layer<
return accessor;
}

// eslint-disable-next-line complexity
/** Returns sub layer props for a specific sublayer */
/* eslint-disable-next-line complexity */
protected getSubLayerProps(
sublayerProps: {
id?: string;
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/lib/deck-picker.ts
Expand Up @@ -182,8 +182,8 @@ export default class DeckPicker {
return pickableLayers.length ? pickableLayers : null;
}

// eslint-disable-next-line max-statements,complexity
/** Pick the closest object at the given coordinate */
/* eslint-disable-next-line max-statements,complexity */
_pickClosestObject({
layers,
views,
Expand Down
8 changes: 4 additions & 4 deletions modules/core/src/lib/deck.ts
Expand Up @@ -737,14 +737,14 @@ export default class Deck {

private _createAnimationLoop(props: DeckProps): AnimationLoop {
const {
width,
height,
// width,
// height,
gl,
glOptions,
debug,
onError,
onBeforeRender,
onAfterRender,
// onBeforeRender,
// onAfterRender,
useDevicePixels
} = props;

Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/lib/layer.ts
Expand Up @@ -449,8 +449,8 @@ export default abstract class Layer<PropsT = {}> extends Component<PropsT & Requ
return params.changeFlags.propsOrDataChanged;
}

/* eslint-disable-next-line complexity */
/** Default implementation, all attributes will be invalidated and updated when data changes */
/* eslint-disable-next-line complexity */
updateState(params: UpdateParameters<Layer<PropsT>>): void {
const attributeManager = this.getAttributeManager();
const {dataChanged} = params.changeFlags;
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/shaderlib/shadow/shadow.ts
Expand Up @@ -178,7 +178,7 @@ function getViewProjectionMatrices({
return projectionMatrices;
}

/* eslint-disable camelcase */
/* eslint-disable camelcase, complexity */
function createShadowUniforms(
opts: ShadowModuleSettings,
context: ProjectUniforms
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/viewports/viewport.ts
Expand Up @@ -178,6 +178,7 @@ export default class Viewport {

private _frustumPlanes: {[name: string]: FrustumPlane} = {};

/* eslint-disable complexity */
constructor(opts: ViewportOptions = {}) {
// @ts-ignore
this.id = opts.id || this.constructor.displayName || 'viewport';
Expand Down
2 changes: 1 addition & 1 deletion modules/geo-layers/src/h3-layers/h3-cluster-layer.ts
@@ -1,7 +1,7 @@
import {h3SetToMultiPolygon, H3IndexInput} from 'h3-js';

import {AccessorFunction, createIterable, UpdateParameters, DefaultProps} from '@deck.gl/core';
import {H3HexagonLayer} from '@deck.gl/geo-layers';
import H3HexagonLayer from '../h3-layers/h3-hexagon-layer';
import GeoCellLayer, {GeoCellLayerProps} from '../geo-cell-layer/GeoCellLayer';

const defaultProps: DefaultProps<H3ClusterLayerProps> = {
Expand Down
2 changes: 1 addition & 1 deletion modules/jupyter-widget/src/playground/create-deck.js
Expand Up @@ -16,7 +16,7 @@ import {addSupportComponents} from '../lib/components/index';
import * as deck from '../deck-bundle';

const classesFilter = x => x.charAt(0) === x.charAt(0).toUpperCase();
const functionsFilter = x => x.charAt(0) === x.charAt(0).toLowerCase() && x.charAt(0) != '_';
const functionsFilter = x => x.charAt(0) === x.charAt(0).toLowerCase() && x.charAt(0) !== '_';

function extractElements(library = {}, filter) {
// Extracts exported elements as a dictionary from a library
Expand Down
2 changes: 1 addition & 1 deletion modules/layers/src/geojson-layer/geojson.ts
Expand Up @@ -94,7 +94,7 @@ export function separateGeojsonFeatures(

if (!geometry) {
// geometry can be null per specification
continue;
continue; // eslint-disable-line
}

if (geometry.type === 'GeometryCollection') {
Expand Down
3 changes: 2 additions & 1 deletion modules/layers/src/solid-polygon-layer/polygon.ts
Expand Up @@ -316,9 +316,10 @@ function permutePositions(positions: NumericArray, xIndex: number, yIndex: numbe
}
}

/*
/**
* Get vertex indices for drawing polygon mesh (triangulation)
*/
/* eslint-disable complexity, max-statements */
export function getSurfaceIndices(
polygon: NormalizedPolygonGeometry,
positionSize: number,
Expand Down
Expand Up @@ -26,7 +26,6 @@ import fs from './multi-icon-layer-fragment.glsl';

import type {IconLayerProps} from '../../icon-layer/icon-layer';
import type {Accessor, Color, UpdateParameters, DefaultProps} from '@deck.gl/core';
import {Character} from '../utils';

// TODO expose as layer properties
const DEFAULT_BUFFER = 192.0 / 256;
Expand Down
1 change: 1 addition & 0 deletions modules/main/bundle.ts
@@ -1,3 +1,4 @@
/* global window */
const deck = require('../core/bundle');

Object.assign(
Expand Down
1 change: 1 addition & 0 deletions modules/mapbox/package.json
Expand Up @@ -30,6 +30,7 @@
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env.dev"
},
"dependencies": {
"@math.gl/web-mercator": "^3.6.2",
"@types/mapbox-gl": "^2.6.3"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions modules/mapbox/src/resolve-layers.ts
Expand Up @@ -7,6 +7,7 @@ import type {Map} from 'mapbox-gl';
const UNDEFINED_BEFORE_ID = '__UNDEFINED__';

/** Insert Deck layers into the mapbox Map according to the user-defined order */
/* eslint-disable complexity, max-statements */
export function resolveLayers(
map?: Map,
deck?: Deck,
Expand Down
2 changes: 1 addition & 1 deletion test/modules/core/effects/lighting-effect.spec.ts
@@ -1,5 +1,5 @@
import test from 'tape-promise/tape';
import LightingEffect from '@deck.gl/core/effects/lighting/lighting-effect';
import {LightingEffect} from '@deck.gl/core';
import {_CameraLight as CameraLight, DirectionalLight, PointLight} from '@deck.gl/core';
import {MapView, LayerManager} from '@deck.gl/core';
import {PolygonLayer} from '@deck.gl/layers';
Expand Down
1 change: 1 addition & 0 deletions test/modules/mapbox/mapbox-gl-mock/evented.js
Expand Up @@ -66,6 +66,7 @@ export class Evented {
return this;
}

/* eslint-disable complexity */
fire(event, properties) {
// Compatibility with (type: string, properties: Object) signature from previous versions.
// See https://github.com/mapbox/mapbox-gl-js/issues/6522,
Expand Down