Skip to content

Commit

Permalink
Eslint: Improve config
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Rigaud committed Nov 27, 2024
1 parent 5855564 commit 5bfebc8
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 32 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@
],
"no-irregular-whitespace": [
"error"
],
"no-console": [
"error",
{
"allow": [
"warn",
"error"
]
}
],
"no-unused-vars": [
"error"
],
"no-duplicate-imports": [
"error"
]
}
}
4 changes: 2 additions & 2 deletions src/core/InterleavedBufferAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down Expand Up @@ -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 = [];

Expand Down
3 changes: 1 addition & 2 deletions src/materials/nodes/Line2NodeMaterial.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';

Expand Down
3 changes: 1 addition & 2 deletions src/nodes/accessors/MorphNode.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 1 addition & 2 deletions src/nodes/accessors/Normal.js
Original file line number Diff line number Diff line change
@@ -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' );
Expand Down
3 changes: 1 addition & 2 deletions src/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 1 addition & 2 deletions src/nodes/functions/PhongLightingModel.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 1 addition & 2 deletions src/objects/BatchedMesh.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,15 @@ class WebGLRenderer {

event.preventDefault();

console.log( 'THREE.WebGLRenderer: Context Lost.' );
console.warn( 'THREE.WebGLRenderer: Context Lost.' );

_isContextLost = true;

}

function onContextRestore( /* event */ ) {

console.log( 'THREE.WebGLRenderer: Context Restored.' );
console.warn( 'THREE.WebGLRenderer: Context Restored.' );

_isContextLost = false;

Expand Down
18 changes: 10 additions & 8 deletions src/renderers/webgpu/nodes/BasicNodeLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
18 changes: 10 additions & 8 deletions src/renderers/webgpu/nodes/StandardNodeLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 5bfebc8

Please sign in to comment.