diff --git a/.eslintrc.json b/.eslintrc.json index 305ec04c5dfdfb..8a13e08968b6ab 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -60,6 +60,21 @@ ], "no-irregular-whitespace": [ "error" + ], + "no-console": [ + "error", + { + "allow": [ + "warn", + "error" + ] + } + ], + "no-unused-vars": [ + "error" + ], + "no-duplicate-imports": [ + "error" ] } } diff --git a/src/core/InterleavedBufferAttribute.js b/src/core/InterleavedBufferAttribute.js index 47b0f8fb13bc1d..1992af0234a31a 100644 --- a/src/core/InterleavedBufferAttribute.js +++ b/src/core/InterleavedBufferAttribute.js @@ -250,7 +250,7 @@ class InterleavedBufferAttribute { if ( data === undefined ) { - console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' ); + console.warn( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' ); const array = []; @@ -292,7 +292,7 @@ class InterleavedBufferAttribute { if ( data === undefined ) { - console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' ); + console.warn( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' ); const array = []; diff --git a/src/materials/nodes/Line2NodeMaterial.js b/src/materials/nodes/Line2NodeMaterial.js index 015fc3f3453552..cd597b5d2ac20e 100644 --- a/src/materials/nodes/Line2NodeMaterial.js +++ b/src/materials/nodes/Line2NodeMaterial.js @@ -1,5 +1,5 @@ import NodeMaterial from './NodeMaterial.js'; -import { varyingProperty } from '../../nodes/core/PropertyNode.js'; +import { dashSize, gapSize, varyingProperty } from '../../nodes/core/PropertyNode.js'; import { attribute } from '../../nodes/core/AttributeNode.js'; import { cameraProjectionMatrix } from '../../nodes/accessors/Camera.js'; import { materialColor, materialLineScale, materialLineDashSize, materialLineGapSize, materialLineDashOffset, materialLineWidth } from '../../nodes/accessors/MaterialNode.js'; @@ -9,7 +9,6 @@ import { mix, smoothstep } from '../../nodes/math/MathNode.js'; import { Fn, float, vec2, vec3, vec4, If } from '../../nodes/tsl/TSLBase.js'; import { uv } from '../../nodes/accessors/UV.js'; import { viewport } from '../../nodes/display/ScreenNode.js'; -import { dashSize, gapSize } from '../../nodes/core/PropertyNode.js'; import { LineDashedMaterial } from '../LineDashedMaterial.js'; diff --git a/src/nodes/accessors/MorphNode.js b/src/nodes/accessors/MorphNode.js index 58fda8db35762a..5df34188d46b22 100644 --- a/src/nodes/accessors/MorphNode.js +++ b/src/nodes/accessors/MorphNode.js @@ -1,13 +1,12 @@ import Node from '../core/Node.js'; import { NodeUpdateType } from '../core/constants.js'; -import { float, nodeProxy, Fn } from '../tsl/TSLBase.js'; +import { float, nodeProxy, Fn, ivec2, int } from '../tsl/TSLBase.js'; import { uniform } from '../core/UniformNode.js'; import { reference } from './ReferenceNode.js'; import { positionLocal } from './Position.js'; import { normalLocal } from './Normal.js'; import { textureLoad } from './TextureNode.js'; import { instanceIndex, vertexIndex } from '../core/IndexNode.js'; -import { ivec2, int } from '../tsl/TSLBase.js'; import { Loop } from '../utils/LoopNode.js'; import { DataArrayTexture } from '../../textures/DataArrayTexture.js'; diff --git a/src/nodes/accessors/Normal.js b/src/nodes/accessors/Normal.js index 35d5cd30530530..105cbc8c00d9f5 100644 --- a/src/nodes/accessors/Normal.js +++ b/src/nodes/accessors/Normal.js @@ -1,9 +1,8 @@ import { attribute } from '../core/AttributeNode.js'; import { cameraViewMatrix } from './Camera.js'; import { modelNormalMatrix, modelWorldMatrix } from './ModelNode.js'; -import { mat3, vec3 } from '../tsl/TSLBase.js'; +import { mat3, vec3, Fn, varying } from '../tsl/TSLBase.js'; import { positionView } from './Position.js'; -import { Fn, varying } from '../tsl/TSLBase.js'; import { faceDirection } from '../display/FrontFacingNode.js'; export const normalGeometry = /*@__PURE__*/ attribute( 'normal', 'vec3' ); diff --git a/src/nodes/core/NodeBuilder.js b/src/nodes/core/NodeBuilder.js index e309bf22c7979a..eeff00ba10c863 100644 --- a/src/nodes/core/NodeBuilder.js +++ b/src/nodes/core/NodeBuilder.js @@ -25,14 +25,13 @@ import PMREMGenerator from '../../renderers/common/extras/PMREMGenerator.js'; import BindGroup from '../../renderers/common/BindGroup.js'; -import { REVISION } from '../../constants.js'; +import { REVISION, IntType, UnsignedIntType, LinearFilter, LinearMipmapNearestFilter, NearestMipmapLinearFilter, LinearMipmapLinearFilter } from '../../constants.js'; import { RenderTarget } from '../../core/RenderTarget.js'; import { Color } from '../../math/Color.js'; import { Vector2 } from '../../math/Vector2.js'; import { Vector3 } from '../../math/Vector3.js'; import { Vector4 } from '../../math/Vector4.js'; import { Float16BufferAttribute } from '../../core/BufferAttribute.js'; -import { IntType, UnsignedIntType, LinearFilter, LinearMipmapNearestFilter, NearestMipmapLinearFilter, LinearMipmapLinearFilter } from '../../constants.js'; const rendererCache = new WeakMap(); diff --git a/src/nodes/functions/PhongLightingModel.js b/src/nodes/functions/PhongLightingModel.js index 507e5d27cacc4c..38f5e2eced3493 100644 --- a/src/nodes/functions/PhongLightingModel.js +++ b/src/nodes/functions/PhongLightingModel.js @@ -1,10 +1,9 @@ import BasicLightingModel from './BasicLightingModel.js'; import F_Schlick from './BSDF/F_Schlick.js'; import BRDF_Lambert from './BSDF/BRDF_Lambert.js'; -import { diffuseColor } from '../core/PropertyNode.js'; +import { diffuseColor, shininess, specularColor } from '../core/PropertyNode.js'; import { transformedNormalView } from '../accessors/Normal.js'; import { materialSpecularStrength } from '../accessors/MaterialNode.js'; -import { shininess, specularColor } from '../core/PropertyNode.js'; import { positionViewDirection } from '../accessors/Position.js'; import { Fn, float } from '../tsl/TSLBase.js'; diff --git a/src/objects/BatchedMesh.js b/src/objects/BatchedMesh.js index 57245003310373..3e0237e82c4b9f 100644 --- a/src/objects/BatchedMesh.js +++ b/src/objects/BatchedMesh.js @@ -1,10 +1,9 @@ import { BufferAttribute } from '../core/BufferAttribute.js'; import { BufferGeometry } from '../core/BufferGeometry.js'; import { DataTexture } from '../textures/DataTexture.js'; -import { FloatType, RedIntegerFormat, UnsignedIntType } from '../constants.js'; +import { FloatType, RedIntegerFormat, UnsignedIntType, RGBAFormat } from '../constants.js'; import { Matrix4 } from '../math/Matrix4.js'; import { Mesh } from './Mesh.js'; -import { RGBAFormat } from '../constants.js'; import { ColorManagement } from '../math/ColorManagement.js'; import { Box3 } from '../math/Box3.js'; import { Sphere } from '../math/Sphere.js'; diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index ee98b9a3202fd9..9a953fb52dd06f 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -665,7 +665,7 @@ class WebGLRenderer { event.preventDefault(); - console.log( 'THREE.WebGLRenderer: Context Lost.' ); + console.warn( 'THREE.WebGLRenderer: Context Lost.' ); _isContextLost = true; @@ -673,7 +673,7 @@ class WebGLRenderer { function onContextRestore( /* event */ ) { - console.log( 'THREE.WebGLRenderer: Context Restored.' ); + console.warn( 'THREE.WebGLRenderer: Context Restored.' ); _isContextLost = false; diff --git a/src/renderers/webgpu/nodes/BasicNodeLibrary.js b/src/renderers/webgpu/nodes/BasicNodeLibrary.js index 36fa775bf25645..a6a9d919190f4f 100644 --- a/src/renderers/webgpu/nodes/BasicNodeLibrary.js +++ b/src/renderers/webgpu/nodes/BasicNodeLibrary.js @@ -2,21 +2,23 @@ import NodeLibrary from '../../common/nodes/NodeLibrary.js'; // Lights import { PointLight } from '../../../lights/PointLight.js'; -import { PointLightNode } from '../../../nodes/Nodes.js'; import { DirectionalLight } from '../../../lights/DirectionalLight.js'; -import { DirectionalLightNode } from '../../../nodes/Nodes.js'; import { RectAreaLight } from '../../../lights/RectAreaLight.js'; -import { RectAreaLightNode } from '../../../nodes/Nodes.js'; import { SpotLight } from '../../../lights/SpotLight.js'; -import { SpotLightNode } from '../../../nodes/Nodes.js'; import { AmbientLight } from '../../../lights/AmbientLight.js'; -import { AmbientLightNode } from '../../../nodes/Nodes.js'; import { HemisphereLight } from '../../../lights/HemisphereLight.js'; -import { HemisphereLightNode } from '../../../nodes/Nodes.js'; import { LightProbe } from '../../../lights/LightProbe.js'; -import { LightProbeNode } from '../../../nodes/Nodes.js'; import IESSpotLight from '../../../lights/webgpu/IESSpotLight.js'; -import { IESSpotLightNode } from '../../../nodes/Nodes.js'; +import { + PointLightNode, + DirectionalLightNode, + RectAreaLightNode, + SpotLightNode, + AmbientLightNode, + HemisphereLightNode, + LightProbeNode, + IESSpotLightNode +} from '../../../nodes/Nodes.js'; // Tone Mapping import { LinearToneMapping, ReinhardToneMapping, CineonToneMapping, ACESFilmicToneMapping, AgXToneMapping, NeutralToneMapping } from '../../../constants.js'; diff --git a/src/renderers/webgpu/nodes/StandardNodeLibrary.js b/src/renderers/webgpu/nodes/StandardNodeLibrary.js index 2ad69f4ff70a29..9f9f1558707972 100644 --- a/src/renderers/webgpu/nodes/StandardNodeLibrary.js +++ b/src/renderers/webgpu/nodes/StandardNodeLibrary.js @@ -21,21 +21,23 @@ import ShadowNodeMaterial from '../../../materials/nodes/ShadowNodeMaterial.js'; // Lights import { PointLight } from '../../../lights/PointLight.js'; -import { PointLightNode } from '../../../nodes/Nodes.js'; import { DirectionalLight } from '../../../lights/DirectionalLight.js'; -import { DirectionalLightNode } from '../../../nodes/Nodes.js'; import { RectAreaLight } from '../../../lights/RectAreaLight.js'; -import { RectAreaLightNode } from '../../../nodes/Nodes.js'; import { SpotLight } from '../../../lights/SpotLight.js'; -import { SpotLightNode } from '../../../nodes/Nodes.js'; import { AmbientLight } from '../../../lights/AmbientLight.js'; -import { AmbientLightNode } from '../../../nodes/Nodes.js'; import { HemisphereLight } from '../../../lights/HemisphereLight.js'; -import { HemisphereLightNode } from '../../../nodes/Nodes.js'; import { LightProbe } from '../../../lights/LightProbe.js'; -import { LightProbeNode } from '../../../nodes/Nodes.js'; import IESSpotLight from '../../../lights/webgpu/IESSpotLight.js'; -import { IESSpotLightNode } from '../../../nodes/Nodes.js'; +import { + PointLightNode, + DirectionalLightNode, + RectAreaLightNode, + SpotLightNode, + AmbientLightNode, + HemisphereLightNode, + LightProbeNode, + IESSpotLightNode +} from '../../../nodes/Nodes.js'; // Tone Mapping import { LinearToneMapping, ReinhardToneMapping, CineonToneMapping, ACESFilmicToneMapping, AgXToneMapping, NeutralToneMapping } from '../../../constants.js';