diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 9f873442c55f..c260efc61f02 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -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 diff --git a/src/e2e/mobile.spec.ts b/src/e2e/mobile.spec.ts index b582f64fafca..735d0b639bee 100644 --- a/src/e2e/mobile.spec.ts +++ b/src/e2e/mobile.spec.ts @@ -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…'); diff --git a/src/lidar/Manager.ts b/src/lidar/Manager.ts index 7861c9b864a3..f503b2edd67b 100644 --- a/src/lidar/Manager.ts +++ b/src/lidar/Manager.ts @@ -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}`); }); } @@ -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')); diff --git a/src/lidar/PanelElement.ts b/src/lidar/PanelElement.ts index c51a3d375c04..dfe6e537ee87 100644 --- a/src/lidar/PanelElement.ts +++ b/src/lidar/PanelElement.ts @@ -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)); } diff --git a/src/lidar/Plot.ts b/src/lidar/Plot.ts index eca67d79d0ed..7fa89435c2d3 100644 --- a/src/lidar/Plot.ts +++ b/src/lidar/Plot.ts @@ -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({ diff --git a/src/message/Notification.ts b/src/message/Notification.ts index bf132a7a42c7..e7da20d904df 100644 --- a/src/message/Notification.ts +++ b/src/message/Notification.ts @@ -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: diff --git a/src/profile/d3Elevation.ts b/src/profile/d3Elevation.ts index c38f0dfd7da9..3eb04507cbe3 100644 --- a/src/profile/d3Elevation.ts +++ b/src/profile/d3Elevation.ts @@ -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') @@ -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'); diff --git a/webpack.config.js b/webpack.config.js index 05a27404bceb..512a53c30a6c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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) => {