Skip to content

Commit

Permalink
Update to typescript-eslint 8.24
Browse files Browse the repository at this point in the history
  • Loading branch information
pjonsson committed Feb 12, 2025
1 parent 85c8cd9 commit 5031acb
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 96 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-object-type": [
"error",
{ allowInterfaces: "with-single-extends" }
],
"@typescript-eslint/unified-signatures": "error",
"react-hooks/exhaustive-deps": "error",
"react/jsx-boolean-value": ["error", "never", { always: [] }],
Expand Down
1 change: 1 addition & 0 deletions lib/ModelMixins/GroupMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function GroupMixin<T extends AbstractConstructor<BaseType>>(Base: T) {
member.name
) {
// Push member to map
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
membersByName.get(member.name)?.push(member) ??
membersByName.set(member.name, [member]);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Models/Definition/addModelStrataView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function addModelStrataView<
T extends TraitsConstructor<ModelTraits>
>(
/* TODO: Use a more specific type than "Function". */
/* eslint-disable-next-line @typescript-eslint/ban-types */
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
model: Stratified<InstanceType<T>> | Function,
Traits: T
): ModelPropertiesFromTraits<InstanceType<T>>;
Expand Down
1 change: 1 addition & 0 deletions lib/Models/Terria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ export default class Terria {
addShareKey(id: string, shareKey: string): void {
if (id === shareKey || this.shareKeysMap.has(shareKey)) return;
this.shareKeysMap.set(shareKey, id);
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
this.modelIdShareKeysMap.get(id)?.push(shareKey) ??
this.modelIdShareKeysMap.set(id, [shareKey]);
}
Expand Down
1 change: 1 addition & 0 deletions lib/ReactViews/FeatureInfo/FeatureInfoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export class FeatureInfoSection extends React.Component<FeatureInfoProps> {

@computed get featureProperties() {
// Force computed to re-calculate when cesium feature properties change
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
this.featureChangedCounter;

return getFeatureProperties(
Expand Down
1 change: 1 addition & 0 deletions lib/Table/createRegionMappedImageryProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const getImageryLayerFeatureInfo = (

if (!isDefined(rowId)) return;

// eslint-disable-next-line @typescript-eslint/no-unused-expressions
style.tableModel.tableColumns;

const rowObject = style.tableModel.tableColumns.reduce<{
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@
"@types/node": "^18.15.11",
"@types/proj4": "^2.5.5",
"@types/webpack": "4.41.33",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"babel-plugin-styled-components": "^1.10.7",
"bufferutil": "^4.0.8",
"eslint": "^8.57.0",
Expand Down
9 changes: 4 additions & 5 deletions test/Map/EarthGravityModel1996Spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use strict";

var Cartographic = require("terriajs-cesium/Source/Core/Cartographic").default;
var EarthGravityModel1996 = require("../../lib/Map/Vector/EarthGravityModel1996");
import Cartographic from "terriajs-cesium/Source/Core/Cartographic";
import EarthGravityModel1996 from "../../lib/Map/Vector/EarthGravityModel1996";
import gravityModel from "../../wwwroot/data/WW15MGH.DAC";

var describeIfSupported = EarthGravityModel1996.isSupported()
? describe
Expand All @@ -11,9 +12,7 @@ describeIfSupported("EarthGravityModel1996", function () {
var egm96;

beforeAll(function () {
egm96 = new EarthGravityModel1996(
require("file-loader!../../wwwroot/data/WW15MGH.DAC")
);
egm96 = new EarthGravityModel1996(gravityModel);
});

// NGA calculator is here: http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/intpt.html
Expand Down
3 changes: 3 additions & 0 deletions test/ModelMixins/TableMixinSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,7 @@ describe("TableMixin", function () {
).timeIntervalCollection;

if (!featureData)
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
`Failed to find featureData for feature ID: ${feature.id}`;

// If feature data doesn't contain current discrete time - we can safely continue
Expand Down Expand Up @@ -1837,6 +1838,7 @@ describe("TableMixin", function () {
).timeIntervalCollection;

if (!featureData)
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
`Failed to find featureData for feature ID: ${feature.id}`;

// If feature data doesn't contain current discrete time - we can safely continue
Expand Down Expand Up @@ -1999,6 +2001,7 @@ describe("TableMixin", function () {
).timeIntervalCollection;

if (!featureData)
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
`Failed to find featureData for feature ID: ${feature.id}`;

const featureIdColumnValue = featureData?.getValue(time)?.id;
Expand Down
1 change: 1 addition & 0 deletions test/Models/Catalog/CatalogItems/KmlCatalogItemSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ describeIfSupported("KmlCatalogItem", function () {
});

it("can load a KMZ file by URL", function (done) {
// eslint-disable-next-line @typescript-eslint/no-require-imports
kml.url = require("file-loader!../../../../wwwroot/test/KML/vic_police.kmz");
kml
.load()
Expand Down
Loading

0 comments on commit 5031acb

Please sign in to comment.