From db461a7b69d20aea38d1d1fe0d5c6fed3f8c8d04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 00:01:07 +0200 Subject: [PATCH] Bump the eslint group across 1 directory with 3 updates (#172) * Bump the eslint group across 1 directory with 3 updates Bumps the eslint group with 3 updates in the / directory: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [eslint](https://github.com/eslint/eslint). Updates `@typescript-eslint/eslint-plugin` from 7.18.0 to 8.0.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.0.1/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 7.18.0 to 8.0.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.0.1/packages/parser) Updates `eslint` from 8.57.0 to 9.8.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.57.0...v9.8.0) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint ... Signed-off-by: dependabot[bot] * migrate to the new eslint and relint the project * yatag is needed only for git checkouts * try polyfilling on Node 16 * remove esModuleInterop and use a namespace import * try loading the polyfill in the eslint config file * use a default import --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Momtchil Momtchev --- .eslintrc.json | 222 ---------------------- eslint.config.mjs | 220 +++++++++++++++++++++ lib/gdal.js | 2 +- package.json | 12 +- test/_common.ts | 5 +- test/_hooks.ts | 1 - test/api_algorithms.test.ts | 13 +- test/api_asyncIterators.test.ts | 8 +- test/api_base.test.ts | 2 - test/api_circularstring.test.ts | 1 - test/api_classes.test.ts | 1 - test/api_coordinatetransformation.test.ts | 1 - test/api_curve.test.ts | 4 +- test/api_dataset.test.ts | 5 +- test/api_drivers.test.ts | 1 - test/api_envelope.test.ts | 1 - test/api_envelope3d.test.ts | 3 +- test/api_feature.test.ts | 1 - test/api_geometry.test.ts | 1 - test/api_layer.test.ts | 10 +- test/api_layerAsync.test.ts | 10 +- test/api_linearring.test.ts | 1 - test/api_linestring.test.ts | 1 - test/api_multidim.test.ts | 3 +- test/api_point.test.ts | 1 - test/api_polygon.test.ts | 2 - test/api_rasterband-async.test.ts | 3 +- test/api_rasterband.test.ts | 3 +- test/api_spatialreference.test.ts | 1 - test/api_utils.test.ts | 3 +- test/api_warp.test.ts | 3 +- test/api_warpAsync.test.ts | 1 - test/object_lifetime.test.ts | 49 ++--- test/open.test.ts | 1 - test/open_geojson.test.ts | 1 - test/open_gpx.test.ts | 1 - test/open_grib.test.ts | 1 - test/open_gtiff.test.ts | 1 - test/open_hdf5.test.ts | 1 - test/open_hfa.test.ts | 1 - test/open_jpeg2000.test.ts | 1 - test/open_jpg.test.ts | 1 - test/open_jsonfg.test.ts | 1 - test/open_mitab.test.ts | 1 - test/open_netcdf.test.ts | 1 - test/open_openfilegdb.test.ts | 1 - test/open_pmtiles.test.ts | 1 - test/open_png.test.ts | 1 - test/open_sdts.test.ts | 1 - test/open_shp.test.ts | 1 - test/open_vrt.test.ts | 1 - test/open_vsicurl.test.ts | 1 - test/open_vsigzip.test.ts | 1 - test/open_vsimem.test.ts | 9 +- test/open_vsis3.test.ts | 1 - test/open_wcs.test.ts | 1 - test/open_wms.test.ts | 1 - test/open_wmts.test.ts | 1 - test/stress.js | 2 +- 59 files changed, 283 insertions(+), 347 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 076919196..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "env": { - "mocha": true, - "node": true, - "es6": true - }, - "extends": [ - "eslint:recommended", - "plugin:array-func/recommended" - ], - "plugins": [ - "mocha", - "prefer-arrow" - ], - "rules": { - "prefer-const": [ - "error", - { - "destructuring": "all", - "ignoreReadBeforeAssign": false - } - ], - "array-bracket-spacing": [ - 2, - "always" - ], - "array-callback-return": 1, - "arrow-parens": 2, - "arrow-spacing": 1, - "curly": [ - "error", - "multi-line", - "consistent" - ], - "key-spacing": [ - 2, - { - "beforeColon": false, - "afterColon": true - } - ], - "comma-dangle": [ - 2, - "never" - ], - "dot-notation": 1, - "dot-location": [ - 2, - "property" - ], - "eol-last": 2, - "handle-callback-err": 1, - "indent": [ - "error", - 2, - { - "SwitchCase": 1 - } - ], - "brace-style": 1, - "keyword-spacing": 1, - "new-parens": 1, - "no-await-in-loop": 1, - "no-self-compare": 1, - "no-throw-literal": 1, - "no-console": 0, - "no-debugger": 0, - "no-else-return": 1, - "no-extra-parens": 1, - "no-floating-decimal": 1, - "no-implicit-coercion": 0, - "no-mixed-spaces-and-tabs": 1, - "no-multi-spaces": 1, - "no-multiple-empty-lines": 1, - "no-path-concat": 1, - "no-return-await": 1, - "no-trailing-spaces": 1, - "no-unneeded-ternary": 1, - "no-unused-vars": [ - 2, - { - "ignoreRestSiblings": true, - "args": "after-used", - "argsIgnorePattern": "^_" - } - ], - "no-useless-concat": 1, - "no-useless-call": 1, - "no-useless-constructor": 1, - "no-useless-return": 1, - "no-var": 2, - "no-with": 1, - "vars-on-top": 1, - "object-curly-spacing": [ - 2, - "always" - ], - "template-curly-spacing": [ - "error", - "never" - ], - "prefer-promise-reject-errors": 1, - "prefer-template": 1, - "prefer-arrow-callback": 1, - "arrow-body-style": [ - "error", - "as-needed" - ], - "prefer-arrow/prefer-arrow-functions": [ - "warn", - { - "singleReturnOnly": true, - "classPropertiesAllowed": true - } - ], - "quotes": [ - "error", - "single", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "mocha/no-exclusive-tests": "error", - "mocha/no-identical-title": "error", - "mocha/no-nested-tests": "error", - "computed-property-spacing": 1, - "func-call-spacing": 1, - "semi": [ - 2, - "never" - ], - "space-before-blocks": [ - 2, - "always" - ], - "space-before-function-paren": [ - 2, - { - "anonymous": "always", - "named": "never" - } - ], - "space-in-parens": [ - "error", - "never" - ], - "strict": 0, - "yoda": 1, - "require-atomic-updates": 0, - "quote-props": [ - "error", - "as-needed" - ] - }, - "overrides": [ - { - "files": [ - "test/*.ts" - ], - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "no-extra-parens": "off" - } - }, - { - "files": [ - "test/api_asyncIterators.test.js" - ], - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "parserOptions": { - "ecmaVersion": 2018 - } - }, - { - "files": [ - "test/stress.js", - "lib/readable.js", - "lib/writable.js", - "lib/multiplexer.js", - "bench/*.js", - "examples/serve-async.js" - ], - "parserOptions": { - "ecmaVersion": 2018 - } - }, - { - "files": [ - "*.mjs" - ], - "parserOptions": { - "ecmaVersion": 2023, - "sourceType": "module" - } - }, - { - "files": [ - "examples/electron/*" - ], - "env": { - "browser": true - } - } - ] -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..ce421ce90 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,220 @@ +import structuredClone from '@ungap/structured-clone' +if (!('structuredClone' in globalThis)) { + console.log('Using a JS implementation of structuredClone') + globalThis.structuredClone = structuredClone +} + +import mocha from 'eslint-plugin-mocha' +import preferArrow from 'eslint-plugin-prefer-arrow' +import globals from 'globals' +import typescriptEslint from '@typescript-eslint/eslint-plugin' +import tsParser from '@typescript-eslint/parser' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import js from '@eslint/js' +import { FlatCompat } from '@eslint/eslintrc' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}) + +export default [ + ...compat.extends('eslint:recommended', 'plugin:array-func/recommended'), + { + plugins: { + mocha, + 'prefer-arrow': preferArrow + }, + + languageOptions: { + globals: { + ...globals.mocha, + ...globals.node + } + }, + + rules: { + 'prefer-const': [ 'error', { + destructuring: 'all', + ignoreReadBeforeAssign: false + } ], + + 'array-bracket-spacing': [ 2, 'always' ], + 'array-callback-return': 1, + 'arrow-parens': 2, + 'arrow-spacing': 1, + curly: [ 'error', 'multi-line', 'consistent' ], + + 'key-spacing': [ 2, { + beforeColon: false, + afterColon: true + } ], + + 'comma-dangle': [ 2, 'never' ], + 'dot-notation': 1, + 'dot-location': [ 2, 'property' ], + 'eol-last': 2, + 'handle-callback-err': 1, + + indent: [ 'error', 2, { + SwitchCase: 1 + } ], + + 'brace-style': 1, + 'keyword-spacing': 1, + 'new-parens': 1, + 'no-await-in-loop': 1, + 'no-self-compare': 1, + 'no-throw-literal': 1, + 'no-console': 0, + 'no-debugger': 0, + 'no-else-return': 1, + 'no-extra-parens': 1, + 'no-floating-decimal': 1, + 'no-implicit-coercion': 0, + 'no-mixed-spaces-and-tabs': 1, + 'no-multi-spaces': 1, + 'no-multiple-empty-lines': 1, + 'no-path-concat': 1, + 'no-return-await': 1, + 'no-trailing-spaces': 1, + 'no-unneeded-ternary': 1, + + 'no-unused-vars': [ 2, { + ignoreRestSiblings: true, + args: 'after-used', + argsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_' + } ], + + 'no-useless-concat': 1, + 'no-useless-call': 1, + 'no-useless-constructor': 1, + 'no-useless-return': 1, + 'no-var': 2, + 'no-with': 1, + 'vars-on-top': 1, + 'object-curly-spacing': [ 2, 'always' ], + 'template-curly-spacing': [ 'error', 'never' ], + 'prefer-promise-reject-errors': 1, + 'prefer-template': 1, + 'prefer-arrow-callback': 1, + 'arrow-body-style': [ 'error', 'as-needed' ], + + 'prefer-arrow/prefer-arrow-functions': [ 'warn', { + singleReturnOnly: true, + classPropertiesAllowed: true + } ], + + quotes: [ 'error', 'single', { + avoidEscape: true, + allowTemplateLiterals: true + } ], + + 'mocha/no-exclusive-tests': 'error', + 'mocha/no-identical-title': 'error', + 'mocha/no-nested-tests': 'error', + 'computed-property-spacing': 1, + 'func-call-spacing': 1, + semi: [ 2, 'never' ], + 'space-before-blocks': [ 2, 'always' ], + + 'space-before-function-paren': [ 2, { + anonymous: 'always', + named: 'never' + } ], + + 'space-in-parens': [ 'error', 'never' ], + strict: 0, + yoda: 1, + 'require-atomic-updates': 0, + 'quote-props': [ 'error', 'as-needed' ] + } + }, + ...compat.extends( + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended' + ).map((config) => ({ + ...config, + files: [ 'test/*.ts' ] + })), + { + files: [ 'test/*.ts' ], + + plugins: { + '@typescript-eslint': typescriptEslint + }, + + languageOptions: { + parser: tsParser + }, + + rules: { + 'no-extra-parens': 'off', + '@typescript-eslint/no-unused-vars': [ 2, { + ignoreRestSiblings: true, + args: 'after-used', + argsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_' + } ] + } + }, + ...compat.extends( + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended' + ).map((config) => ({ + ...config, + files: [ 'test/api_asyncIterators.test.js' ] + })), + { + files: [ 'test/api_asyncIterators.test.js' ], + + plugins: { + '@typescript-eslint': typescriptEslint + }, + + languageOptions: { + parser: tsParser, + ecmaVersion: 2018, + sourceType: 'script' + } + }, + { + files: [ + 'test/stress.js', + 'lib/readable.js', + 'lib/writable.js', + 'lib/multiplexer.js', + 'bench/*.js', + 'examples/serve-async.js' + ], + + languageOptions: { + ecmaVersion: 2018, + sourceType: 'script' + } + }, + { + files: [ '**/*.mjs' ], + + languageOptions: { + ecmaVersion: 2023, + sourceType: 'module' + } + }, + { + files: [ 'examples/electron/*' ], + + languageOptions: { + globals: { + ...globals.browser + } + } + } +] diff --git a/lib/gdal.js b/lib/gdal.js index a18c6ae43..cf2f35a5f 100644 --- a/lib/gdal.js +++ b/lib/gdal.js @@ -401,7 +401,7 @@ gdal.open = (function () { try { ds = driver.open(filename, mode) return false - } catch (err) { + } catch (_err) { /* skip driver */ } }) diff --git a/package.json b/package.json index 79093aaae..596ad5d57 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "lint:fix": "eslint lib test examples --fix", "lint": "npm run lint:js && npm run lint:cpp", "install": "node-pre-gyp install --fallback-to-build -j max && echo 'If you are using gdal-async, please do not forget that I am living below the poverty line because of the extortion.'", - "prepare": "npm run yatag", "yatag": "npx yatag", "gpp": "gpp -H lib/default_iterators.gpp -o lib/default_iterators.js && eslint --fix lib/default_iterators.js", "doc:build": "npx documentation build --config=documentation.yml src/*.cpp src/collections/*.cpp src/geometry/*.cpp lib/*.js -f=html -o=doc --theme=node_modules/documentation-hipster/index.js", @@ -96,6 +95,8 @@ "@mapbox/node-pre-gyp" ], "devDependencies": { + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.8.0", "@mmomtchev/documentation": "^14.0.1", "@mmomtchev/node-pre-gyp-github": "^2.0.0", "@octokit/core": "^6.0.1", @@ -104,8 +105,10 @@ "@types/mocha": "^10.0.6", "@types/node": "^22.0.0", "@types/semver": "^7.3.9", - "@typescript-eslint/eslint-plugin": "^7.0.1", - "@typescript-eslint/parser": "^7.0.1", + "@types/ungap__structured-clone": "^1.2.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", + "@ungap/structured-clone": "^1.2.0", "aws-sdk": "^2.1130.0", "benny": "^3.7.1", "c8": "^10.1.2", @@ -113,11 +116,12 @@ "chai-as-promised": "^7.1.1", "documentation-hipster": "^1.0.0", "documentation-polyglot": "^1.0.1", - "eslint": "^8.15.0", + "eslint": "^9.8.0", "eslint-plugin-array-func": "^4.0.0", "eslint-plugin-mocha": "^10.1.0", "eslint-plugin-prefer-arrow": "^1.1.3", "gh-pages": "^6.1.1", + "globals": "^15.9.0", "mocha": "^10.0.0", "semver": "^7.3.5", "ts-node": "^10.7.0", diff --git a/test/_common.ts b/test/_common.ts index 3a8baf4b5..893dd8e89 100644 --- a/test/_common.ts +++ b/test/_common.ts @@ -6,15 +6,16 @@ console.log(`GDAL Version: ${gdal.version}, source: ${gdal.bundled ? 'bundled' : try { // eslint-disable-next-line @typescript-eslint/no-explicit-any (gdal as any).startLogging(`${__dirname}/artifacts/log.txt`) -} catch (e) { +} catch (_e) { /* ignore */ } // seg fault handler let SegfaultHandler try { + // eslint-disable-next-line @typescript-eslint/no-require-imports SegfaultHandler = require('segfault-handler') SegfaultHandler.registerHandler() -} catch (err) { +} catch (_err) { /* ignore */ } diff --git a/test/_hooks.ts b/test/_hooks.ts index df12415da..cc269b4c0 100644 --- a/test/_hooks.ts +++ b/test/_hooks.ts @@ -49,7 +49,6 @@ const bundledSkip = function (this: Mocha.Context) { const cleanup = () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any delete (gdal as any).drivers - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion global.gc!() } diff --git a/test/api_algorithms.test.ts b/test/api_algorithms.test.ts index e72c0ef76..35302ff9f 100644 --- a/test/api_algorithms.test.ts +++ b/test/api_algorithms.test.ts @@ -7,7 +7,6 @@ import * as chaiAsPromised from 'chai-as-promised' chai.use(chaiAsPromised) describe('gdal', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('contourGenerate()', () => { @@ -38,7 +37,7 @@ describe('gdal', () => { afterEach(() => { try { dst.close() - } catch (err) { + } catch (_err) { /* ignore */ } }) @@ -178,7 +177,7 @@ describe('gdal', () => { afterEach(() => { try { src.close() - } catch (err) { + } catch (_err) { /* ignore */ } }) @@ -243,7 +242,7 @@ describe('gdal', () => { afterEach(() => { try { src.close() - } catch (err) { + } catch (_err) { /* ignore */ } }) @@ -307,7 +306,7 @@ describe('gdal', () => { afterEach(() => { try { src.close() - } catch (err) { + } catch (_err) { /* ignore */ } }) @@ -389,7 +388,7 @@ describe('gdal', () => { after(() => { try { src.close() - } catch (err) { + } catch (_err) { /* ignore */ } }) @@ -401,7 +400,7 @@ describe('gdal', () => { afterEach(() => { try { dst.close() - } catch (err) { + } catch (_err) { /* ignore */ } }) diff --git a/test/api_asyncIterators.test.ts b/test/api_asyncIterators.test.ts index c37d840bf..67cd7e685 100644 --- a/test/api_asyncIterators.test.ts +++ b/test/api_asyncIterators.test.ts @@ -25,7 +25,7 @@ if (Symbol.asyncIterator) { const ds = gdal.open(path.resolve(__dirname, 'data', 'multiband.tif')) ds.close() return assert.isRejected((async () => { - for await (const band of ds.bands) band + for await (const band of ds.bands) void band })(), /already been destroyed/) }) }) @@ -51,7 +51,7 @@ if (Symbol.asyncIterator) { const layer = ds.layers.get(0) ds.close() return assert.isRejected((async () => { - for (const l of layer.features) l + for (const l of layer.features) void l })(), /already destroyed/) }) }) @@ -85,7 +85,7 @@ if (Symbol.asyncIterator) { ds.close() gdal.vsimem.release(tempFile) return assert.isRejected((async () => { - for await (const overview of band.overviews) overview + for await (const overview of band.overviews) void overview })(), /already been destroyed/) }) } @@ -112,7 +112,7 @@ if (Symbol.asyncIterator) { const ds = gdal.open(path.resolve(__dirname, 'data', 'gfs.t00z.alnsf.nc'), 'mr') ds.close() return assert.isRejected((async () => { - for await (const i of ds.root[prop]) i + for await (const i of ds.root[prop]) void i })(), /already been destroyed/) }) }) diff --git a/test/api_base.test.ts b/test/api_base.test.ts index 55f076fe5..59de5c79a 100644 --- a/test/api_base.test.ts +++ b/test/api_base.test.ts @@ -11,7 +11,6 @@ if (process.env.GDAL_DATA !== undefined) { } describe('gdal', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('"lastError" property', () => { @@ -81,7 +80,6 @@ describe('gdal', () => { const env = Object.assign({}, process.env) env.GDAL_DATA = 'bogus' const gdalJS = fs.existsSync('./lib/gdal.js') ? './lib/gdal.js' : 'gdal-async' - // eslint-disable-next-line @typescript-eslint/no-var-requires // The manual delete/global.gc() allows for error-free unit testing of the ASAN build const command = `"const gdal = require('${gdalJS}'); console.log(gdal.config.get('GDAL_DATA')); delete gdal.drivers; global.gc();"` diff --git a/test/api_circularstring.test.ts b/test/api_circularstring.test.ts index 2d0a2d2a0..136afeadb 100644 --- a/test/api_circularstring.test.ts +++ b/test/api_circularstring.test.ts @@ -2,7 +2,6 @@ import { assert } from 'chai' import * as gdal from 'gdal-async' describe('gdal.CircularString', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { diff --git a/test/api_classes.test.ts b/test/api_classes.test.ts index 4d6b94b31..3032e2fcc 100644 --- a/test/api_classes.test.ts +++ b/test/api_classes.test.ts @@ -58,7 +58,6 @@ const create31 = { } describe('Class semantics', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) const klasses = create diff --git a/test/api_coordinatetransformation.test.ts b/test/api_coordinatetransformation.test.ts index fb8a56a98..cf6031871 100644 --- a/test/api_coordinatetransformation.test.ts +++ b/test/api_coordinatetransformation.test.ts @@ -2,7 +2,6 @@ import * as gdal from 'gdal-async' import { assert } from 'chai' describe('gdal.CoordinateTransformation', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be exposed', () => { diff --git a/test/api_curve.test.ts b/test/api_curve.test.ts index 5898be08c..f87f839fc 100644 --- a/test/api_curve.test.ts +++ b/test/api_curve.test.ts @@ -2,7 +2,6 @@ import { assert } from 'chai' import * as gdal from 'gdal-async' describe('gdal.CompoundCurve', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { @@ -17,7 +16,7 @@ describe('gdal.CompoundCurve', () => { before(() => { try { compoundcurve = gdal.Geometry.fromWKT('COMPOUNDCURVE (CIRCULARSTRING (692012.37315768 594722.610031277,692057.127042054 594649.528941062,692067.186040178 594564.425636366),(692067.186040178 594564.425636366,692026.997800346 594156.751911029),CIRCULARSTRING (692026.997800346 594156.751911029,692061.574244064 594070.897749602,692151.782327678 594050.18617928))') as gdal.CompoundCurve - } catch (e) { + } catch (_e) { // ignore } }) @@ -92,7 +91,6 @@ describe('gdal.CompoundCurve', () => { }) describe('gdal.MultiCurve', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { diff --git a/test/api_dataset.test.ts b/test/api_dataset.test.ts index 6b0a9ee51..dc560ce76 100644 --- a/test/api_dataset.test.ts +++ b/test/api_dataset.test.ts @@ -20,7 +20,6 @@ const NAD83_WKT = 'UNIT["Meter",1.0]]' describe('gdal.Dataset', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) let ds: gdal.Dataset @@ -171,7 +170,7 @@ describe('gdal.Dataset', () => { const ds = gdal.open(`${__dirname}/data/sample.tif`) ds.close() assert.throws(() => { - for (const band of ds.bands) band + for (const band of ds.bands) void band }) }) }) @@ -1030,7 +1029,7 @@ describe('gdal.Dataset', () => { const ds = gdal.open(tempFile, 'r+') try { ds.buildOverviews('NEAREST', [ 2, 4, -3 ]) - } catch (e) { + } catch (_e) { /* ignore (see above) */ } ds.close() diff --git a/test/api_drivers.test.ts b/test/api_drivers.test.ts index 100000cd9..4584c9dc4 100644 --- a/test/api_drivers.test.ts +++ b/test/api_drivers.test.ts @@ -6,7 +6,6 @@ import * as gdal from 'gdal-async' chai.use(chaiAsPromised) describe('gdal.drivers', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('count()', () => { diff --git a/test/api_envelope.test.ts b/test/api_envelope.test.ts index 0042ab9cf..30c548905 100644 --- a/test/api_envelope.test.ts +++ b/test/api_envelope.test.ts @@ -3,7 +3,6 @@ import { assert } from 'chai' import * as gdal from 'gdal-async' describe('gdal.Envelope', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { diff --git a/test/api_envelope3d.test.ts b/test/api_envelope3d.test.ts index 26cd435b3..13f192263 100644 --- a/test/api_envelope3d.test.ts +++ b/test/api_envelope3d.test.ts @@ -3,7 +3,6 @@ import { assert } from 'chai' import * as gdal from 'gdal-async' describe('gdal.Envelope3D', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { @@ -105,7 +104,7 @@ describe('gdal.Envelope3D', () => { square.rings.add(ring) const envelope = square.getEnvelope3D() - assert.propertyVal(envelope, 'minX', 0), + assert.propertyVal(envelope, 'minX', 0) assert.propertyVal(envelope, 'maxX', 10) assert.propertyVal(envelope, 'minY', 0) assert.propertyVal(envelope, 'maxY', 10) diff --git a/test/api_feature.test.ts b/test/api_feature.test.ts index 1446440d4..fc22dc701 100644 --- a/test/api_feature.test.ts +++ b/test/api_feature.test.ts @@ -3,7 +3,6 @@ import { assert } from 'chai' import * as path from 'path' describe('gdal.Feature', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) let ds: gdal.Dataset, lyr: gdal.Layer, defn: gdal.FeatureDefn, fields: gdal.FieldDefn[] diff --git a/test/api_geometry.test.ts b/test/api_geometry.test.ts index 1f78c8c2d..28d060f7a 100644 --- a/test/api_geometry.test.ts +++ b/test/api_geometry.test.ts @@ -11,7 +11,6 @@ const WGS84 = 'GEOGCS["WGS_84",DATUM["WGS_1984",SPHEROID["WGS_84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433],AXIS["Longitude",EAST],AXIS["Latitude",NORTH]]' describe('gdal.Geometry', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('toJSON()', () => { diff --git a/test/api_layer.test.ts b/test/api_layer.test.ts index a9240b698..282d4bdbc 100644 --- a/test/api_layer.test.ts +++ b/test/api_layer.test.ts @@ -4,12 +4,10 @@ import * as fileUtils from './utils/file' import * as semver from 'semver' describe('gdal.Layer', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('instance', () => { type prepareCb = (ds: gdal.Dataset, l: gdal.Layer) => void - // eslint-disable-next-line @typescript-eslint/no-unused-vars const prepare_dataset_layer_test = function (mode: string, _arg2: Record | prepareCb, _arg3?: prepareCb) { let ds: gdal.Dataset, layer: gdal.Layer, options, callback: prepareCb, err, file: string, dir: string | null, driver: gdal.Driver @@ -52,21 +50,21 @@ describe('gdal.Layer', () => { if (options.autoclose !== false) { try { ds.close() - } catch (e) { + } catch (_e) { /* ignore */ } if (file && mode === 'w') { try { driver = gdal.drivers.get('ESRI Shapefile') driver.deleteDataset(file) - } catch (e) { + } catch (_e) { /* ignore */ } } if (dir) { try { fileUtils.deleteRecursiveVSIMEM(dir) - } catch (e) { + } catch (_e) { /* ignore */ } } @@ -551,7 +549,7 @@ describe('gdal.Layer', () => { prepare_dataset_layer_test('r', (dataset, layer) => { dataset.close() assert.throws(() => { - for (const l of layer.features) l + for (const l of layer.features) void l }, /already destroyed/) }) }) diff --git a/test/api_layerAsync.test.ts b/test/api_layerAsync.test.ts index 250a7e848..a2ef0423f 100644 --- a/test/api_layerAsync.test.ts +++ b/test/api_layerAsync.test.ts @@ -8,20 +8,19 @@ import * as semver from 'semver' chai.use(chaiAsPromised) describe('gdal.LayerAsync', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('instance', () => { const cleanupWrite = (ds: gdal.Dataset, file: string) => { try { ds.close() - } catch (e) { + } catch (_e) { /* ignore */ } try { const driver = gdal.drivers.get('ESRI Shapefile') driver.deleteDataset(file) - } catch (e) { + } catch (_e) { /* ignore */ } } @@ -29,19 +28,18 @@ describe('gdal.LayerAsync', () => { const cleanupRead = (ds: gdal.Dataset, dir: string) => { try { ds.close() - } catch (e) { + } catch (_e) { /* ignore */ } try { fileUtils.deleteRecursiveVSIMEM(dir) - } catch (e) { + } catch (_e) { /* ignore */ } } type prepareCb = (ds: gdal.Dataset, l: gdal.Layer, file: string) => void - // eslint-disable-next-line @typescript-eslint/no-unused-vars const prepare_dataset_layer_test = function (mode: string, _arg2: Record | prepareCb, _arg3?: prepareCb) { let ds: gdal.Dataset, layer: gdal.Layer, options, callback: prepareCb, err, file: string, dir: string | null, driver: gdal.Driver diff --git a/test/api_linearring.test.ts b/test/api_linearring.test.ts index 67ccdbbe8..20729d1be 100644 --- a/test/api_linearring.test.ts +++ b/test/api_linearring.test.ts @@ -2,7 +2,6 @@ import { assert } from 'chai' import * as gdal from 'gdal-async' describe('gdal.LinearRing', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { diff --git a/test/api_linestring.test.ts b/test/api_linestring.test.ts index 1d65e3385..2f3d7666b 100644 --- a/test/api_linestring.test.ts +++ b/test/api_linestring.test.ts @@ -2,7 +2,6 @@ import * as gdal from 'gdal-async' import { assert } from 'chai' describe('gdal.LineString', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { diff --git a/test/api_multidim.test.ts b/test/api_multidim.test.ts index 2cc089130..e164822a9 100644 --- a/test/api_multidim.test.ts +++ b/test/api_multidim.test.ts @@ -19,8 +19,7 @@ describe('gdal', () => { afterEach(() => { ds.close() - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + global.gc!() }) describe('gdal.Group', () => { diff --git a/test/api_point.test.ts b/test/api_point.test.ts index d4769a2fb..e12403603 100644 --- a/test/api_point.test.ts +++ b/test/api_point.test.ts @@ -2,7 +2,6 @@ import * as gdal from 'gdal-async' import { assert } from 'chai' describe('gdal.Point', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) let point2d: gdal.Point diff --git a/test/api_polygon.test.ts b/test/api_polygon.test.ts index 74e88547d..9b1316e5d 100644 --- a/test/api_polygon.test.ts +++ b/test/api_polygon.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import * as gdal from 'gdal-async' describe('gdal.Polygon', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be instantiable', () => { @@ -220,7 +219,6 @@ describe('gdal.Polygon', () => { }) describe('gdal.MultiPolygon', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) let multiPolygon: gdal.MultiPolygon diff --git a/test/api_rasterband-async.test.ts b/test/api_rasterband-async.test.ts index 839975f28..c3f318b6d 100644 --- a/test/api_rasterband-async.test.ts +++ b/test/api_rasterband-async.test.ts @@ -7,7 +7,6 @@ import * as semver from 'semver' chai.use(chaiAsPromised) describe('gdal.RasterBandAsync', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should not be instantiable', () => { @@ -418,7 +417,7 @@ describe('gdal.RasterBandAsync', () => { const dataq = band.pixels.readBlockAsync(0, 0) return assert.isFulfilled(dataq.then((data) => { - assert.instanceOf(data, Uint8Array), + assert.instanceOf(data, Uint8Array) assert.equal(data.length, band.blockSize.x * band.blockSize.y) })) }) diff --git a/test/api_rasterband.test.ts b/test/api_rasterband.test.ts index eb5f5c7eb..19dde2bac 100644 --- a/test/api_rasterband.test.ts +++ b/test/api_rasterband.test.ts @@ -4,7 +4,6 @@ import * as gdal from 'gdal-async' import * as fileUtils from './utils/file' describe('gdal.RasterBand', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should not be instantiable', () => { @@ -1615,7 +1614,7 @@ describe('gdal.RasterBand', () => { ds.close() gdal.vsimem.release(tempFile) assert.throws(() => { - for (const overview of band.overviews) overview + for (const overview of band.overviews) void overview }) }) }) diff --git a/test/api_spatialreference.test.ts b/test/api_spatialreference.test.ts index 05327ca2b..03df0d9e8 100644 --- a/test/api_spatialreference.test.ts +++ b/test/api_spatialreference.test.ts @@ -10,7 +10,6 @@ import * as semver from 'semver' // http://spatialreference.org/ref/ describe('gdal.SpatialReference', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should be exposed', () => { diff --git a/test/api_utils.test.ts b/test/api_utils.test.ts index 19061872a..5d7b5c9e8 100644 --- a/test/api_utils.test.ts +++ b/test/api_utils.test.ts @@ -7,7 +7,6 @@ import * as path from 'path' import * as semver from 'semver' describe('gdal_utils', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('translate', () => { @@ -721,7 +720,7 @@ describe('gdal_utils', () => { try { T2m = gdal.open(path.resolve(__dirname, 'data','AROME_T2m_10.tiff')) D2m = gdal.open(path.resolve(__dirname, 'data','truncated.tiff')) - } catch (e) { + } catch (_e) { // Older GDAL versions cannot open the truncated file, so this is // considered a successful test too this.skip() diff --git a/test/api_warp.test.ts b/test/api_warp.test.ts index f72fd0a89..4fc2384c8 100644 --- a/test/api_warp.test.ts +++ b/test/api_warp.test.ts @@ -3,7 +3,6 @@ import { assert } from 'chai' import * as semver from 'semver' describe('gdal', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('suggestedWarpOutput()', () => { @@ -85,7 +84,7 @@ describe('gdal', () => { afterEach(() => { try { src.close() - } catch (err) { + } catch (_err) { /* ignore */ } }) diff --git a/test/api_warpAsync.test.ts b/test/api_warpAsync.test.ts index 3b3002d70..1e8d68f1f 100644 --- a/test/api_warpAsync.test.ts +++ b/test/api_warpAsync.test.ts @@ -6,7 +6,6 @@ chai.use(chaiAsPromised) import * as semver from 'semver' describe('gdal', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('suggestedWarpOutputAsync()', () => { diff --git a/test/object_lifetime.test.ts b/test/object_lifetime.test.ts index 1ba5f1ec4..3dad01d88 100644 --- a/test/object_lifetime.test.ts +++ b/test/object_lifetime.test.ts @@ -15,8 +15,7 @@ describe('object cache', () => { assert.equal(band1, band2) assert.equal(band1.size.x, 4) assert.equal(band2.size.x, 4) - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + global.gc!() } }) }) @@ -29,18 +28,16 @@ describe('object lifetimes', () => { const band_uid = (band as any)._uid ds = null - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + global.gc!() - assert.isTrue((gdal as any)._isAlive(ds_uid)) - assert.isTrue((gdal as any)._isAlive(band_uid)) + assert.isTrue((gdal as any)._isAlive(ds_uid)) + assert.isTrue((gdal as any)._isAlive(band_uid)) - band = null - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + band = null + global.gc!() - assert.isFalse((gdal as any)._isAlive(ds_uid)) - assert.isFalse((gdal as any)._isAlive(band_uid)) + assert.isFalse((gdal as any)._isAlive(ds_uid)) + assert.isFalse((gdal as any)._isAlive(band_uid)) }) it('bands should immediately be garbage collected as they go out of scope', () => { const ds = (gdal as any).open('temp', 'w', 'MEM', 4, 4, 1) @@ -50,11 +47,10 @@ describe('object lifetimes', () => { const band_uid = band._uid band = null - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + global.gc!() - assert.isTrue((gdal as any)._isAlive(ds_uid)) - assert.isFalse((gdal as any)._isAlive(band_uid)) + assert.isTrue((gdal as any)._isAlive(ds_uid)) + assert.isFalse((gdal as any)._isAlive(band_uid)) }) it('datasets should stay alive until all layers go out of scope', () => { let ds: gdal.Dataset | null = gdal.open(path.join(__dirname, 'data/shp/sample.shp')) @@ -64,18 +60,16 @@ describe('object lifetimes', () => { const layer_uid = (layer as any)._uid ds = null - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + global.gc!() - assert.isTrue((gdal as any)._isAlive(ds_uid)) - assert.isTrue((gdal as any)._isAlive(layer_uid)) + assert.isTrue((gdal as any)._isAlive(ds_uid)) + assert.isTrue((gdal as any)._isAlive(layer_uid)) - layer = null - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + layer = null + global.gc!() - assert.isFalse((gdal as any)._isAlive(ds_uid)) - assert.isFalse((gdal as any)._isAlive(layer_uid)) + assert.isFalse((gdal as any)._isAlive(ds_uid)) + assert.isFalse((gdal as any)._isAlive(layer_uid)) }) it('layers should immediately be garbage collected as they go out of scope', () => { const ds: gdal.Dataset | null = gdal.open(path.join(__dirname, 'data/shp/sample.shp')) @@ -85,10 +79,9 @@ describe('object lifetimes', () => { const layer_uid = (layer as any)._uid layer = null - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + global.gc!() - assert.isTrue((gdal as any)._isAlive(ds_uid)) - assert.isFalse((gdal as any)._isAlive(layer_uid)) + assert.isTrue((gdal as any)._isAlive(ds_uid)) + assert.isFalse((gdal as any)._isAlive(layer_uid)) }) }) diff --git a/test/open.test.ts b/test/open.test.ts index 78bf607e6..ad7eeb6e8 100644 --- a/test/open.test.ts +++ b/test/open.test.ts @@ -4,7 +4,6 @@ import * as assert from 'assert' import * as semver from 'semver' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should throw when invalid file', () => { diff --git a/test/open_geojson.test.ts b/test/open_geojson.test.ts index efb65385c..7cf1f6f46 100644 --- a/test/open_geojson.test.ts +++ b/test/open_geojson.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('GeoJSON', () => { diff --git a/test/open_gpx.test.ts b/test/open_gpx.test.ts index 56131abbe..e88a7e3e0 100644 --- a/test/open_gpx.test.ts +++ b/test/open_gpx.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('GPX', () => { diff --git a/test/open_grib.test.ts b/test/open_grib.test.ts index a84bd70ad..2a7bc892f 100644 --- a/test/open_grib.test.ts +++ b/test/open_grib.test.ts @@ -7,7 +7,6 @@ describe('Open', () => { if (!semver.gte(gdal.version, '2.3.0')) { return } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('GRIB', () => { diff --git a/test/open_gtiff.test.ts b/test/open_gtiff.test.ts index a5814b65d..44a11ba6e 100644 --- a/test/open_gtiff.test.ts +++ b/test/open_gtiff.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) before(() => { diff --git a/test/open_hdf5.test.ts b/test/open_hdf5.test.ts index 9aa355585..abb3a6d07 100644 --- a/test/open_hdf5.test.ts +++ b/test/open_hdf5.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('HDF5', () => { diff --git a/test/open_hfa.test.ts b/test/open_hfa.test.ts index 88385de76..db473121c 100644 --- a/test/open_hfa.test.ts +++ b/test/open_hfa.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('HFA (IMG)', () => { diff --git a/test/open_jpeg2000.test.ts b/test/open_jpeg2000.test.ts index 2cf0bf877..d35407d4d 100644 --- a/test/open_jpeg2000.test.ts +++ b/test/open_jpeg2000.test.ts @@ -4,7 +4,6 @@ import { assert } from 'chai' import * as semver from 'semver' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('OpenJPEG', () => { diff --git a/test/open_jpg.test.ts b/test/open_jpg.test.ts index 9048b3f92..e4640894f 100644 --- a/test/open_jpg.test.ts +++ b/test/open_jpg.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('JPG', () => { diff --git a/test/open_jsonfg.test.ts b/test/open_jsonfg.test.ts index 2d8504a4f..09c9ac2e2 100644 --- a/test/open_jsonfg.test.ts +++ b/test/open_jsonfg.test.ts @@ -11,7 +11,6 @@ describe('Open', () => { return } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('JSONFG', () => { diff --git a/test/open_mitab.test.ts b/test/open_mitab.test.ts index c6fccce19..63b7a2fbf 100644 --- a/test/open_mitab.test.ts +++ b/test/open_mitab.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('MapInfo', () => { diff --git a/test/open_netcdf.test.ts b/test/open_netcdf.test.ts index 4f579953f..4a8aa304b 100644 --- a/test/open_netcdf.test.ts +++ b/test/open_netcdf.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('NetCDF', () => { diff --git a/test/open_openfilegdb.test.ts b/test/open_openfilegdb.test.ts index f3543b378..f0614cfe9 100644 --- a/test/open_openfilegdb.test.ts +++ b/test/open_openfilegdb.test.ts @@ -4,7 +4,6 @@ import { assert } from 'chai' import * as semver from 'semver' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('OpenFileGDB', () => { diff --git a/test/open_pmtiles.test.ts b/test/open_pmtiles.test.ts index 77fd398e2..ff51b5aeb 100644 --- a/test/open_pmtiles.test.ts +++ b/test/open_pmtiles.test.ts @@ -11,7 +11,6 @@ describe('Open', () => { return } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('PMTiles', () => { diff --git a/test/open_png.test.ts b/test/open_png.test.ts index 7935f5c7a..5323326e5 100644 --- a/test/open_png.test.ts +++ b/test/open_png.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('PNG', () => { diff --git a/test/open_sdts.test.ts b/test/open_sdts.test.ts index 9b4b74644..125cee549 100644 --- a/test/open_sdts.test.ts +++ b/test/open_sdts.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('SDTS (DDF)', () => { diff --git a/test/open_shp.test.ts b/test/open_shp.test.ts index eb5000034..7bb856eb1 100644 --- a/test/open_shp.test.ts +++ b/test/open_shp.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('ESRI Shapefile', () => { diff --git a/test/open_vrt.test.ts b/test/open_vrt.test.ts index 5ebfb361e..dd792583a 100644 --- a/test/open_vrt.test.ts +++ b/test/open_vrt.test.ts @@ -3,7 +3,6 @@ import * as path from 'path' import { assert } from 'chai' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('VRT', () => { diff --git a/test/open_vsicurl.test.ts b/test/open_vsicurl.test.ts index 7d7110d7f..b8ff744c9 100644 --- a/test/open_vsicurl.test.ts +++ b/test/open_vsicurl.test.ts @@ -5,7 +5,6 @@ import * as chaiAsPromised from 'chai-as-promised' chai.use(chaiAsPromised) describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('vsicurl w/Net', () => { diff --git a/test/open_vsigzip.test.ts b/test/open_vsigzip.test.ts index 81abbc4a0..e5adc8187 100644 --- a/test/open_vsigzip.test.ts +++ b/test/open_vsigzip.test.ts @@ -6,7 +6,6 @@ import * as chaiAsPromised from 'chai-as-promised' chai.use(chaiAsPromised) describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('vsigzip', () => { diff --git a/test/open_vsimem.test.ts b/test/open_vsimem.test.ts index 6f58655f6..bb8f70cc1 100644 --- a/test/open_vsimem.test.ts +++ b/test/open_vsimem.test.ts @@ -7,12 +7,10 @@ const assert: Chai.Assert = chai.assert chai.use(chaiAsPromised) describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('vsimem/open', () => { let filename, ds: gdal.Dataset, buffer: Buffer - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ it('should not throw', () => { filename = path.join(__dirname, 'data/park.geo.json') @@ -40,7 +38,7 @@ describe('Open', () => { const ds2 = gdal.open(buffer) /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ assert.equal((ds2 as any).buffer, (ds as any).buffer) - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + ds2.close() }) it('layer should have all fields defined', () => { @@ -57,10 +55,8 @@ describe('Open', () => { let filename, ds: Promise, buffer: Buffer after(() => ds.then((r) => { r.close() - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - global.gc!() + global.gc!() })) - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) it('should not throw', () => { @@ -90,7 +86,6 @@ describe('Open', () => { }) describe('gdal.vsimem', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('set()', () => { diff --git a/test/open_vsis3.test.ts b/test/open_vsis3.test.ts index a261a90e0..ff191d6ff 100644 --- a/test/open_vsis3.test.ts +++ b/test/open_vsis3.test.ts @@ -10,7 +10,6 @@ describe('Open', () => { return } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) before(() => { gdal.config.set('AWS_NO_SIGN_REQUEST', 'YES') diff --git a/test/open_wcs.test.ts b/test/open_wcs.test.ts index de660b27f..f36837635 100644 --- a/test/open_wcs.test.ts +++ b/test/open_wcs.test.ts @@ -8,7 +8,6 @@ chai.use(chaiAsPromised) const wcsURL = 'WCS:https://demo.mapserver.org/cgi-bin/wcs?VERSION=1.0.0&COVERAGE=ndvi' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) // System-installed versions do not always have the WCS driver diff --git a/test/open_wms.test.ts b/test/open_wms.test.ts index 00451a8e7..d6699b250 100644 --- a/test/open_wms.test.ts +++ b/test/open_wms.test.ts @@ -9,7 +9,6 @@ chai.use(chaiAsPromised) const magosm = 'https://magosm.magellium.com/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=magosm%3Afrance_telecom_fibre_connection_point&CRS=CRS:84&BBOX=2,48,3,49' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('WMS w/Net', () => { diff --git a/test/open_wmts.test.ts b/test/open_wmts.test.ts index 36e86d532..19a23773f 100644 --- a/test/open_wmts.test.ts +++ b/test/open_wmts.test.ts @@ -7,7 +7,6 @@ chai.use(chaiAsPromised) const shomTides = 'WMTS:https://services.data.shom.fr/INSPIRE/wmts?request=GetCapabilities&service=WMTS&version=1.0.0,layer=ZONES_MAREE_PYR_PNG_3857_WMTS' describe('Open', () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterEach(global.gc!) describe('WMTS w/Net', () => { diff --git a/test/stress.js b/test/stress.js index 9da19c9c9..6b3925bbb 100644 --- a/test/stress.js +++ b/test/stress.js @@ -58,7 +58,7 @@ let stop = false try { gdal.startLogging(`${__dirname}/artifacts/stress.log`) -} catch (e) { +} catch (_e) { /* ignore */ }