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 ce2c3f7 commit 2e42c53
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ 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-unused-expressions': warn
'@typescript-eslint/prefer-promise-reject-errors': warn
# TODO: Remove before release 2.9
'@typescript-eslint/no-require-imports': 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
2 changes: 1 addition & 1 deletion src/message/Disclaimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export class MessageDisclaimerService extends ngeoMessageMessage {
jqueryObj.alert('close');
}
} else {
console.log(`No disclaimer found for '${message}'.`);
console.log(`No disclaimer found for '${message.msg}'.`);
}

// (3) Remove message from cache since it's closed now.
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
8 changes: 4 additions & 4 deletions src/message/Notification_OLD.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,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
2 changes: 1 addition & 1 deletion src/misc/php-date-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function _compare(str1, str2) {
* @returns {string}
*/
function _lpad(value, length, chr) {
const val = value.toString();
const val = value.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string
chr = chr || '0';
return val.length < length ? _lpad(chr + val, length) : val;
}
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
4 changes: 2 additions & 2 deletions src/query/Querent.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ export class Querent {
*/
wfsDescribeFeatureType(dataSource) {
if (!dataSource.supportsAttributes) {
throw `The data source must support WFS, have a single OGCLayer that
is queryable in order to issue WFS DescribeFeatureType requests`;
throw new Error(`The data source must support WFS, have a single OGCLayer that
is queryable in order to issue WFS DescribeFeatureType requests`);
}
if (!dataSource.wfsUrl) {
throw new Error('Missing WFS URL');
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 2e42c53

Please sign in to comment.