Skip to content

Commit

Permalink
chore: Linter upgrades and license texts (#1827)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen authored Nov 1, 2023
1 parent dc82865 commit 83478bb
Show file tree
Hide file tree
Showing 154 changed files with 543 additions and 284 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ module.exports = getESLintConfig({
{
files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
rules: {
// typescript-eslint 6.0
'@typescript-eslint/no-unsafe-argument': 0,
'@typescript-eslint/no-redundant-type-constituents': 0,
'@typescript-eslint/no-unsafe-enum-comparison': 1,
'@typescript-eslint/no-duplicate-type-constituents': 1,
'@typescript-eslint/no-base-to-string': 1,
'@typescript-eslint/no-loss-of-precision': 1,
'@typescript-eslint/no-duplicate-enum-values': 0,

'consistent-return': 0, // We use typescript noImplicitReturn
'default-case': 0, // We rely on typescript
'import/no-unresolved': 0,
Expand Down
2 changes: 1 addition & 1 deletion .ocularrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {resolve} from 'path';

export default {
lint: {
paths: ['modules', 'docs', 'test', 'examples'],
paths: ['modules'], // , 'docs', 'test', 'examples'],
extensions: ['js', 'ts']
},

Expand Down
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2020 OpenJS Foundation
luma.gl is provided under the MIT license

Copyright (c) 2020 vis.gl contributors

This software includes parts initially developed by Uber and open sourced under MIT license.
Expand Down
1 change: 1 addition & 0 deletions examples/tutorials/shader-hooks/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {Buffer, NumberArray, UniformStore} from '@luma.gl/core';
import {AnimationLoopTemplate, AnimationProps, Model} from '@luma.gl/engine';
Expand Down
1 change: 1 addition & 0 deletions modules/core-tests/test/adapter/resources/buffer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {Buffer} from '@luma.gl/core';
import {WEBGLBuffer} from '@luma.gl/webgl';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {getWebGLTestDevices} from '@luma.gl/test-utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {log} from '../../lib/utils/log';
import type {ShaderLayout, AttributeDeclaration} from '../types/shader-layout';
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/adapter/resources/framebuffer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {ColorTextureFormat, DepthStencilTextureFormat, TextureFormat} from '../types/texture-formats';
import type {Device} from '../device';
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/adapter/resources/sampler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {Device} from '../device';
import {CompareFunction} from '../types/parameters';
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/adapter/type-utils/decode-shader-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {assert} from '../../lib/utils/assert';
import {ShaderUniformType, ShaderDataType} from '../types/shader-types';
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/adapter/types/shader-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

/**
* Primitive data types understood by shaders
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/adapter/types/texture-formats.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

/** Texture formats */
export type TextureFormat = ColorTextureFormat | DepthStencilTextureFormat;
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/adapter/types/vertex-formats.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

/** Basic data types signed and unsigned integers, and floats, of varying sizes */
export type DataType =
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

export {VERSION} from './init';

Expand Down
1 change: 1 addition & 0 deletions modules/core/src/lib/compiler-log/compiler-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

/** WebGPU style compiler message */
export type CompilerMessage = {
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/lib/luma.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {Device, DeviceProps} from '../adapter/device';
import {DEFAULT_DEVICE_PROPS} from '../adapter/device';
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/lib/utils/array-equal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {isNumberArray} from '../utils/is-array';

Expand Down
1 change: 1 addition & 0 deletions modules/core/src/lib/utils/array-utils-flat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {TypedArray, NumberArray} from '../../types';

Expand Down
1 change: 1 addition & 0 deletions modules/core/src/lib/utils/load-file.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

let pathPrefix = '';

Expand Down
1 change: 1 addition & 0 deletions modules/core/src/lib/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

const uidCounters: Record<string, number> = {};

Expand Down
1 change: 1 addition & 0 deletions modules/core/test/adapter/canvas-context.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {CanvasContext, Framebuffer} from '@luma.gl/core';
Expand Down
1 change: 1 addition & 0 deletions modules/core/test/lib/utils/array-utils-flat.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {fillArray} from '@luma.gl/core';
Expand Down
1 change: 1 addition & 0 deletions modules/core/test/lib/utils/format-value.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {formatValue} from '@luma.gl/core';
Expand Down
1 change: 1 addition & 0 deletions modules/engine/src/animation-loop/animation-loop.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {luma, Device} from '@luma.gl/core';
import {requestAnimationFrame, cancelAnimationFrame} from '@luma.gl/core';
Expand Down
1 change: 1 addition & 0 deletions modules/engine/src/animation/timeline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

/**
* Timeline channel properties
Expand Down
1 change: 1 addition & 0 deletions modules/engine/src/model/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {
TypedArray,
Expand Down
1 change: 1 addition & 0 deletions modules/engine/src/transform/transform.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {Device, Buffer, Texture, Framebuffer} from '@luma.gl/core';
import {GLParameters} from '@luma.gl/constants';
Expand Down
1 change: 1 addition & 0 deletions modules/engine/test/scenegraph/group-node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {getWebGLTestDevices} from '@luma.gl/test-utils';
Expand Down
1 change: 1 addition & 0 deletions modules/engine/test/scenegraph/model-node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {getWebGLTestDevices} from '@luma.gl/test-utils';
Expand Down
1 change: 1 addition & 0 deletions modules/engine/test/scenegraph/scenegraph-node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {ScenegraphNode} from '@luma.gl/engine';
Expand Down
1 change: 1 addition & 0 deletions modules/shadertools/src/lib/glsl-utils/get-shader-info.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

/** Information extracted from shader source code */
export type ShaderInfo = {
Expand Down
1 change: 1 addition & 0 deletions modules/shadertools/src/lib/shader-assembler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {ShaderModule} from './shader-module/shader-module';
import type {PlatformInfo} from './shader-assembly/platform-info';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {glsl} from '../glsl-utils/highlight';
import { PlatformInfo } from './platform-info';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

/**
* PlatformInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {ShaderInjection} from './shader-injections';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {MODULE_INJECTORS_VS, MODULE_INJECTORS_FS} from '../../module-injectors';
import {assert} from '../utils/assert';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {ShaderModule} from '../shader-module/shader-module';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {UniformFormat} from '../../../types';
import {ShaderModule, UniformValue} from '../../../lib/shader-module/shader-module';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {ShaderModule} from '../../../lib/shader-module/shader-module';
import {capitalize} from '../utils/capitalize';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {assert} from '../utils/assert';
import {makePropValidators, getValidatedProperties, PropValidator} from '../filters/prop-types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {NumericArray as NumberArray, Matrix4, Vector3} from '@math.gl/core';
import {ShaderModule} from '../../../lib/shader-module/shader-module';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {glsl} from '../../../lib/glsl-utils/highlight';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {NumberArray} from '@math.gl/types';
import {ShaderModule} from '../../../lib/shader-module/shader-module';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {glsl} from '../../../lib/glsl-utils/highlight';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {ShaderModule} from '../../../lib/shader-module/shader-module';
import {lighting} from '../lights/lighting-uniforms';
Expand Down
1 change: 1 addition & 0 deletions modules/shadertools/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

// MATH TYPES
export {TypedArray, NumberArray, NumericArray} from '@math.gl/types';
Expand Down
1 change: 1 addition & 0 deletions modules/shadertools/test/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

// utils
import './lib/glsl-utils/get-shader-info.spec';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {ShaderModule, generateShaderForModule, ShaderGenerationOptions} from '@luma.gl/shadertools';
Expand Down
1 change: 1 addition & 0 deletions modules/shadertools/test/modules-ubo/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

// Light and picking
import './dirlight/dirlight.spec';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import test from 'tape-promise/tape';
import {webgl2Device} from '@luma.gl/test-utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

// Actual tests for different arithmetic functions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

// Tests for fp64 analytic functions
// TODO - enable these
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

// Special utility functions for df64 tests

Expand Down
1 change: 1 addition & 0 deletions modules/shadertools/test/modules/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import './modules.spec';

Expand Down
6 changes: 3 additions & 3 deletions modules/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"gl": "^6.0.1"
},
"peerDependencies": {
"@luma.gl/core": "9.0.0-alpha.38",
"@luma.gl/webgl": "9.0.0-alpha.38",
"@luma.gl/webgpu": "9.0.0-alpha.38",
"@luma.gl/core": "9.0.0-alpha.39",
"@luma.gl/webgl": "9.0.0-alpha.39",
"@luma.gl/webgpu": "9.0.0-alpha.39",
"@probe.gl/test-utils": "^4.0.2"
},
"engines_comment": [
Expand Down
1 change: 1 addition & 0 deletions modules/test-utils/src/create-test-device.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {Device, DeviceProps} from '@luma.gl/core';
import {luma} from '@luma.gl/core';
Expand Down
1 change: 1 addition & 0 deletions modules/test-utils/src/performance-test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {Stats, Stat} from '@probe.gl/stats';
import {TestRunner, TestRunnerProps, TestRunnerTestCase} from './test-runner';
Expand Down
1 change: 1 addition & 0 deletions modules/test-utils/src/register-devices.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {luma} from '@luma.gl/core';
import {WebGLDevice, registerHeadlessGL} from '@luma.gl/webgl';
Expand Down
3 changes: 3 additions & 0 deletions modules/webgl/src/adapter/converters/device-parameters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {
Device,
Parameters,
Expand Down
3 changes: 3 additions & 0 deletions modules/webgl/src/adapter/converters/sampler-parameters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

// SAMPLER FILTERS
import {SamplerParameters} from '@luma.gl/core';
import {GL, GLSamplerParameters} from '@luma.gl/constants';
Expand Down
3 changes: 3 additions & 0 deletions modules/webgl/src/adapter/converters/shader-formats.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import {GL} from '@luma.gl/constants';
import {ShaderAttributeType, ShaderDataType} from '@luma.gl/core';

Expand Down
3 changes: 3 additions & 0 deletions modules/webgl/src/adapter/converters/texture-formats.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// luma.gl, MIT license
// Copyright (c) vis.gl contributors

import type {TextureFormat, DeviceFeature} from '@luma.gl/core';
import {decodeTextureFormat} from '@luma.gl/core';
import {GL} from '@luma.gl/constants';
Expand Down
Loading

0 comments on commit 83478bb

Please sign in to comment.