Skip to content
Open
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.

119 changes: 119 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
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/**'
]
},

// 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'
Comment on lines +69 to +70
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines have been newly added

},
},
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',
Comment on lines +104 to +109
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I turned these off because they seemed to be new rules and were causing lint errors / warnings. It may be worth considering adjusting the codebase and turning these on.


// 'jsdoc/check-types': 'error',
Copy link
Collaborator Author

@gkjohnson gkjohnson Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this is enabled there are some errors in the JSDoc comments that are caught. I'll leave it to another contribution to re-enable and fix these. It may be worth enabling the JSDoc "recommended" settings above to see if there are any rules worth keeping from there, too.

'jsdoc/require-returns': 'off',
'jsdoc/require-returns-type': 'error',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/require-param-type': 'error'
}
}
];
Loading
Loading