Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion editor/js/Script.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ function Script( editor ) {

} );

signals.materialChanged.add( function ( object, slot ) {
signals.materialChanged.add( function ( object/*, slot */ ) {

if ( object !== currentObject ) return;

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Selector {

// Cycle through objects if the first one is already selected

let index = objects.indexOf( editor.selected );
const index = objects.indexOf( editor.selected );

if ( index !== - 1 && index < objects.length - 1 ) {

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Sidebar.Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ function SidebarMaterial( editor ) {
output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );

} catch ( e ) {
} catch ( error ) {

output = JSON.stringify( output );

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Sidebar.Object.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function SidebarObject( editor ) {
output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );

} catch ( e ) {
} catch ( error ) {

output = JSON.stringify( output );

Expand Down
4 changes: 2 additions & 2 deletions editor/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ self.addEventListener( 'install', async function () {

await cache.add( asset );

} catch {
} catch ( error ) {

console.warn( '[SW] Couldn\'t cache:', asset );

Expand Down Expand Up @@ -284,7 +284,7 @@ async function networkFirst( request ) {

return response;

} catch {
} catch ( error ) {

const cachedResponse = await caches.match( request );

Expand Down
125 changes: 125 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import js from '@eslint/js';
import globals from 'globals';
import mdcs from 'eslint-config-mdcs';
import compat from 'eslint-plugin-compat';
import html from 'eslint-plugin-html';
import importPlugin from 'eslint-plugin-import';
import jsdoc from 'eslint-plugin-jsdoc';

export default [
// files to ignore
{
name: 'files to ignore',
ignores: [
'**/node_modules/**',
'**/build/**',
'**/libs/**',
'**/ifc/**',
'**/prettify.js',
'**/prettify/**',
'**/3rdparty/**',
'**/shapefile.js',
'**/vendor/**',
'**/fuse/**',
'**/template/static/**',
]
},

// recommended
js.configs.recommended,
// jsdoc.configs['flat/recommended'],

// base rules
{
name: 'base rules',
files: [ '**/*.js', '**/*.html' ],
plugins: {
html,
import: importPlugin,
compat,
jsdoc
},
languageOptions: {
ecmaVersion: 2018,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es2017,
__THREE_DEVTOOLS__: 'readonly',
potpack: 'readonly',
fflate: 'readonly',
Stats: 'readonly',
XRWebGLBinding: 'readonly',
XRWebGLLayer: 'readonly',
GPUShaderStage: 'readonly',
GPUBufferUsage: 'readonly',
GPUTextureUsage: 'readonly',
GPUTexture: 'readonly',
GPUMapMode: 'readonly',
QUnit: 'readonly',
Ammo: 'readonly',
XRRigidTransform: 'readonly',
XRMediaBinding: 'readonly',
CodeMirror: 'readonly',
esprima: 'readonly',
jsonlint: 'readonly',
VideoFrame: 'readonly',
VideoDecoder: 'readonly',
Float16Array: 'readonly',
BigInt: 'readonly',
BigUint64Array: 'readonly'
},
},
settings: {
polyfills: [
'WebGL2RenderingContext'
],
jsdoc: {
preferredTypes: {
Any: 'any',
Boolean: 'boolean',
Number: 'number',
object: 'Object',
String: 'string'
},
tagNamePreference: {
returns: 'return',
extends: 'augments'
},
},
},
rules: {
...mdcs.rules,
...compat.configs.recommended.rules,
'no-throw-literal': 'error',
'quotes': [ 'error', 'single' ],
'prefer-const': [ 'error', {
destructuring: 'any',
ignoreReadBeforeAssign: false
} ],
'no-irregular-whitespace': 'error',
'no-duplicate-imports': 'error',
'prefer-spread': 'error',

'no-useless-escape': 'off',
'no-case-declarations': 'off',
'no-cond-assign': 'off',
'getter-return': 'off',
'no-async-promise-executor': 'off',
'no-empty': 'off',
'no-fallthrough': 'off',
'no-prototype-builtins': 'off',
'no-loss-of-precision': 'off',
'no-unused-vars': [ 'error', {
caughtErrors: 'none',
} ],
'jsdoc/check-types': 'error',
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-type': 'error',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/require-param-type': 'error'
}
}
];
9 changes: 5 additions & 4 deletions examples/jsm/loaders/3DMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
SpotLight,
Sprite,
SpriteMaterial,
TextureLoader
TextureLoader,
EquirectangularReflectionMapping
} from 'three';

import { EXRLoader } from '../loaders/EXRLoader.js';
Expand Down Expand Up @@ -507,7 +508,7 @@ class Rhino3dmLoader extends Loader {

new EXRLoader().load( renderEnvironment.image, function ( texture ) {

texture.mapping = THREE.EquirectangularReflectionMapping;
texture.mapping = EquirectangularReflectionMapping;
mat.envMap = texture;

} );
Expand Down Expand Up @@ -697,7 +698,7 @@ class Rhino3dmLoader extends Loader {

geometry = loader.parse( obj.geometry );

if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
if ( geometry.hasAttribute( 'color' ) ) {

material = new PointsMaterial( { vertexColors: true, sizeAttenuation: false, size: 2 } );

Expand Down Expand Up @@ -740,7 +741,7 @@ class Rhino3dmLoader extends Loader {
}


if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
if ( geometry.hasAttribute( 'color' ) ) {

mat.vertexColors = true;

Expand Down
2 changes: 0 additions & 2 deletions examples/jsm/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1615,11 +1615,9 @@ class GeometryParser {

case 'Mesh':
return this.parseMeshGeometry( relationships, geoNode, deformers );
break;

case 'NurbsCurve':
return this.parseNurbsGeometry( geoNode );
break;

}

Expand Down
1 change: 0 additions & 1 deletion examples/jsm/loaders/HDRLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ class HDRLoader extends DataTextureLoader {
default:

throw new Error( 'THREE.HDRLoader: Unsupported type: ' + this.type );
break;

}

Expand Down
2 changes: 0 additions & 2 deletions examples/jsm/loaders/TDSLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,11 +684,9 @@ class TDSLoader extends Loader {

case INT_PERCENTAGE:
return ( subChunk.readShort( ) / 100 );
break;

case FLOAT_PERCENTAGE:
return subChunk.readFloat( );
break;

default:
this.debugMessage( ' Unknown percentage chunk: ' + subChunk.hexId );
Expand Down
2 changes: 0 additions & 2 deletions examples/jsm/loaders/TGALoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ class TGALoader extends DataTextureLoader {

default:
throw new Error( 'THREE.TGALoader: Format not supported.' );
break;

}

Expand All @@ -415,7 +414,6 @@ class TGALoader extends DataTextureLoader {

default:
throw new Error( 'THREE.TGALoader: Format not supported.' );
break;

}

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/loaders/VRMLLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3167,8 +3167,8 @@ class VRMLLoader extends Loader {
*
* @param {BufferGeometry} geometry
* @param {number} radius
* @param {array} angles
* @param {array} colors
* @param {Array} angles
* @param {Array} colors
* @param {boolean} topDown - Whether to work top down or bottom up.
*/
function paintFaces( geometry, radius, angles, colors, topDown ) {
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/usd/USDCParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {

class USDCParser {

parse( buffer ) {
parse( /* buffer */ ) {

// TODO

Expand Down
1 change: 0 additions & 1 deletion examples/jsm/misc/Volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class Volume {
case 'uint64' :
case 'uint64_t' :
throw new Error( 'Error in Volume constructor : this type is not supported in JavaScript' );
break;
case 'Float32' :
case 'float32' :
case 'float' :
Expand Down
1 change: 0 additions & 1 deletion examples/jsm/misc/VolumeSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class VolumeSlice {

index = value;
slice.geometryNeedsUpdate = true;
return index;

}
} );
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/physics/AmmoPhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function AmmoPhysics() {

}

const AmmoLib = await Ammo(); // eslint-disable-line no-undef
const AmmoLib = await Ammo();

const frameRate = 60;

Expand Down
Loading
Loading