Skip to content

Commit

Permalink
Eslint: auto-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Aug 26, 2024
1 parent 00699cc commit 99e63fa
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/auth/FormElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,9 @@ export default class GmfAuthForm extends GmfBaseElement {
*/
cleanForm_(): void {
const form = this.renderRoot.querySelector('form') as HTMLFormElement;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion

const loginField = document.body.querySelector('input[slot=gmf-auth-login]') as HTMLInputElement;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion

const passwordField = document.body.querySelector('input[slot=gmf-auth-password]') as HTMLInputElement;
form.reset();
loginField.value = '';
Expand Down
3 changes: 0 additions & 3 deletions src/auth/component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe('Auth component', () => {
} as Configuration);
});

// eslint-disable-next-line @typescript-eslint/no-misused-promises
it.skip('tries to login with wrong credentials', async () => {
gmfAuthenticationService.load_();
expect(user.getState()).to.equal(UserState.NOT_INITIALIZED);
Expand All @@ -81,7 +80,6 @@ describe('Auth component', () => {
});
});

// eslint-disable-next-line @typescript-eslint/no-misused-promises
it.skip('logins successfully', async () => {
gmfAuthenticationService.load_();
expect(user.getState()).to.equal(UserState.READY);
Expand All @@ -95,7 +93,6 @@ describe('Auth component', () => {
});
});

