diff --git a/doc/generate-bibliography.js b/doc/generate-bibliography.js index 4fcb2b0..bf6e5a6 100644 --- a/doc/generate-bibliography.js +++ b/doc/generate-bibliography.js @@ -5,9 +5,7 @@ // Generates the bibliography for the Alpenglow documentation // Run with `node js/generate-bibliography.js` -/* eslint-env node */ - -const Cite = require( 'citation-js' ); // eslint-disable-line require-statement-match +const Cite = require( 'citation-js' ); // eslint-disable-line phet/require-statement-match const fs = require( 'fs' ); ( async () => { diff --git a/doc/index.js b/doc/index.js index 4a5d1d3..2d659e3 100644 --- a/doc/index.js +++ b/doc/index.js @@ -18,11 +18,11 @@ if ( window.usePhetLib ) { } // Otherwise, load from our transpilation (assuming for development mode) else { - alpenglow = ( await import( '../../chipper/dist/js/alpenglow/js/main.js' ) ).default; // eslint-disable-line bad-sim-text - ArrowNode = ( await import( '../../chipper/dist/js/scenery-phet/js/ArrowNode.js' ) ).default; // eslint-disable-line bad-sim-text - scenery = ( await import( '../../chipper/dist/js/scenery/js/main.js' ) ).default; // eslint-disable-line bad-sim-text - kite = ( await import( '../../chipper/dist/js/kite/js/main.js' ) ).default; // eslint-disable-line bad-sim-text - dot = ( await import( '../../chipper/dist/js/dot/js/main.js' ) ).default; // eslint-disable-line bad-sim-text + alpenglow = ( await import( '../../chipper/dist/js/alpenglow/js/main.js' ) ).default; // eslint-disable-line phet/bad-sim-text + ArrowNode = ( await import( '../../chipper/dist/js/scenery-phet/js/ArrowNode.js' ) ).default; // eslint-disable-line phet/bad-sim-text + scenery = ( await import( '../../chipper/dist/js/scenery/js/main.js' ) ).default; // eslint-disable-line phet/bad-sim-text + kite = ( await import( '../../chipper/dist/js/kite/js/main.js' ) ).default; // eslint-disable-line phet/bad-sim-text + dot = ( await import( '../../chipper/dist/js/dot/js/main.js' ) ).default; // eslint-disable-line phet/bad-sim-text } const Node = scenery.Node; @@ -246,7 +246,7 @@ window.createRenderProgramSandbox = ( id, func, width, height, providedOptions ) errorsContainerElement.style.display = 'none'; try { - // eslint-disable-next-line bad-sim-text + // eslint-disable-next-line phet/bad-sim-text const code = `${Math.random()}; let value = (${options.jsBefore} const dot = phet.dot; @@ -425,7 +425,7 @@ setTimeout( () => { } }; window.addDiagram = addDiagram; - // eslint-disable-next-line bad-sim-text + // eslint-disable-next-line phet/bad-sim-text window.pendingDiagrams.forEach( diagram => setTimeout( () => addDiagram( diagram.id, diagram.callback ), 0 ) ); }, 0 ); @@ -2383,7 +2383,7 @@ window.createSceneryDiagram = ( scene, width, height, needsWhiteBackground = fal renderProgram = new RenderNormalDebug( normalProgram ); } else if ( shadeType === 'random' ) { - // eslint-disable-next-line bad-sim-text + // eslint-disable-next-line phet/bad-sim-text renderProgram = new RenderColor( v4( Math.random(), Math.random(), Math.random(), 1 ) ); } diff --git a/doc/load-mermaid.js b/doc/load-mermaid.js index 55f00fd..468a79d 100644 --- a/doc/load-mermaid.js +++ b/doc/load-mermaid.js @@ -2,5 +2,5 @@ // @author Jonathan Olson -import mermaid from '../../sherpa/mermaid/mermaid.esm.min.mjs'; // eslint-disable-line default-import-match-filename +import mermaid from '../../sherpa/mermaid/mermaid.esm.min.mjs'; // eslint-disable-line phet/default-import-match-filename mermaid.initialize( { startOnLoad: true } ); \ No newline at end of file diff --git a/js/parallel/ParallelExecutor.ts b/js/parallel/ParallelExecutor.ts index 85e4078..dbbe582 100644 --- a/js/parallel/ParallelExecutor.ts +++ b/js/parallel/ParallelExecutor.ts @@ -25,7 +25,7 @@ import { alpenglow, BaseWorkgroupValues, ParallelContext, ParallelKernel, Parall import Random from '../../../dot/js/Random.js'; import Vector3 from '../../../dot/js/Vector3.js'; -// eslint-disable-next-line bad-sim-text +// eslint-disable-next-line phet/bad-sim-text const random = new Random(); const LOG = false; diff --git a/js/parallel/ParallelTests.ts b/js/parallel/ParallelTests.ts index b59548d..90bb75d 100644 --- a/js/parallel/ParallelTests.ts +++ b/js/parallel/ParallelTests.ts @@ -11,7 +11,7 @@ import { ParallelContext, ParallelExecutor, ParallelKernel, ParallelStorageArray, ParallelWorkgroupArray } from '../imports.js'; import Random from '../../../dot/js/Random.js'; -// eslint-disable-next-line bad-sim-text +// eslint-disable-next-line phet/bad-sim-text const random = new Random(); QUnit.module( 'Parallel' ); diff --git a/js/raster/Rasterize.ts b/js/raster/Rasterize.ts index 4575e78..d5fedda 100644 --- a/js/raster/Rasterize.ts +++ b/js/raster/Rasterize.ts @@ -1060,7 +1060,7 @@ export default class Rasterize { } else if ( options.edgeIntersectionSortMethod === 'random' ) { // NOTE: This is NOT designed for performance (it's for testing) - // eslint-disable-next-line bad-sim-text + // eslint-disable-next-line phet/bad-sim-text const shuffled = _.shuffle( integerEdges ); integerEdges.length = 0; integerEdges.push( ...shuffled ); diff --git a/js/render-program/RenderProgram.ts b/js/render-program/RenderProgram.ts index 4754a30..647744f 100644 --- a/js/render-program/RenderProgram.ts +++ b/js/render-program/RenderProgram.ts @@ -6,7 +6,7 @@ * @author Jonathan Olson */ -// eslint-disable-next-line single-line-import +// eslint-disable-next-line phet/single-line-import import { alpenglow, ClippableFace, diff --git a/js/webgpu/FaceRasterizer.ts b/js/webgpu/FaceRasterizer.ts index 20978a3..384a57d 100644 --- a/js/webgpu/FaceRasterizer.ts +++ b/js/webgpu/FaceRasterizer.ts @@ -252,12 +252,12 @@ export default class FaceRasterizer { const renderableFaces = Rasterize.partitionRenderableFaces( program, bounds, { tileSize: 1024 * 1024, // don't do tiles by default - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...rasterizeOptions } ); return this.run( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...runOptions, renderableFaces: renderableFaces } ); diff --git a/js/webgpu/GPUProfiling.ts b/js/webgpu/GPUProfiling.ts index c230808..f8f0bf1 100644 --- a/js/webgpu/GPUProfiling.ts +++ b/js/webgpu/GPUProfiling.ts @@ -25,7 +25,7 @@ import { alpenglow, BufferArraySlot, BufferLogger, DeviceContext, getArrayType, Procedure, RadixSortModule, Routine, TimestampLogger, TimestampLoggerResult, U32Order, u32S } from '../imports.js'; import Random from '../../../dot/js/Random.js'; -// eslint-disable-next-line bad-sim-text +// eslint-disable-next-line phet/bad-sim-text const random = new Random(); class GPUProfiler { diff --git a/js/webgpu/PerformanceTesting.ts b/js/webgpu/PerformanceTesting.ts index 7633ab6..1e3af3e 100644 --- a/js/webgpu/PerformanceTesting.ts +++ b/js/webgpu/PerformanceTesting.ts @@ -19,7 +19,7 @@ export default class PerformanceTesting { const inputSize = 4000; // const inputSize = workgroupSize * workgroupSize * ( 6 ) - 27 * 301; // const inputSize = workgroupSize * workgroupSize * ( workgroupSize - 3 ) - 27 * 301; - // eslint-disable-next-line bad-sim-text + // eslint-disable-next-line phet/bad-sim-text const uintNumbers = new Uint32Array( _.range( 0, inputSize ).map( () => Math.floor( Math.random() * 1000000 ) ) ); const device = ( await DeviceContext.getDevice() )!; diff --git a/js/webgpu/WebGPURecorder.ts b/js/webgpu/WebGPURecorder.ts index 3f9736f..bdf9f5a 100644 --- a/js/webgpu/WebGPURecorder.ts +++ b/js/webgpu/WebGPURecorder.ts @@ -531,7 +531,7 @@ class WebGPUCommandDeviceCreateBuffer extends WebGPUCommand { return `${this.getDeclaration( nameMap )}${getName( nameMap, this.device )}.createBuffer( ${WebGPURecorder.rawValue( level, this.descriptor, nameMap, { usage: ( value: IntentionalAny ) => { const numberValue = value as number; - // eslint-disable-next-line no-simple-type-checking-assertions + // eslint-disable-next-line phet/no-simple-type-checking-assertions assert && assert( typeof value === 'number' ); return WebGPURecorder.bitfieldToString( numberValue, new Map( [ diff --git a/js/webgpu/compute/ByteEncoder.ts b/js/webgpu/compute/ByteEncoder.ts index 653230c..de57138 100644 --- a/js/webgpu/compute/ByteEncoder.ts +++ b/js/webgpu/compute/ByteEncoder.ts @@ -404,7 +404,7 @@ export default class ByteEncoder { let iLow = Math.max( 0, k - n ); let jLow = Math.max( 0, k - m ); let delta; - // eslint-disable-next-line no-constant-condition + // TODO: Where did no-constant-condition go? See https://github.com/phetsims/chipper/issues/1451 while ( true ) { if ( i > 0 && j < n && compare( i - 1, j ) > 0 ) { delta = ( i - iLow + 1 ) >> 1; diff --git a/js/webgpu/compute/ConcreteType.ts b/js/webgpu/compute/ConcreteType.ts index 59e10ad..fab1798 100644 --- a/js/webgpu/compute/ConcreteType.ts +++ b/js/webgpu/compute/ConcreteType.ts @@ -12,7 +12,7 @@ import Random from '../../../../dot/js/Random.js'; import Vector3 from '../../../../dot/js/Vector3.js'; import Vector4 from '../../../../dot/js/Vector4.js'; -// eslint-disable-next-line bad-sim-text +// eslint-disable-next-line phet/bad-sim-text const random = new Random(); export type WGSLBinaryStatements = ( value: WGSLVariableName, a: WGSLExpression, b: WGSLExpression ) => WGSLStatements; @@ -303,7 +303,7 @@ alpenglow.register( 'getVariableLengthArrayType', getVariableLengthArrayType ); export const getCastedType = ( type: ConcreteType, valueType: WGSLType ): ConcreteType => { return { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...type, valueType: valueType }; diff --git a/js/webgpu/compute/IndirectModule.ts b/js/webgpu/compute/IndirectModule.ts index c186c9b..fa03993 100644 --- a/js/webgpu/compute/IndirectModule.ts +++ b/js/webgpu/compute/IndirectModule.ts @@ -16,7 +16,7 @@ export type IndirectModuleOptions = { } & PipelineBlueprintOptions; export const INDIRECT_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...PIPELINE_BLUEPRINT_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/HistogramModule.ts b/js/webgpu/modules/gpu/HistogramModule.ts index ba09a6e..09c943e 100644 --- a/js/webgpu/modules/gpu/HistogramModule.ts +++ b/js/webgpu/modules/gpu/HistogramModule.ts @@ -16,9 +16,9 @@ export type HistogramModuleOptions = { } & mainHistogramWGSLOptions & PipelineBlueprintOptions; export const HISTOGRAM_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_HISTOGRAM_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MainRadixHistogramModule.ts b/js/webgpu/modules/gpu/MainRadixHistogramModule.ts index 729cb43..b6fa4aa 100644 --- a/js/webgpu/modules/gpu/MainRadixHistogramModule.ts +++ b/js/webgpu/modules/gpu/MainRadixHistogramModule.ts @@ -16,9 +16,9 @@ export type MainRadixHistogramModuleOptions = { } & mainRadixHistogramWGSLOptions & PipelineBlueprintOptions; export const MAIN_RADIX_HISTOGRAM_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_RADIX_HISTOGRAM_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MainRadixScatterModule.ts b/js/webgpu/modules/gpu/MainRadixScatterModule.ts index 21b7f75..6d03bae 100644 --- a/js/webgpu/modules/gpu/MainRadixScatterModule.ts +++ b/js/webgpu/modules/gpu/MainRadixScatterModule.ts @@ -16,9 +16,9 @@ export type MainRadixScatterModuleOptions = { } & mainRadixScatterWGSLOptions & PipelineBlueprintOptions; export const MAIN_RADIX_SCATTER_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_RADIX_SCATTER_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MainReduceAtomicModule.ts b/js/webgpu/modules/gpu/MainReduceAtomicModule.ts index 259386a..310cb03 100644 --- a/js/webgpu/modules/gpu/MainReduceAtomicModule.ts +++ b/js/webgpu/modules/gpu/MainReduceAtomicModule.ts @@ -17,9 +17,9 @@ export type MainReduceAtomicModuleOptions = { } & mainReduceAtomicWGSLOptions & PipelineBlueprintOptions; export const MAIN_REDUCE_ATOMIC_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_REDUCE_ATOMIC_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MainReduceModule.ts b/js/webgpu/modules/gpu/MainReduceModule.ts index 03081bb..9c687e2 100644 --- a/js/webgpu/modules/gpu/MainReduceModule.ts +++ b/js/webgpu/modules/gpu/MainReduceModule.ts @@ -16,9 +16,9 @@ export type MainReduceModuleOptions = { } & mainReduceWGSLOptions & PipelineBlueprintOptions; export const MAIN_REDUCE_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_REDUCE_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MainReduceNonCommutativeModule.ts b/js/webgpu/modules/gpu/MainReduceNonCommutativeModule.ts index 9cf227e..ad45cc5 100644 --- a/js/webgpu/modules/gpu/MainReduceNonCommutativeModule.ts +++ b/js/webgpu/modules/gpu/MainReduceNonCommutativeModule.ts @@ -16,9 +16,9 @@ export type MainReduceNonCommutativeModuleOptions = { } & mainReduceNonCommutativeWGSLOptions & PipelineBlueprintOptions; export const MAIN_REDUCE_NON_COMMUTATIVE_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_REDUCE_NON_COMMUTATIVE_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MainScanModule.ts b/js/webgpu/modules/gpu/MainScanModule.ts index a9a18a3..89a6097 100644 --- a/js/webgpu/modules/gpu/MainScanModule.ts +++ b/js/webgpu/modules/gpu/MainScanModule.ts @@ -20,9 +20,9 @@ export type MainScanModuleOptions = { } & mainScanWGSLOptions & PipelineBlueprintOptions; export const MAIN_SCAN_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_SCAN_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MergeModule.ts b/js/webgpu/modules/gpu/MergeModule.ts index 41ff9a6..0399a9c 100644 --- a/js/webgpu/modules/gpu/MergeModule.ts +++ b/js/webgpu/modules/gpu/MergeModule.ts @@ -17,9 +17,9 @@ export type MergeModuleOptions = { } & mainMergeWGSLOptions & PipelineBlueprintOptions; export const MERGE_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_MERGE_DEFAULTS } as const; diff --git a/js/webgpu/modules/gpu/MergeSimpleModule.ts b/js/webgpu/modules/gpu/MergeSimpleModule.ts index 8448497..9e4cc81 100644 --- a/js/webgpu/modules/gpu/MergeSimpleModule.ts +++ b/js/webgpu/modules/gpu/MergeSimpleModule.ts @@ -17,9 +17,9 @@ export type MergeSimpleModuleOptions = { } & mainMergeSimpleWGSLOptions & PipelineBlueprintOptions; export const MERGE_SIMPLE_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_MERGE_SIMPLE_DEFAULTS } as const; diff --git a/js/webgpu/modules/rasterize-two-pass/MainTwoPassCoarseModule.ts b/js/webgpu/modules/rasterize-two-pass/MainTwoPassCoarseModule.ts index 6b7c1b5..b7a28dc 100644 --- a/js/webgpu/modules/rasterize-two-pass/MainTwoPassCoarseModule.ts +++ b/js/webgpu/modules/rasterize-two-pass/MainTwoPassCoarseModule.ts @@ -23,9 +23,9 @@ export type MainTwoPassCoarseModuleOptions = { } & mainTwoPassCoarseWGSLOptions & PipelineBlueprintOptions; export const MAIN_TWO_PASS_COARSE_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_TWO_PASS_COARSE_DEFAULTS } as const; diff --git a/js/webgpu/modules/rasterize-two-pass/MainTwoPassFineModule.ts b/js/webgpu/modules/rasterize-two-pass/MainTwoPassFineModule.ts index c64c120..6472b69 100644 --- a/js/webgpu/modules/rasterize-two-pass/MainTwoPassFineModule.ts +++ b/js/webgpu/modules/rasterize-two-pass/MainTwoPassFineModule.ts @@ -20,9 +20,9 @@ export type MainTwoPassFineModuleOptions = { } & mainTwoPassFineWGSLOptions & PipelineBlueprintOptions; export const MAIN_TWO_PASS_FINE_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_TWO_PASS_FINE_DEFAULTS } as const; diff --git a/js/webgpu/modules/rasterize-two-pass/MainTwoPassInitializeAddressesModule.ts b/js/webgpu/modules/rasterize-two-pass/MainTwoPassInitializeAddressesModule.ts index 919b1e8..3354fcd 100644 --- a/js/webgpu/modules/rasterize-two-pass/MainTwoPassInitializeAddressesModule.ts +++ b/js/webgpu/modules/rasterize-two-pass/MainTwoPassInitializeAddressesModule.ts @@ -15,9 +15,9 @@ export type MainTwoPassInitializeAddressesModuleOptions = { } & mainTwoPassInitializeAddressesWGSLOptions & PipelineBlueprintOptions; export const MAIN_TWO_PASS_INITIALIZE_ADDRESSES_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_TWO_PASS_INITIALIZE_ADDRESSES_DEFAULTS } as const; diff --git a/js/webgpu/modules/rasterize-two-pass/MainTwoPassTileModule.ts b/js/webgpu/modules/rasterize-two-pass/MainTwoPassTileModule.ts index eddc504..1251e8f 100644 --- a/js/webgpu/modules/rasterize-two-pass/MainTwoPassTileModule.ts +++ b/js/webgpu/modules/rasterize-two-pass/MainTwoPassTileModule.ts @@ -23,9 +23,9 @@ export type MainTwoPassTileModuleOptions = { } & mainTwoPassTileWGSLOptions & PipelineBlueprintOptions; export const MAIN_TWO_PASS_TILE_MODULE_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...DIRECT_MODULE_DEFAULTS, - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...MAIN_TWO_PASS_TILE_DEFAULTS } as const; diff --git a/js/webgpu/modules/rasterize-two-pass/TiledTwoPassModule.ts b/js/webgpu/modules/rasterize-two-pass/TiledTwoPassModule.ts index 51c66ce..6b6e27a 100644 --- a/js/webgpu/modules/rasterize-two-pass/TiledTwoPassModule.ts +++ b/js/webgpu/modules/rasterize-two-pass/TiledTwoPassModule.ts @@ -74,7 +74,7 @@ export default class TiledTwoPassModule extends CompositeModule { name: `${providedOptions.name} initialize_addresses`, log: providedOptions.log, // TODO: how can we avoid needing this forward? - ...options.mainTwoPassInitializeAddressesModule, // eslint-disable-line no-object-spread-on-non-literals + ...options.mainTwoPassInitializeAddressesModule, // eslint-disable-line phet/no-object-spread-on-non-literals addresses: addressesPlainSlot } ); @@ -91,7 +91,7 @@ export default class TwoPassModule extends CompositeModule { name: `${providedOptions.name} coarse`, log: providedOptions.log, // TODO: how can we avoid needing this forward? - ...options.mainTwoPassCoarseModuleOptions, // eslint-disable-line no-object-spread-on-non-literals + ...options.mainTwoPassCoarseModuleOptions, // eslint-disable-line phet/no-object-spread-on-non-literals // input config: providedOptions.config, @@ -110,7 +110,7 @@ export default class TwoPassModule extends CompositeModule { name: `${providedOptions.name} fine`, log: providedOptions.log, // TODO: how can we avoid needing this forward? - ...options.mainTwoPassFineModuleOptions, // eslint-disable-line no-object-spread-on-non-literals + ...options.mainTwoPassFineModuleOptions, // eslint-disable-line phet/no-object-spread-on-non-literals config: providedOptions.config, addresses: addressesPlainSlot, diff --git a/js/webgpu/tests/gpu/HistogramModuleTests.ts b/js/webgpu/tests/gpu/HistogramModuleTests.ts index 5d73817..98dae58 100644 --- a/js/webgpu/tests/gpu/HistogramModuleTests.ts +++ b/js/webgpu/tests/gpu/HistogramModuleTests.ts @@ -66,7 +66,7 @@ const testHistogramModule = ( options: HistogramModuleTestOptions ) => { } as const; testHistogramModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 histogram mod 256', numBins: 256, @@ -76,7 +76,7 @@ const testHistogramModule = ( options: HistogramModuleTestOptions ) => { } ); testHistogramModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'vec2u histogram custom', numBins: 256, diff --git a/js/webgpu/tests/gpu/MergeModuleTests.ts b/js/webgpu/tests/gpu/MergeModuleTests.ts index e546ba4..81b673f 100644 --- a/js/webgpu/tests/gpu/MergeModuleTests.ts +++ b/js/webgpu/tests/gpu/MergeModuleTests.ts @@ -75,28 +75,28 @@ const testMergeModule = ( options: MergeModuleTestOptions ) => { } as const; testMergeModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'i32 merge', order: I32Order } ); testMergeModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 merge', order: U32Order } ); testMergeModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 reverse merge', order: U32ReverseOrder } ); testMergeModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'vec2u merge', order: Vec2uLexicographicalOrder diff --git a/js/webgpu/tests/gpu/MergeSimpleModuleTests.ts b/js/webgpu/tests/gpu/MergeSimpleModuleTests.ts index 76c4d61..d5eda84 100644 --- a/js/webgpu/tests/gpu/MergeSimpleModuleTests.ts +++ b/js/webgpu/tests/gpu/MergeSimpleModuleTests.ts @@ -73,28 +73,28 @@ const testMergeSimpleModule = ( options: MergeSimpleModuleTestOptions ) => } as const; testMergeSimpleModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'i32 merge simple', order: I32Order } ); testMergeSimpleModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 merge simple', order: U32Order } ); testMergeSimpleModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 reverse merge simple', order: U32ReverseOrder } ); testMergeSimpleModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'vec2u merge simple', order: Vec2uLexicographicalOrder diff --git a/js/webgpu/tests/gpu/ReduceModuleTests.ts b/js/webgpu/tests/gpu/ReduceModuleTests.ts index bc482b9..d77e652 100644 --- a/js/webgpu/tests/gpu/ReduceModuleTests.ts +++ b/js/webgpu/tests/gpu/ReduceModuleTests.ts @@ -69,28 +69,28 @@ const testReduceModule = ( options: ReduceModuleTestOptions ) => { } as const; testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 add reduce (atomic) single-size', binaryOp: U32Add } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'i32 add reduce (atomic) single-size', binaryOp: I32Add } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'vec2u add reduce (multi-layer commutative) single-size', binaryOp: Vec2uAdd } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'bicyclic semigroup reduce (multi-layer non-commutative) single-size', binaryOp: Vec2uBic @@ -110,28 +110,28 @@ const testReduceModule = ( options: ReduceModuleTestOptions ) => { } as const; testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 add reduce (atomic) double-size', binaryOp: U32Add } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'i32 add reduce (atomic) double-size', binaryOp: I32Add } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'vec2u add reduce (multi-layer commutative) double-size', binaryOp: Vec2uAdd } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'bicyclic semigroup reduce (multi-layer non-commutative) double-size', binaryOp: Vec2uBic @@ -151,28 +151,28 @@ const testReduceModule = ( options: ReduceModuleTestOptions ) => { } as const; testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'u32 add reduce (atomic) triple-size', binaryOp: U32Add } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'i32 add reduce (atomic) triple-size', binaryOp: I32Add } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'vec2u add reduce (multi-layer commutative) triple-size', binaryOp: Vec2uAdd } ); testReduceModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: 'bicyclic semigroup reduce (multi-layer non-commutative) triple-size', binaryOp: Vec2uBic diff --git a/js/webgpu/tests/gpu/ScanModuleTests.ts b/js/webgpu/tests/gpu/ScanModuleTests.ts index 8fc8e8d..9414512 100644 --- a/js/webgpu/tests/gpu/ScanModuleTests.ts +++ b/js/webgpu/tests/gpu/ScanModuleTests.ts @@ -83,7 +83,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { const commonString = `scan single-size ${exclusive ? 'exclusive' : 'inclusive'}${inPlace ? ' in-place' : ''}`; testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `u32 add ${commonString}`, binaryOp: U32Add, @@ -92,7 +92,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `i32 add ${commonString}`, binaryOp: I32Add, @@ -101,7 +101,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `vec2u add ${commonString}`, binaryOp: Vec2uAdd, @@ -110,7 +110,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `bicyclic semigroup add ${commonString}`, binaryOp: Vec2uBic, @@ -139,7 +139,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { const commonString = `scan double-size ${exclusive ? 'exclusive' : 'inclusive'}${inPlace ? ' in-place' : ''}`; testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `u32 add ${commonString}`, binaryOp: U32Add, @@ -148,7 +148,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `i32 add ${commonString}`, binaryOp: I32Add, @@ -157,7 +157,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `vec2u add ${commonString}`, binaryOp: Vec2uAdd, @@ -166,7 +166,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `bicyclic semigroup add ${commonString}`, binaryOp: Vec2uBic, @@ -194,7 +194,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { const commonString = `scan triple-size ${exclusive ? 'exclusive' : 'inclusive'}${inPlace ? ' in-place' : ''}`; testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `u32 add ${commonString}`, binaryOp: U32Add, @@ -203,7 +203,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `i32 add ${commonString}`, binaryOp: I32Add, @@ -212,7 +212,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `vec2u add ${commonString}`, binaryOp: Vec2uAdd, @@ -221,7 +221,7 @@ const testScanModule = ( options: ScanModuleTestOptions ) => { } ); testScanModule( { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...options, name: `bicyclic semigroup add ${commonString}`, binaryOp: Vec2uBic, diff --git a/js/webgpu/wgsl/gpu/coalescedLoopWGSL.ts b/js/webgpu/wgsl/gpu/coalescedLoopWGSL.ts index f45898e..2e013d7 100644 --- a/js/webgpu/wgsl/gpu/coalescedLoopWGSL.ts +++ b/js/webgpu/wgsl/gpu/coalescedLoopWGSL.ts @@ -14,9 +14,9 @@ export type coalescedLoopWGSLOptions = { } & RakedSizable & OptionalLengthExpressionable & WorkgroupIndexable & LocalIndexable; export const COALESCED_LOOP_DEFAULTS = { - ...OPTIONAL_LENGTH_EXPRESSIONABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...OPTIONAL_LENGTH_EXPRESSIONABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const coalescedLoopWGSL = ( diff --git a/js/webgpu/wgsl/gpu/histogramWGSL.ts b/js/webgpu/wgsl/gpu/histogramWGSL.ts index 5bbc0e9..6f801ef 100644 --- a/js/webgpu/wgsl/gpu/histogramWGSL.ts +++ b/js/webgpu/wgsl/gpu/histogramWGSL.ts @@ -20,7 +20,7 @@ type SelfOptions = { export type histogramWGSLOptions = SelfOptions & StrictOmit; export const HISTOGRAM_DEFAULTS = { - ...COALESCED_LOOP_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...COALESCED_LOOP_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const histogramWGSL = ( diff --git a/js/webgpu/wgsl/gpu/loadMultipleWGSL.ts b/js/webgpu/wgsl/gpu/loadMultipleWGSL.ts index 521dc70..c23d127 100644 --- a/js/webgpu/wgsl/gpu/loadMultipleWGSL.ts +++ b/js/webgpu/wgsl/gpu/loadMultipleWGSL.ts @@ -45,10 +45,10 @@ export const LOAD_MULTIPLE_DEFAULTS = { outOfRangeValue: null, inputAccessOrder: 'striped', factorOutSubexpressions: true, - ...GLOBAL_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...LOCAL_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...OPTIONAL_LENGTH_EXPRESSIONABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...GLOBAL_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...LOCAL_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...OPTIONAL_LENGTH_EXPRESSIONABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const loadMultipleWGSL = ( diff --git a/js/webgpu/wgsl/gpu/loadReducedWGSL.ts b/js/webgpu/wgsl/gpu/loadReducedWGSL.ts index 0a83f2e..85c3014 100644 --- a/js/webgpu/wgsl/gpu/loadReducedWGSL.ts +++ b/js/webgpu/wgsl/gpu/loadReducedWGSL.ts @@ -57,10 +57,10 @@ export const LOAD_REDUCED_DEFAULTS = { sequentialReduceStyle: 'factored', useSelectIfOptional: false, orderOverride: false, - ...GLOBAL_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...LOCAL_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...OPTIONAL_LENGTH_EXPRESSIONABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...GLOBAL_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...LOCAL_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...OPTIONAL_LENGTH_EXPRESSIONABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const loadReducedWGSL = ( diff --git a/js/webgpu/wgsl/gpu/mainHistogramWGSL.ts b/js/webgpu/wgsl/gpu/mainHistogramWGSL.ts index 5e461d7..eeec8f7 100644 --- a/js/webgpu/wgsl/gpu/mainHistogramWGSL.ts +++ b/js/webgpu/wgsl/gpu/mainHistogramWGSL.ts @@ -16,7 +16,7 @@ export type mainHistogramWGSLOptions = { } & OptionalLengthExpressionable & RakedSizable; export const MAIN_HISTOGRAM_DEFAULTS = { - // eslint-disable-next-line no-object-spread-on-non-literals + // eslint-disable-next-line phet/no-object-spread-on-non-literals ...OPTIONAL_LENGTH_EXPRESSIONABLE_DEFAULTS } as const; diff --git a/js/webgpu/wgsl/gpu/mergeSimpleWGSL.ts b/js/webgpu/wgsl/gpu/mergeSimpleWGSL.ts index d2e73e7..c5fa561 100644 --- a/js/webgpu/wgsl/gpu/mergeSimpleWGSL.ts +++ b/js/webgpu/wgsl/gpu/mergeSimpleWGSL.ts @@ -27,7 +27,7 @@ export type mergeSimpleWGSLOptions = { export const MERGE_SIMPLE_DEFAULTS = { greaterThan: null, lessThanOrEqual: null, - ...GLOBAL_INDEXABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...GLOBAL_INDEXABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const mergeSimpleWGSL = ( diff --git a/js/webgpu/wgsl/gpu/nBitCompactSingleSortWGSL.ts b/js/webgpu/wgsl/gpu/nBitCompactSingleSortWGSL.ts index f09cdd3..8622dd8 100644 --- a/js/webgpu/wgsl/gpu/nBitCompactSingleSortWGSL.ts +++ b/js/webgpu/wgsl/gpu/nBitCompactSingleSortWGSL.ts @@ -41,7 +41,7 @@ export type nBitCompactSingleSortWGSLOptions = { const DEFAULT_OPTIONS = { earlyLoad: false, - ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const nBitCompactSingleSortWGSL = ( diff --git a/js/webgpu/wgsl/gpu/reduceWGSL.ts b/js/webgpu/wgsl/gpu/reduceWGSL.ts index a26875f..62d3dd1 100644 --- a/js/webgpu/wgsl/gpu/reduceWGSL.ts +++ b/js/webgpu/wgsl/gpu/reduceWGSL.ts @@ -45,7 +45,7 @@ export const REDUCE_DEFAULTS = { convergent: false, scratchPreloaded: false, valuePreloaded: true, - ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const reduceWGSL = ( diff --git a/js/webgpu/wgsl/gpu/scanRakedWGSL.ts b/js/webgpu/wgsl/gpu/scanRakedWGSL.ts index afec09b..ed06422 100644 --- a/js/webgpu/wgsl/gpu/scanRakedWGSL.ts +++ b/js/webgpu/wgsl/gpu/scanRakedWGSL.ts @@ -47,8 +47,8 @@ export const SCAN_RAKED_DEFAULTS = { stripeReducedOutput: false, getAddedValue: null, addedValueNeedsWorkgroupBarrier: true, - ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line no-object-spread-on-non-literals - ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...WORKGROUP_INDEXABLE_DEFAULTS, // eslint-disable-line phet/no-object-spread-on-non-literals + ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const scanRakedWGSL = ( diff --git a/js/webgpu/wgsl/gpu/scanWGSL.ts b/js/webgpu/wgsl/gpu/scanWGSL.ts index 9ebf3f8..ac6cb26 100644 --- a/js/webgpu/wgsl/gpu/scanWGSL.ts +++ b/js/webgpu/wgsl/gpu/scanWGSL.ts @@ -51,7 +51,7 @@ export const SCAN_DEFAULTS = { needsValidScratch: false, // TODO: think about the best default? scratchPreloaded: false, valuePreloaded: true, - ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line no-object-spread-on-non-literals + ...LOCAL_INDEXABLE_DEFAULTS // eslint-disable-line phet/no-object-spread-on-non-literals } as const; const scanWGSL = ( diff --git a/tests/async-compute-test.html b/tests/async-compute-test.html index 9830d74..fbb8727 100644 --- a/tests/async-compute-test.html +++ b/tests/async-compute-test.html @@ -264,6 +264,8 @@ const numbers = []; while ( numbers.length < workgroupSize * numWorkgroups ) { + + // eslint-disable-next-line phet/bad-sim-text numbers.push( Math.random() - 0.5 ); } const numbersArray = new Float32Array( numbers ); diff --git a/tests/bench-thimbleberry.html b/tests/bench-thimbleberry.html index 2314a08..73b4d49 100644 --- a/tests/bench-thimbleberry.html +++ b/tests/bench-thimbleberry.html @@ -39,6 +39,7 @@