From 6c2a2ac790cc8a7bd85af3b01dc28d9ed93996d9 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Wed, 1 May 2024 21:12:46 +0200 Subject: [PATCH 1/3] Remove unused variables --- buildprocess/directory-loader.js | 1 - lib/Map/ColorMap/EnumColorMap.ts | 1 - lib/Map/Leaflet/LeafletVisualizer.ts | 2 -- lib/Models/Catalog/Ckan/CkanCatalogGroup.ts | 2 -- lib/Models/Catalog/Ckan/CkanItemReference.ts | 1 - lib/Models/Catalog/Esri/ArcGisCatalogGroup.ts | 1 - lib/Models/Catalog/Esri/ArcGisFeatureServerCatalogGroup.ts | 1 - lib/Models/Catalog/Esri/ArcGisPortalCatalogGroup.ts | 2 -- lib/ReactViews/StandardUserInterface/StandardUserInterface.tsx | 2 -- lib/ReactViews/Workbench/Controls/DisplayAsPercentSection.tsx | 2 +- lib/Styled/Input.tsx | 2 +- 11 files changed, 2 insertions(+), 15 deletions(-) diff --git a/buildprocess/directory-loader.js b/buildprocess/directory-loader.js index 35b142447fa..3124455b244 100644 --- a/buildprocess/directory-loader.js +++ b/buildprocess/directory-loader.js @@ -1,4 +1,3 @@ -var loaderUtils = require("loader-utils"); var path = require("path"); module.exports = DirectoryLoaderPlugin; diff --git a/lib/Map/ColorMap/EnumColorMap.ts b/lib/Map/ColorMap/EnumColorMap.ts index 30a721778e5..96afafeff23 100644 --- a/lib/Map/ColorMap/EnumColorMap.ts +++ b/lib/Map/ColorMap/EnumColorMap.ts @@ -40,7 +40,6 @@ export default class EnumColorMap extends ColorMap { } const values = this.values; - let i, len; for (let i = 0, len = values.length; i < len; ++i) { if (values[i] === value) { return this.colors[i]; diff --git a/lib/Map/Leaflet/LeafletVisualizer.ts b/lib/Map/Leaflet/LeafletVisualizer.ts index 40ec1940394..5aa431cafea 100644 --- a/lib/Map/Leaflet/LeafletVisualizer.ts +++ b/lib/Map/Leaflet/LeafletVisualizer.ts @@ -1106,8 +1106,6 @@ function getDashArray( material: PolylineDashMaterialProperty, time: JulianDate ): number[] { - let dashArray; - const dashPattern = material.dashPattern ? material.dashPattern.getValue(time) : undefined; diff --git a/lib/Models/Catalog/Ckan/CkanCatalogGroup.ts b/lib/Models/Catalog/Ckan/CkanCatalogGroup.ts index 251d85d2586..813f284ad8c 100644 --- a/lib/Models/Catalog/Ckan/CkanCatalogGroup.ts +++ b/lib/Models/Catalog/Ckan/CkanCatalogGroup.ts @@ -117,8 +117,6 @@ export class CkanServerStratum extends LoadableStratum(CkanCatalogGroupTraits) { static async load( catalogGroup: CkanCatalogGroup ): Promise { - const terria = catalogGroup.terria; - let ckanServerResponse: CkanServerResponse | undefined = undefined; // Each item in the array causes an independent request to the CKAN, and the results are concatenated diff --git a/lib/Models/Catalog/Ckan/CkanItemReference.ts b/lib/Models/Catalog/Ckan/CkanItemReference.ts index e8d150b198d..ca966402bf5 100644 --- a/lib/Models/Catalog/Ckan/CkanItemReference.ts +++ b/lib/Models/Catalog/Ckan/CkanItemReference.ts @@ -520,7 +520,6 @@ export function isResourceInSupportedFormats( formats: PreparedSupportedFormat[] ): PreparedSupportedFormat | undefined { if (resource === undefined) return undefined; - const matches: PreparedSupportedFormat[] = []; for (let i = 0; i < formats.length; ++i) { const format = formats[i]; if (resourceIsSupported(resource, format)) return format; diff --git a/lib/Models/Catalog/Esri/ArcGisCatalogGroup.ts b/lib/Models/Catalog/Esri/ArcGisCatalogGroup.ts index 08f43394f06..eae86593170 100644 --- a/lib/Models/Catalog/Esri/ArcGisCatalogGroup.ts +++ b/lib/Models/Catalog/Esri/ArcGisCatalogGroup.ts @@ -68,7 +68,6 @@ class ArcGisServerStratum extends LoadableStratum(ArcGisCatalogGroupTraits) { static async load( catalogGroup: ArcGisCatalogGroup ): Promise { - const terria = catalogGroup.terria; const uri = new URI(catalogGroup.url).addQuery("f", "json"); return loadJson(proxyCatalogItemUrl(catalogGroup, uri.toString())) .then((arcgisServer: ArcGisServer) => { diff --git a/lib/Models/Catalog/Esri/ArcGisFeatureServerCatalogGroup.ts b/lib/Models/Catalog/Esri/ArcGisFeatureServerCatalogGroup.ts index fe8f731e409..89023f689ce 100644 --- a/lib/Models/Catalog/Esri/ArcGisFeatureServerCatalogGroup.ts +++ b/lib/Models/Catalog/Esri/ArcGisFeatureServerCatalogGroup.ts @@ -120,7 +120,6 @@ export class FeatureServerStratum extends LoadableStratum( static async load( catalogGroup: ArcGisFeatureServerCatalogGroup | ArcGisCatalogGroup ): Promise { - const terria = catalogGroup.terria; const uri = new URI(catalogGroup.url).addQuery("f", "json"); return loadJson(proxyCatalogItemUrl(catalogGroup, uri.toString())) diff --git a/lib/Models/Catalog/Esri/ArcGisPortalCatalogGroup.ts b/lib/Models/Catalog/Esri/ArcGisPortalCatalogGroup.ts index 08857cfe2f5..6ecade7de18 100644 --- a/lib/Models/Catalog/Esri/ArcGisPortalCatalogGroup.ts +++ b/lib/Models/Catalog/Esri/ArcGisPortalCatalogGroup.ts @@ -60,8 +60,6 @@ export class ArcGisPortalStratum extends LoadableStratum( static async load( catalogGroup: ArcGisPortalCatalogGroup ): Promise { - const terria = catalogGroup.terria; - let portalGroupsServerResponse: | ArcGisPortalGroupSearchResponse | undefined = undefined; diff --git a/lib/ReactViews/StandardUserInterface/StandardUserInterface.tsx b/lib/ReactViews/StandardUserInterface/StandardUserInterface.tsx index 5fcececb343..9575bcf01d2 100644 --- a/lib/ReactViews/StandardUserInterface/StandardUserInterface.tsx +++ b/lib/ReactViews/StandardUserInterface/StandardUserInterface.tsx @@ -129,8 +129,6 @@ const StandardUserInterfaceBase: React.FC = props.children ); - const terria = props.terria; - const showStoryBuilder = props.viewState.storyBuilderShown && !props.viewState.useSmallScreenInterface; diff --git a/lib/ReactViews/Workbench/Controls/DisplayAsPercentSection.tsx b/lib/ReactViews/Workbench/Controls/DisplayAsPercentSection.tsx index 2d28defaa60..b2b9bb7dc63 100644 --- a/lib/ReactViews/Workbench/Controls/DisplayAsPercentSection.tsx +++ b/lib/ReactViews/Workbench/Controls/DisplayAsPercentSection.tsx @@ -13,7 +13,7 @@ const DisplayAsPercentSection: React.FC = ( props: IDisplayAsPercentSection ) => { const { t } = useTranslation(); - const theme = useTheme(); + useTheme(); const togglePercentage = () => { props.item.displayPercent = !props.item.displayPercent; }; diff --git a/lib/Styled/Input.tsx b/lib/Styled/Input.tsx index af39408e4a0..3b2bcb2ed85 100644 --- a/lib/Styled/Input.tsx +++ b/lib/Styled/Input.tsx @@ -126,7 +126,7 @@ export const StyledInput = styled.input` const Input: React.FC = (props: InputProps) => { const { boxProps, ...rest }: InputProps = props; - const theme: DefaultTheme = useTheme(); + useTheme(); return ( From 56620c0e838b535602e492029980e6d3c58707e1 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Fri, 31 May 2024 07:43:56 +0200 Subject: [PATCH 2/3] gulpfile: update number of expected warnings --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index b2eb80bf41d..44063425f68 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -54,7 +54,7 @@ gulp.task("lint", function (done) { "--ignore-pattern", "lib/ThirdParty", "--max-warnings", - "264" // TODO: Bring this back to 0 + "238" // TODO: Bring this back to 0 ]); done(); From 5128e819c2bf2eab5204d5cf8f17930ca0341bae Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Fri, 31 May 2024 07:40:37 +0200 Subject: [PATCH 3/3] Remove unused directory-loader.js --- buildprocess/directory-loader.js | 66 -------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 buildprocess/directory-loader.js diff --git a/buildprocess/directory-loader.js b/buildprocess/directory-loader.js deleted file mode 100644 index 3124455b244..00000000000 --- a/buildprocess/directory-loader.js +++ /dev/null @@ -1,66 +0,0 @@ -var path = require("path"); - -module.exports = DirectoryLoaderPlugin; - -function DirectoryLoaderPlugin(paths) { - this.paths = paths; -} - -DirectoryLoaderPlugin.prototype.apply = function (resolver) { - var optPaths = this.paths; - console.log("A" + optPaths); - - resolver.plugin("directory", function (request, callback) { - var dirPath = this.join(request.path, request.request); - var dirName = dirPath.substr( - dirPath.lastIndexOf(path.sep) + path.sep.length - ); - - if (optPaths && optPaths.indexOf(dirPath) >= 0) { - this.fileSystem.stat( - dirPath, - function (err, stat) { - if (err || !stat || !stat.isDirectory()) { - callback.log && - callback.log( - request.path + - " doesn't exist or is not a directory (directory named)" - ); - return callback(); - } - - try { - request.resolved = true; - callback.log = function () { - console.log(arguments); - }; - console.log(callback); - return callback(null, null); - } catch (e) { - console.error(e); - throw e; - } - }.bind(this) - ); - } - //} else { - callback(); - //} - }); -}; - -DirectoryLoaderPlugin.loader = function (content) { - //this.cacheable && this.cacheable(); - //if(!this.emitFile) throw new Error("emitFile is required from module system"); - //var query = loaderUtils.parseQuery(this.query); - //var url = loaderUtils.interpolateName(this, query.name || "[hash].[ext]", { - // context: query.context || this.options.context, - // content: content, - // regExp: query.regExp - //}); - //this.emitFile(url, content); - //return "module.exports = __webpack_public_path__ + " + JSON.stringify(url) + ";"; - console.log("blah"); - return " hello "; -}; -DirectoryLoaderPlugin.loader.raw = true;