// eslint-disable-next-line @typescript-eslint/no-misused-promises
it.skip('logs out', async () => {
expect(user.getState()).to.equal(UserState.LOGGED_IN);
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Expand Down
1 change: 0 additions & 1 deletion src/auth/component.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import './FormElement';
import './PanelElement';
Expand Down
1 change: 0 additions & 1 deletion src/canvas/Desktop.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import ToolButtonElement, {ToolButtonDefault} from 'gmfapi/elements/ToolButtonElement';
import {css, html, TemplateResult} from 'lit';
Expand Down
1 change: 0 additions & 1 deletion src/download/Csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export class DownloadCsvService {

const rowValues = values.map((value) => {
if (value !== undefined && value !== null) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
const strValue = `${value}`;
// wrap each value into quotes and escape quotes with double quotes
return `${this.quote_}${strValue.replace(matchAllQuotesRegex, doubleQuote)}${this.quote_}`;
Expand Down
7 changes: 2 additions & 5 deletions src/e2e/desktop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/unbound-method */

import olMap from 'ol/Map';
import path from 'path';
Expand Down Expand Up @@ -251,9 +248,9 @@ if (Cypress.browser.isHeaded) {
*/
function validateCsv(csv: string, validationObject: any) {
cy.wrap(csv)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument

.then(stripBom) // Remove Byte order mark
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument

.then(neatCSV) // Parse the CSV
.then((list: any) => {
expect(list, 'number of records').to.have.length(1);
Expand Down
2 changes: 1 addition & 1 deletion src/lidar/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export class LidarprofileManager {
this.profilePoints.altitude.push(z);
this.profilePoints.coords.push([x, y]);
}
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

aoffset = aoffset + attribute.bytes;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/lidar/Measure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ export default class {
if (p !== null) {
this.pStart_.distance = p.distance;
this.pStart_.altitude = p.altitude;
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

this.pStart_.cx = sx(p.distance) + margin.left;
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

this.pStart_.cy = sy(p.altitude) + margin.top;
} else {
// @ts-ignore
Expand All @@ -178,9 +178,9 @@ export default class {
if (p !== null) {
this.pEnd_.distance = p.distance;
this.pEnd_.altitude = p.altitude;
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

this.pEnd_.cx = sx(p.distance) + margin.left;
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

this.pEnd_.cy = sy(p.altitude) + margin.top;
} else {
// @ts-ignore
Expand Down Expand Up @@ -221,9 +221,9 @@ export default class {
svg
.append('text')
.attr('id', 'text_m')
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

.attr('x', 10 + (this.pStart_.cx + this.pEnd_.cx) / 2)
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

.attr('y', (this.pStart_.cy + this.pEnd_.cy) / 2)
.text(`${height} m`)
.attr('font-family', 'sans-serif')
Expand Down
23 changes: 10 additions & 13 deletions src/lidar/Plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ export default class {
const containerEl = container.node();
const containerWidth = containerEl.getBoundingClientRect().width;
const containerHeight = containerEl.getBoundingClientRect().height;
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

this.width_ = containerWidth - (margin.left + margin.right);
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

this.height_ = containerHeight - (margin.top + margin.bottom);

this.material = this.manager_.config.serverConfig.default_attribute;
Expand Down Expand Up @@ -322,7 +322,6 @@ export default class {

svg.selectAll('*').remove();

// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
svg.attr('width', this.width_ + margin.left).attr('height', this.height_ + margin.top + margin.bottom);

svg.on('mousemove', (event: MouseEvent) => {
Expand All @@ -340,9 +339,8 @@ export default class {
// @ts-ignore
svg.append('g').attr('class', 'x axis').call(xAxis);

// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
svg.select('.y.axis').attr('transform', `translate(${margin.left}, ${margin.top})`);
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

svg.select('.x.axis').attr('transform', `translate(${margin.left}, ${this.height_ + margin.top})`);

svg.select('.y.axis').selectAll('g.tick line').style('opacity', '0.5').style('stroke', '#b7cff7');
Expand Down Expand Up @@ -470,9 +468,8 @@ export default class {

const source = this.manager_.lidarPointHighlight.getSource();
if (p != undefined) {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
cx = this.updateScaleX(p.distance) + margin.left;
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

cy = this.updateScaleY(p.altitude) + margin.top;

svg.selectAll('#highlightCircle').remove();
Expand All @@ -482,7 +479,7 @@ export default class {
.attr('id', 'highlightCircle')
.attr('cx', cx)
.attr('cy', cy)
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

.attr('r', pointSize + 1)
.style('fill', 'orange');

Expand Down Expand Up @@ -515,7 +512,7 @@ export default class {
);
}

source.addFeature(lidarPointFeature); // eslint-disable-line @typescript-eslint/no-unsafe-call
source.addFeature(lidarPointFeature);
} else {
source.clear();
svg.select('#highlightCircle').remove();
Expand Down Expand Up @@ -544,22 +541,22 @@ export default class {

if (distance !== undefined) {
const distanceTxt = i18next.t('Distance: ');
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

html.push(`${distanceTxt + this.formatDecimals(distance, distDecimal)}`);
}
if (altitude !== undefined) {
const altitudeTxt = i18next.t('Altitude: ');
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

html.push(`${altitudeTxt + this.formatDecimals(altitude, distDecimal)}`);
}
if (classification.length > 0) {
const classificationTxt = i18next.t('Classification: ');
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

html.push(`${classificationTxt + classification}`);
}
if (intensity !== undefined) {
const intensityTxt = i18next.t('Intensity: ');
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands

html.push(`${intensityTxt + this.formatDecimals(intensity, 0)}`);
}

Expand Down
3 changes: 1 addition & 2 deletions src/profile/d3Elevation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable jsdoc/no-undefined-types */

import d3, {
area as d3area,
Expand Down Expand Up @@ -269,7 +268,7 @@ function d3Elevation(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const func = function (data: number[][], index: number, groups: d3.BaseType[] | ArrayLike<d3.BaseType>) {
// @ts-ignore
const element: ContainerElement = this; // eslint-disable-line @typescript-eslint/no-this-alias, @typescript-eslint/no-explicit-any
const element: ContainerElement = this; // eslint-disable-line @typescript-eslint/no-this-alias
d3select(element).selectAll('svg').remove();
if (data === undefined) {
return;
Expand Down

0 comments on commit 99e63fa

Please sign in to comment.