Skip to content

Jsdoc: enable eslint rule valid-jsdoc.preferType #30509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2025
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
9 changes: 8 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@
"requireReturnType": true,
"requireParamDescription": false,
"requireReturnDescription": false,
"requireParamType": true
"requireParamType": true,
"preferType": {
"Any": "any",
"Boolean": "boolean",
"Number": "number",
"object": "Object",
"String": "string"
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion editor/js/commands/AddScriptCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class AddScriptCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} [script='']
* @param {string} [script='']
* @constructor
*/
constructor( editor, object = null, script = '' ) {
Expand Down
2 changes: 1 addition & 1 deletion editor/js/commands/RemoveScriptCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class RemoveScriptCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} [script='']
* @param {string} [script='']
* @constructor
*/
constructor( editor, object = null, script = '' ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/js/commands/SetColorCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class SetColorCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} attributeName
* @param {Number|null} [newValue=null] Integer representing a hex color value
* @param {string} attributeName
* @param {?number} [newValue=null] Integer representing a hex color value
* @constructor
*/
constructor( editor, object = null, attributeName = '', newValue = null ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/js/commands/SetGeometryValueCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class SetGeometryValueCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} [attributeName='']
* @param {Number|String|Boolean|Object|null} [newValue=null]
* @param {string} [attributeName='']
* @param {number|string|boolean|Object|null} [newValue=null]
* @constructor
*/
constructor( editor, object = null, attributeName = '', newValue = null ) {
Expand Down
6 changes: 3 additions & 3 deletions editor/js/commands/SetMaterialColorCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class SetMaterialColorCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} attributeName
* @param {Number|null} [newValue=null] Integer representing a hex color value
* @param {Number} [materialSlot=-1]
* @param {string} attributeName
* @param {?number} [newValue=null] Integer representing a hex color value
* @param {number} [materialSlot=-1]
* @constructor
*/
constructor( editor, object = null, attributeName = '', newValue = null, materialSlot = - 1 ) {
Expand Down
2 changes: 1 addition & 1 deletion editor/js/commands/SetMaterialCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class SetMaterialCommand extends Command {
* @param {Editor} editor
* @param {THREE.Object3D|null} object
* @param {THREE.Material|null} newMaterial
* @param {Number} [materialSlot=-1]
* @param {number} [materialSlot=-1]
* @constructor
*/
constructor( editor, object = null, newMaterial = null, materialSlot = - 1 ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/js/commands/SetMaterialMapCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class SetMaterialMapCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} [mapName='']
* @param {string} [mapName='']
* @param {THREE.Texture|null} [newMap=null]
* @param {Number} [materialSlot=-1]
* @param {number} [materialSlot=-1]
* @constructor
*/
constructor( editor, object = null, mapName = '', newMap = null, materialSlot = - 1 ) {
Expand Down
8 changes: 4 additions & 4 deletions editor/js/commands/SetMaterialRangeCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class SetMaterialRangeCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} [attributeName='']
* @param {Number} [newMinValue=-Infinity]
* @param {Number} [newMaxValue=Infinity]
* @param {Number} [materialSlot=-1]
* @param {string} [attributeName='']
* @param {number} [newMinValue=-Infinity]
* @param {number} [newMaxValue=Infinity]
* @param {number} [materialSlot=-1]
* @constructor
*/
constructor( editor, object = null, attributeName = '', newMinValue = - Infinity, newMaxValue = Infinity, materialSlot = - 1 ) {
Expand Down
6 changes: 3 additions & 3 deletions editor/js/commands/SetMaterialValueCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class SetMaterialValueCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} [attributeName='']
* @param {Number|String|Boolean|Object|null} [newValue=null]
* @param {Number} [materialSlot=-1]
* @param {string} [attributeName='']
* @param {number|string|boolean|Object|null} [newValue=null]
* @param {number} [materialSlot=-1]
* @constructor
*/
constructor( editor, object = null, attributeName = '', newValue = null, materialSlot = - 1 ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/js/commands/SetMaterialVectorCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class SetMaterialVectorCommand extends Command {
*
* @param {Editor} editor
* @param {THREE.Object3D|null} [object=null]
* @param {String} [attributeName='']
* @param {string} [attributeName='']
* @param {THREE.Vector2|THREE.Vector3|THREE.Vector4|null} [newValue=null]
* @param {Number} [materialSlot=-1]
* @param {number} [materialSlot=-1]
* @constructor
*/
constructor( editor, object = null, attributeName = '', newValue = null, materialSlot = - 1 ) {
Expand Down
6 changes: 3 additions & 3 deletions editor/js/commands/SetScriptValueCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class SetScriptValueCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} object
* @param {String} script
* @param {String} attributeName
* @param {String} newValue
* @param {string} script
* @param {string} attributeName
* @param {string} newValue
* @constructor
*/
constructor( editor, object = null, script = '', attributeName = '', newValue = null ) {
Expand Down
4 changes: 2 additions & 2 deletions editor/js/commands/SetShadowValueCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class SetShadowValueCommand extends Command {
/**
* @param {Editor} editor
* @param {THREE.Object3D|null} object
* @param {String} attributeName
* @param {Number|String|Boolean|Object|null} newValue
* @param {string} attributeName
* @param {number|string|boolean|Object|null} newValue
* @constructor
*/
constructor( editor, object = null, attributeName = '', newValue = null ) {
Expand Down
2 changes: 1 addition & 1 deletion editor/js/commands/SetValueCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SetValueCommand extends Command {
* @param {Editor} editor
* @param {THREE.Object3D|null} object
* @param {string} attributeName
* @param {Number|String|Boolean|Object|null} newValue
* @param {number|string|boolean|Object|null} newValue
* @constructor
*/
constructor( editor, object = null, attributeName = '', newValue = null ) {
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ class GLTFWriter {
/**
* Process material
* @param {THREE.Material} material Material to process
* @return {Promise<Number|null>} Index of the processed material in the "materials" array
* @return {Promise<number|null>} Index of the processed material in the "materials" array
*/
async processMaterialAsync( material ) {

Expand Down Expand Up @@ -1662,7 +1662,7 @@ class GLTFWriter {
/**
* Process mesh
* @param {THREE.Mesh} mesh Mesh to process
* @return {Promise<Number|null>} Index of the processed mesh in the "meshes" array
* @return {Promise<number|null>} Index of the processed mesh in the "meshes" array
*/
async processMeshAsync( mesh ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/3MFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ThreeMFLoader extends Loader {

} else if ( file.match( /^3D\/[^\/]*\.model$/ ) ) {

rootModelFile = file ;
rootModelFile = file;

} else if ( file.match( /^3D\/.*\/.*\.model$/ ) ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2254,7 +2254,7 @@ const ALPHA_MODES = {
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material
*
* @param {Object<String, Material>} cache
* @param {Object<string, Material>} cache
* @return {Material}
*/
function createDefaultMaterial( cache ) {
Expand Down
10 changes: 5 additions & 5 deletions examples/jsm/tsl/utils/Raymarching.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const hitBox = /*@__PURE__*/ Fn( ( { orig, dir } ) => {
*
* @tsl
* @function
* @param {Number|Node} steps - The number of steps for raymarching.
* @param {number|Node} steps - The number of steps for raymarching.
* @param {Function|FunctionNode} callback - The callback function to execute at each step.
* @returns {void}
*/
Expand Down Expand Up @@ -71,10 +71,10 @@ export const RaymarchingBox = ( steps, callback ) => {
* @function
* @param {Object} params - The parameters for the function.
* @param {Texture|Node} params.texture - The 3D texture to sample.
* @param {Number|Node} [params.range=0.1] - The range for the smoothstep function.
* @param {Number|Node} [params.threshold=0.25] - The threshold for the smoothstep function.
* @param {Number|Node} [params.opacity=0.25] - The opacity value for the final color.
* @param {Number|Node} [params.steps=100] - The number of steps for raymarching.
* @param {number|Node} [params.range=0.1] - The range for the smoothstep function.
* @param {number|Node} [params.threshold=0.25] - The threshold for the smoothstep function.
* @param {number|Node} [params.opacity=0.25] - The opacity value for the final color.
* @param {number|Node} [params.steps=100] - The number of steps for raymarching.
* @returns {Function} The generated function that performs raymarching on the 3D texture.
*/
export const raymarchingTexture3D = Fn( ( {
Expand Down