Skip to content

Commit

Permalink
Fix or ignore new checks errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Aug 26, 2024
1 parent 169b02d commit faf3201
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ rules:
'@typescript-eslint/no-misused-promises': warn
'@typescript-eslint/require-await': warn
'@typescript-eslint/no-unsafe-argument': warn
'@typescript-eslint/no-unused-vars': warn
'@typescript-eslint/no-useless-constructor': error
'@typescript-eslint/prefer-for-of': error
'@typescript-eslint/prefer-includes': error
Expand Down
2 changes: 1 addition & 1 deletion src/e2e/mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ if (Cypress.browser.isHeaded) {
cy.wrap(btn)
.click({force: true})
.then((btn) => {
expect(btn).to.not.be.visible;
expect(btn).to.not.be.visible; // eslint-disable-line @typescript-eslint/no-unused-expressions

// Check the placeholder
cy.get('.tt-input').should('have.attr', 'placeholder', 'Search…');
Expand Down
3 changes: 2 additions & 1 deletion src/lidar/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export class LidarprofileManager {
this.processBuffer_(data, iter, distanceOffset, lastLOD, resetPlot);
})
.catch((err: Error) => {
throw `Error on pytree query: ${err.message}`;
throw new Error(`Error on pytree query: ${err.message}`);
});
}

Expand Down Expand Up @@ -470,6 +470,7 @@ export class LidarprofileManager {

try {
JSON.parse(strHeaderLocal);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
if (!this.isPlotSetup_) {
const canvas: any = d3select(lidarContainerElement.querySelector('.lidar-canvas'));
Expand Down
2 changes: 1 addition & 1 deletion src/lidar/PanelElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default class GmfLidarPanel extends ToolPanelElement {
* @param key The key string of the toggled classification.
*/
toggleVisibility(classification: LidarprofileServerConfigClassification, key: string): void {
classification.visible === 0 ? (classification.visible = 1) : (classification.visible = 0);
classification.visible = classification.visible === 0 ? 1 : 0;
this.setClassification(classification, parseInt(key));
}

Expand Down
2 changes: 1 addition & 1 deletion src/lidar/Plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export default class {
source.clear();
const lidarPointGeom = new olGeomPoint([p.coords[0], p.coords[1]]);
const lidarPointFeature = new olFeature(lidarPointGeom);
if (typeof pointClassification.color !== undefined) {
if (pointClassification.color !== undefined) {
lidarPointFeature.setStyle(
new olStyleStyle({
image: new olStyleCircle({
Expand Down
8 changes: 4 additions & 4 deletions src/message/Notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ export class MessageNotification extends ngeoMessageMessage {

const classNames = ['alert', 'fade', 'show'];
switch (type) {
case MessageType.ERROR:
case MessageType.ERROR: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-danger');
break;
case MessageType.INFORMATION:
case MessageType.INFORMATION: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-info');
break;
case MessageType.SUCCESS:
case MessageType.SUCCESS: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-success');
break;
case MessageType.WARNING:
case MessageType.WARNING: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-warning');
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions src/profile/d3Elevation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function d3Elevation(
.attr('dy', '.75em')
.attr('transform', 'rotate(-90)')
.style('fill', 'grey')
.text(`${yAxisLabel} [m]`); // eslint-disable-line @typescript-eslint/restrict-template-expressions
.text(`${yAxisLabel} [m]`); // eslint-disable-line @typescript-eslint/restrict-template-expressions,@typescript-eslint/no-base-to-string

gEnter
.append('g')
Expand Down Expand Up @@ -447,7 +447,7 @@ function d3Elevation(
g.select('.x.axis').transition().call(xAxis);

g.select('.x.label')
.text(`${xAxisLabel} [${xUnits}]`) // eslint-disable-line @typescript-eslint/restrict-template-expressions
.text(`${xAxisLabel} [${xUnits}]`) // eslint-disable-line @typescript-eslint/restrict-template-expressions,@typescript-eslint/no-base-to-string
.style('fill', 'grey')
.style('shape-rendering', 'crispEdges');

Expand Down
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

/* eslint-disable @typescript-eslint/no-require-imports */

const {merge} = require('webpack-merge');

module.exports = (env, args) => {
Expand Down

0 comments on commit faf3201

Please sign in to comment.