Browse Source

add new rule disallowNewlineBeforeBlockStatements

gero3 10 years ago
parent
commit
fb210eb85e

+ 1 - 2
examples/js/Octree.js

@@ -1929,8 +1929,7 @@
 				tmin;
 				tmin;
 
 
 			// ray would intersect in reverse direction, i.e. this is behind ray
 			// ray would intersect in reverse direction, i.e. this is behind ray
-			if ( tmax < 0 )
-			{
+			if ( tmax < 0 ) {
 
 
 				return false;
 				return false;
 
 

+ 1 - 2
examples/js/SimplexNoise.js

@@ -168,8 +168,7 @@ SimplexNoise.prototype.noise3d = function( xin, yin, zin ) {
 	var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords 
 	var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords 
 	if ( x0 >= y0 ) { 
 	if ( x0 >= y0 ) { 
 
 
-		if ( y0 >= z0 ) 
-      {
+		if ( y0 >= z0 ) {
 
 
 			i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 1; k2 = 0;
 			i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 1; k2 = 0;
 
 

+ 10 - 20
examples/js/Sparks.js

@@ -125,8 +125,7 @@ SPARKS.Emitter.prototype = {
 
 
 		// Update activities
 		// Update activities
 		len = this._activities.length;
 		len = this._activities.length;
-		for ( i = 0; i < len; i ++ )
-	{
+		for ( i = 0; i < len; i ++ ) {
 
 
 			this._activities[ i ].update( this, time );
 			this._activities[ i ].update( this, time );
 
 
@@ -139,12 +138,10 @@ SPARKS.Emitter.prototype = {
 		var action;
 		var action;
 		var len2 = this._particles.length;
 		var len2 = this._particles.length;
 
 
-		for ( j = 0; j < len; j ++ )
-	{
+		for ( j = 0; j < len; j ++ ) {
 
 
 			action = this._actions[ j ];
 			action = this._actions[ j ];
-			for ( i = 0; i < len2; ++ i )
-	{
+			for ( i = 0; i < len2; ++ i ) {
 
 
 				particle = this._particles[ i ];
 				particle = this._particles[ i ];
 				action.update( this, particle, time );
 				action.update( this, particle, time );
@@ -155,12 +152,10 @@ SPARKS.Emitter.prototype = {
 
 
 
 
 		// remove dead particles
 		// remove dead particles
-		for ( i = len2; i --; )
-	{
+		for ( i = len2; i --; ) {
 
 
 			particle = this._particles[ i ];
 			particle = this._particles[ i ];
-			if ( particle.isDead )
-	{
+			if ( particle.isDead ) {
 
 
 				//particle =
 				//particle =
 				this._particles.splice( i, 1 );
 				this._particles.splice( i, 1 );
@@ -389,15 +384,13 @@ SPARKS.Age = function( easing ) {
 SPARKS.Age.prototype.update = function ( emitter, particle, time ) {
 SPARKS.Age.prototype.update = function ( emitter, particle, time ) {
 
 
 	particle.age += time;
 	particle.age += time;
-	if ( particle.age >= particle.lifetime )
-    {
+	if ( particle.age >= particle.lifetime ) {
 
 
 		particle.energy = 0;
 		particle.energy = 0;
 		particle.isDead = true;
 		particle.isDead = true;
 
 
 	}
 	}
-	else
-	{
+	else {
 
 
 		var t = this._easing( particle.age / particle.lifetime );
 		var t = this._easing( particle.age / particle.lifetime );
 		particle.energy = - 1 * t + 1;
 		particle.energy = - 1 * t + 1;
@@ -971,17 +964,14 @@ SPARKS.Utils = {
 
 
 	},
 	},
 
 
-	getPerpendicular: function( v )
-	{
+	getPerpendicular: function( v ) {
 
 
-		if ( v.x == 0 )
-		{
+		if ( v.x == 0 ) {
 
 
 			return new THREE.Vector3D( 1, 0, 0 );
 			return new THREE.Vector3D( 1, 0, 0 );
 
 
 		}
 		}
-		else
-		{
+		else {
 
 
 			var temp = new THREE.Vector3( v.y, - v.x, 0 );
 			var temp = new THREE.Vector3( v.y, - v.x, 0 );
 			return temp.normalize();
 			return temp.normalize();

+ 2 - 4
examples/js/WaterShader.js

@@ -141,8 +141,7 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 	
 	
 	if ( camera instanceof THREE.PerspectiveCamera )
 	if ( camera instanceof THREE.PerspectiveCamera )
 		this.camera = camera;
 		this.camera = camera;
-	else 
-	{
+	else {
 
 
 		this.camera = new THREE.PerspectiveCamera();
 		this.camera = new THREE.PerspectiveCamera();
 		console.log( this.name + ': camera is not a Perspective Camera!' )
 		console.log( this.name + ': camera is not a Perspective Camera!' )
@@ -178,8 +177,7 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 	
 	
 	this.material.uniforms.eye.value = this.eye;
 	this.material.uniforms.eye.value = this.eye;
 	
 	
-	if ( ! THREE.Math.isPowerOfTwo( width ) || ! THREE.Math.isPowerOfTwo( height ) )
-	{
+	if ( ! THREE.Math.isPowerOfTwo( width ) || ! THREE.Math.isPowerOfTwo( height ) ) {
 
 
 		this.texture.generateMipmaps = false;
 		this.texture.generateMipmaps = false;
 		this.texture.minFilter = THREE.LinearFilter;
 		this.texture.minFilter = THREE.LinearFilter;

+ 2 - 4
examples/js/crossfade/scenes.js

@@ -38,8 +38,7 @@ function generateGeometry( objectType, numObjects ) {
 
 
 		scale.x = Math.random() * 200 + 100;
 		scale.x = Math.random() * 200 + 100;
 
 
-		if ( objectType == "cube" )
-		{
+		if ( objectType == "cube" ) {
 
 
 			geom = new THREE.BoxGeometry( 1, 1, 1 );
 			geom = new THREE.BoxGeometry( 1, 1, 1 );
 			scale.y = Math.random() * 200 + 100;
 			scale.y = Math.random() * 200 + 100;
@@ -47,8 +46,7 @@ function generateGeometry( objectType, numObjects ) {
 			color.setRGB( 0, 0, Math.random() + 0.1 );
 			color.setRGB( 0, 0, Math.random() + 0.1 );
 
 
 		}
 		}
-		else if ( objectType == "sphere" )
-		{
+		else if ( objectType == "sphere" ) {
 
 
 			geom = new THREE.IcosahedronGeometry( 1, 1 );
 			geom = new THREE.IcosahedronGeometry( 1, 1 );
 			scale.y = scale.z = scale.x;
 			scale.y = scale.z = scale.x;

+ 3 - 6
examples/js/crossfade/transition.js

@@ -120,18 +120,15 @@ function Transition ( sceneA, sceneB ) {
 	this.render = function( delta ) {
 	this.render = function( delta ) {
 		
 		
 		// Transition animation
 		// Transition animation
-		if ( transitionParams.animateTransition )
-		{
+		if ( transitionParams.animateTransition ) {
 
 
 			var t = ( 1 + Math.sin( transitionParams.transitionSpeed * clock.getElapsedTime() / Math.PI ) ) / 2;
 			var t = ( 1 + Math.sin( transitionParams.transitionSpeed * clock.getElapsedTime() / Math.PI ) ) / 2;
 			transitionParams.transition = THREE.Math.smoothstep( t, 0.3, 0.7 );
 			transitionParams.transition = THREE.Math.smoothstep( t, 0.3, 0.7 );
 			
 			
 			// Change the current alpha texture after each transition
 			// Change the current alpha texture after each transition
-			if ( transitionParams.loopTexture && ( transitionParams.transition == 0 || transitionParams.transition == 1 ) )
-			{
+			if ( transitionParams.loopTexture && ( transitionParams.transition == 0 || transitionParams.transition == 1 ) ) {
 
 
-				if ( this.needChange )
-				{
+				if ( this.needChange ) {
 
 
 					transitionParams.texture = ( transitionParams.texture + 1 ) % this.textures.length;
 					transitionParams.texture = ( transitionParams.texture + 1 ) % this.textures.length;
 					this.quadmaterial.uniforms.tMixTexture.value = this.textures[ transitionParams.texture ];
 					this.quadmaterial.uniforms.tMixTexture.value = this.textures[ transitionParams.texture ];

+ 3 - 6
examples/js/loaders/AWDLoader.js

@@ -55,15 +55,13 @@
 	AWDProperties = function() {}
 	AWDProperties = function() {}
 
 
 	AWDProperties.prototype = {
 	AWDProperties.prototype = {
-		set : function( key, value )
-		{
+		set : function( key, value ) {
 
 
 			this[ key ] = value;
 			this[ key ] = value;
 
 
 		},
 		},
 
 
-		get : function( key, fallback )
-		{
+		get : function( key, fallback ) {
 
 
 			if ( this.hasOwnProperty( key ) )
 			if ( this.hasOwnProperty( key ) )
 				return this[ key ];
 				return this[ key ];
@@ -548,8 +546,7 @@
 
 
 					mtx_data = this.parseMatrix4();
 					mtx_data = this.parseMatrix4();
 
 
-				} else
-				{
+				} else {
 
 
 					mtx_data = new THREE.Matrix4();
 					mtx_data = new THREE.Matrix4();
 
 

+ 1 - 2
examples/js/loaders/AssimpJSONLoader.js

@@ -37,8 +37,7 @@ THREE.AssimpJSONLoader.prototype = {
 			// This header is used to disambiguate between
 			// This header is used to disambiguate between
 			// different JSON-based file formats.
 			// different JSON-based file formats.
 			metadata = json.__metadata__;
 			metadata = json.__metadata__;
-			if ( typeof metadata !== 'undefined' )
-			{
+			if ( typeof metadata !== 'undefined' ) {
 
 
 				// Check if assimp2json at all
 				// Check if assimp2json at all
 				if ( metadata.format !== 'assimp2json' ) {
 				if ( metadata.format !== 'assimp2json' ) {

+ 9 - 18
examples/js/postprocessing/GlitchPass.js

@@ -42,15 +42,13 @@ THREE.GlitchPass = function ( dt_size ) {
 
 
 THREE.GlitchPass.prototype = {
 THREE.GlitchPass.prototype = {
 
 
-	render: function ( renderer, writeBuffer, readBuffer, delta ) 
-	{
+	render: function ( renderer, writeBuffer, readBuffer, delta ) {
 
 
 		this.uniforms[ "tDiffuse" ].value = readBuffer;
 		this.uniforms[ "tDiffuse" ].value = readBuffer;
 		this.uniforms[ 'seed' ].value = Math.random();//default seeding
 		this.uniforms[ 'seed' ].value = Math.random();//default seeding
 		this.uniforms[ 'byp' ].value = 0;
 		this.uniforms[ 'byp' ].value = 0;
 		
 		
-		if ( this.curF % this.randX == 0 || this.goWild == true )
-		{
+		if ( this.curF % this.randX == 0 || this.goWild == true ) {
 
 
 			this.uniforms[ 'amount' ].value = Math.random() / 30;
 			this.uniforms[ 'amount' ].value = Math.random() / 30;
 			this.uniforms[ 'angle' ].value = THREE.Math.randFloat( - Math.PI, Math.PI );
 			this.uniforms[ 'angle' ].value = THREE.Math.randFloat( - Math.PI, Math.PI );
@@ -62,8 +60,7 @@ THREE.GlitchPass.prototype = {
 			this.generateTrigger();
 			this.generateTrigger();
 
 
 		}
 		}
-		else if ( this.curF % this.randX < this.randX / 5 )
-		{
+		else if ( this.curF % this.randX < this.randX / 5 ) {
 
 
 			this.uniforms[ 'amount' ].value = Math.random() / 90;
 			this.uniforms[ 'amount' ].value = Math.random() / 90;
 			this.uniforms[ 'angle' ].value = THREE.Math.randFloat( - Math.PI, Math.PI );
 			this.uniforms[ 'angle' ].value = THREE.Math.randFloat( - Math.PI, Math.PI );
@@ -73,8 +70,7 @@ THREE.GlitchPass.prototype = {
 			this.uniforms[ 'seed_y' ].value = THREE.Math.randFloat( - 0.3, 0.3 );
 			this.uniforms[ 'seed_y' ].value = THREE.Math.randFloat( - 0.3, 0.3 );
 
 
 		}
 		}
-		else if ( this.goWild == false )
-		{
+		else if ( this.goWild == false ) {
 
 
 			this.uniforms[ 'byp' ].value = 1;
 			this.uniforms[ 'byp' ].value = 1;
 
 
@@ -82,35 +78,30 @@ THREE.GlitchPass.prototype = {
 		this.curF ++;
 		this.curF ++;
 		
 		
 		this.quad.material = this.material;
 		this.quad.material = this.material;
-		if ( this.renderToScreen ) 
-		{
+		if ( this.renderToScreen ) {
 
 
 			renderer.render( this.scene, this.camera );
 			renderer.render( this.scene, this.camera );
 
 
 		} 
 		} 
-		else 
-		{
+		else {
 
 
 			renderer.render( this.scene, this.camera, writeBuffer, false );
 			renderer.render( this.scene, this.camera, writeBuffer, false );
 
 
 		}
 		}
 
 
 	},
 	},
-	generateTrigger: function()
-	{
+	generateTrigger: function() {
 
 
 		this.randX = THREE.Math.randInt( 120, 240 );
 		this.randX = THREE.Math.randInt( 120, 240 );
 
 
 	},
 	},
-	generateHeightmap: function( dt_size )
-	{
+	generateHeightmap: function( dt_size ) {
 
 
 		var data_arr = new Float32Array( dt_size * dt_size * 3 );
 		var data_arr = new Float32Array( dt_size * dt_size * 3 );
 		console.log( dt_size );
 		console.log( dt_size );
 		var length = dt_size * dt_size;
 		var length = dt_size * dt_size;
 		
 		
-		for ( var i = 0; i < length; i ++ ) 
-		{
+		for ( var i = 0; i < length; i ++ ) {
 
 
 			var val = THREE.Math.randFloat( 0, 1 );
 			var val = THREE.Math.randFloat( 0, 1 );
 			data_arr[ i * 3 + 0 ] = val;
 			data_arr[ i * 3 + 0 ] = val;