Skip to content

Commit 3f7fb09

Browse files
committed
Fix more lint errors
1 parent 57c8e61 commit 3f7fb09

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

src/controls.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { GUI } from 'dat.gui';
22
import { Color } from 'three';
33
import { URDFJoint } from 'urdf-loader';
44

5-
interface Joints {
5+
interface IJoints {
66
[name: string]: URDFJoint;
77
}
88

99
export class URDFControls extends GUI {
1010
private _workspaceFolder: any;
1111
private _sceneFolder: any;
1212
private _jointsFolder: any;
13-
private _workingPath: string = '';
13+
private _workingPath = '';
1414

1515
controls: any = {
1616
path: {},
@@ -56,16 +56,18 @@ export class URDFControls extends GUI {
5656
return this._jointsFolder;
5757
}
5858

59-
private _isEmpty(obj: Object): Boolean {
59+
private _isEmpty(obj: object): boolean {
6060
return Object.keys(obj).length === 0;
6161
}
6262

63-
createWorkspaceControls(workingPath: string = '') {
63+
createWorkspaceControls(workingPath = '') {
6464
if (this._isEmpty(this.controls.path)) {
6565
this._workingPath = workingPath;
6666
const workspaceSettings = {
6767
Path: this._workingPath,
68-
'set path': () => {}
68+
'set path': () => {
69+
console.debug('set path');
70+
}
6971
};
7072
this._workspaceFolder.add(workspaceSettings, 'Path');
7173
this.controls.path = this._workspaceFolder.add(
@@ -125,7 +127,7 @@ export class URDFControls extends GUI {
125127
return colorArray;
126128
}
127129

128-
createJointControls(joints: Joints) {
130+
createJointControls(joints: IJoints) {
129131
if (this._isEmpty(this.controls.joints)) {
130132
Object.keys(joints).forEach((name: string) => {
131133
// Skip joints which should not be moved

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ const extension: JupyterFrontEndPlugin<void> = {
165165
// FIXME: Property 'push' does not exist on type 'readonly string[]'.
166166
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
167167
// @ts-ignore
168-
languageRegistry.findByMIME('text/xml')?.extensions?.push('urdf', 'xacro');
168+
languageRegistry.findByMIME('text/xml')?.extensions?.push('urdf');
169+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
170+
// @ts-ignore
171+
languageRegistry.findByMIME('text/xml')?.extensions?.push('xacro');
169172
}
170173
}
171174
};

src/layout.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { URDFControls } from './controls';
77
import { URDFRenderer } from './renderer';
88
import { URDFLoadingManager } from './robot';
99

10-
interface URDFColors {
10+
interface IURDFColors {
1111
sky: Color;
1212
ground: Color;
1313
}
@@ -19,7 +19,7 @@ export class URDFLayout extends PanelLayout {
1919
private _host: HTMLElement;
2020
private _controlsPanel: URDFControls;
2121
private _renderer: URDFRenderer;
22-
private _colors: URDFColors;
22+
private _colors: IURDFColors;
2323
private _loader: URDFLoadingManager;
2424

2525
/**
@@ -130,7 +130,9 @@ export class URDFLayout extends PanelLayout {
130130
* Set the callback functions for each of item in the controls panel
131131
*/
132132
private _setControls(): void {
133-
if (!this._loader.isReady) return;
133+
if (!this._loader.isReady) {
134+
return;
135+
}
134136

135137
this._setPathControls();
136138
this._setSceneControls();

src/renderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class URDFRenderer extends THREE.WebGLRenderer {
1818
private _controls: OrbitControls;
1919
private _colorSky = new THREE.Color();
2020
private _colorGround = new THREE.Color();
21-
private _robotIndex: number = -1;
21+
private _robotIndex = -1;
2222

2323
constructor(
2424
colorSky = new THREE.Color(0x263238),
@@ -160,7 +160,7 @@ export class URDFRenderer extends THREE.WebGLRenderer {
160160
this.redraw();
161161
}
162162

163-
setGridHeight(height: number = 0): void {
163+
setGridHeight(height = 0): void {
164164
const gridIndex = this._scene.children
165165
.map(i => i.type)
166166
.indexOf('GridHelper');

src/robot.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class XacroLoaderWithPath extends XacroLoader {
2424
export class URDFLoadingManager extends LoadingManager {
2525
private _urdfLoader: URDFLoader;
2626
private _xacroLoader: XacroLoaderWithPath;
27-
private _workingPath: string = '';
28-
private _robotString: string = '';
27+
private _workingPath = '';
28+
private _robotString = '';
2929
private _robotModel = {} as URDFRobot;
3030
private _isReady = false;
3131

@@ -61,7 +61,7 @@ export class URDFLoadingManager extends LoadingManager {
6161
PageConfig.getBaseUrl() + '/files' + this._workingPath;
6262
}
6363

64-
setRobot(robotString: string = ''): void {
64+
setRobot(robotString = ''): void {
6565
this._robotString = robotString || this._robotString;
6666

6767
if (robotString.includes('xacro')) {

0 commit comments

Comments
 (0)