Skip to content

Commit 3c60484

Browse files
authored
Merge pull request #20827 from gkjohnson/lint-update
Linting: Add rule to consistently use single quotes and fix files
2 parents d01e8ec + 781d661 commit 3c60484

17 files changed

+57
-52
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"test": "test"
2828
},
2929
"eslintConfig": {
30+
"root": true,
3031
"parser": "@typescript-eslint/parser",
3132
"extends": "mdcs",
3233
"plugins": [
@@ -44,6 +45,10 @@
4445
"SwitchCase": 1
4546
}
4647
],
48+
"quotes": [
49+
"error",
50+
"single"
51+
],
4752
"prefer-const": [
4853
"error",
4954
{

src/Three.Legacy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ Object.assign( Matrix3.prototype, {
583583

584584
flattenToArrayOffset: function ( array, offset ) {
585585

586-
console.warn( "THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." );
586+
console.warn( 'THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );
587587
return this.toArray( array, offset );
588588

589589
},
@@ -628,7 +628,7 @@ Object.assign( Matrix4.prototype, {
628628
},
629629
flattenToArrayOffset: function ( array, offset ) {
630630

631-
console.warn( "THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." );
631+
console.warn( 'THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.' );
632632
return this.toArray( array, offset );
633633

634634
},
@@ -1118,8 +1118,8 @@ Object.defineProperty( Curve.prototype, '__arcLengthDivisions', {
11181118

11191119
PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {
11201120

1121-
console.warn( "THREE.PerspectiveCamera.setLens is deprecated. " +
1122-
"Use .setFocalLength and .filmGauge for a photographic setup." );
1121+
console.warn( 'THREE.PerspectiveCamera.setLens is deprecated. ' +
1122+
'Use .setFocalLength and .filmGauge for a photographic setup.' );
11231123

11241124
if ( filmGauge !== undefined ) this.filmGauge = filmGauge;
11251125
this.setFocalLength( focalLength );

src/animation/KeyframeTrack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ Object.assign( KeyframeTrack.prototype, {
125125

126126
if ( factoryMethod === undefined ) {
127127

128-
const message = "unsupported interpolation for " +
129-
this.ValueTypeName + " keyframe track named " + this.name;
128+
const message = 'unsupported interpolation for ' +
129+
this.ValueTypeName + ' keyframe track named ' + this.name;
130130

131131
if ( this.createInterpolant === undefined ) {
132132

src/animation/PropertyBinding.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Object.assign( PropertyBinding, {
188188

189189
findNode: function ( root, nodeName ) {
190190

191-
if ( ! nodeName || nodeName === "" || nodeName === "." || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) {
191+
if ( ! nodeName || nodeName === '' || nodeName === '.' || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) {
192192

193193
return root;
194194

@@ -591,7 +591,7 @@ Object.assign( PropertyBinding.prototype, { // prototype, continued
591591

592592
// access a sub element of the property array (only primitives are supported right now)
593593

594-
if ( propertyName === "morphTargetInfluences" ) {
594+
if ( propertyName === 'morphTargetInfluences' ) {
595595

596596
// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.
597597

src/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,5 @@ export const StaticCopyUsage = 35046;
196196
export const DynamicCopyUsage = 35050;
197197
export const StreamCopyUsage = 35042;
198198

199-
export const GLSL1 = "100";
200-
export const GLSL3 = "300 es";
199+
export const GLSL1 = '100';
200+
export const GLSL3 = '300 es';

src/core/Object3D.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
315315

316316
if ( object === this ) {
317317

318-
console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object );
318+
console.error( 'THREE.Object3D.add: object can\'t be added as a child of itself.', object );
319319
return this;
320320

321321
}
@@ -335,7 +335,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
335335

336336
} else {
337337

338-
console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object );
338+
console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );
339339

340340
}
341341

src/geometries/ExtrudeBufferGeometry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class ExtrudeBufferGeometry extends BufferGeometry {
175175

176176
function scalePt2( pt, vec, size ) {
177177

178-
if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" );
178+
if ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' );
179179

180180
return vec.clone().multiplyScalar( size ).add( pt );
181181

src/materials/Material.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
9696

9797
if ( newValue === undefined ) {
9898

99-
console.warn( "THREE.Material: '" + key + "' parameter is undefined." );
99+
console.warn( 'THREE.Material: \'' + key + '\' parameter is undefined.' );
100100
continue;
101101

102102
}
@@ -114,7 +114,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
114114

115115
if ( currentValue === undefined ) {
116116

117-
console.warn( "THREE." + this.type + ": '" + key + "' is not a property of this material." );
117+
console.warn( 'THREE.' + this.type + ': \'' + key + '\' is not a property of this material.' );
118118
continue;
119119

120120
}

src/renderers/WebGLRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { WebGLTextures } from './webgl/WebGLTextures.js';
3737
import { WebGLUniforms } from './webgl/WebGLUniforms.js';
3838
import { WebGLUtils } from './webgl/WebGLUtils.js';
3939
import { WebXRManager } from './webxr/WebXRManager.js';
40-
import { WebGLMaterials } from "./webgl/WebGLMaterials.js";
40+
import { WebGLMaterials } from './webgl/WebGLMaterials.js';
4141

4242
function createCanvasElement() {
4343

src/renderers/webgl/WebGLBufferRenderer.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Renderers / WebGL /////////////////////////////////////////////////////////////////////
2-
import { WebGLExtensions } from "./WebGLExtensions";
3-
import { WebGLInfo } from "./WebGLInfo";
4-
import { WebGLCapabilities } from "./WebGLCapabilities";
2+
import { WebGLExtensions } from './WebGLExtensions';
3+
import { WebGLInfo } from './WebGLInfo';
4+
import { WebGLCapabilities } from './WebGLCapabilities';
55

66
export class WebGLBufferRenderer {
77

0 commit comments

Comments
 (0)