From ed2a14ee5f83839879912d02ee6cd05a20af1e30 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Thu, 27 Jun 2024 15:05:20 -0400 Subject: [PATCH] linting --- cypress/e2e/01-admin/feeManagement.cy.js | 6 ++---- cypress/e2e/01-admin/feeManagement.cy.ts | 6 ++---- helpers/functions.print.ts | 3 +++ public-typescript/lotOccupancySearch.ts | 4 ++-- public-typescript/mapSearch.ts | 4 ++-- public-typescript/mapView.js | 2 ++ public-typescript/mapView.ts | 3 +++ test/functions.ts | 3 +++ 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/01-admin/feeManagement.cy.js b/cypress/e2e/01-admin/feeManagement.cy.js index 2744235a..f3f0c111 100644 --- a/cypress/e2e/01-admin/feeManagement.cy.js +++ b/cypress/e2e/01-admin/feeManagement.cy.js @@ -1,4 +1,4 @@ -import * as configFunctions from '../../../helpers/functions.config.js'; +import { getConfigProperty } from '../../../helpers/functions.config.js'; import { testAdmin } from '../../../test/_globals.js'; import { ajaxDelayMillis, login, logout } from '../../support/index.js'; describe('Admin - Fee Management', () => { @@ -39,9 +39,7 @@ describe('Admin - Fee Management', () => { cy.get(".modal input[name='taxAmount']").should('be.disabled'); cy.get(".modal input[name='taxPercentage']") .invoke('val') - .should('equal', configFunctions - .getConfigProperty('settings.fees.taxPercentageDefault') - .toString()); + .should('equal', getConfigProperty('settings.fees.taxPercentageDefault').toString()); cy.get(".modal input[name='quantityUnit']").should('be.disabled'); cy.get(".modal select[name='includeQuantity']").select('1'); cy.get(".modal input[name='quantityUnit']") diff --git a/cypress/e2e/01-admin/feeManagement.cy.ts b/cypress/e2e/01-admin/feeManagement.cy.ts index 402a12b8..21a193e8 100644 --- a/cypress/e2e/01-admin/feeManagement.cy.ts +++ b/cypress/e2e/01-admin/feeManagement.cy.ts @@ -1,4 +1,4 @@ -import * as configFunctions from '../../../helpers/functions.config.js' +import { getConfigProperty } from '../../../helpers/functions.config.js' import { testAdmin } from '../../../test/_globals.js' import type { Fee } from '../../../types/recordTypes.js' import { ajaxDelayMillis, login, logout } from '../../support/index.js' @@ -65,9 +65,7 @@ describe('Admin - Fee Management', () => { .invoke('val') .should( 'equal', - configFunctions - .getConfigProperty('settings.fees.taxPercentageDefault') - .toString() + getConfigProperty('settings.fees.taxPercentageDefault').toString() ) cy.get(".modal input[name='quantityUnit']").should('be.disabled') diff --git a/helpers/functions.print.ts b/helpers/functions.print.ts index 12512fcb..91db3f78 100644 --- a/helpers/functions.print.ts +++ b/helpers/functions.print.ts @@ -1,3 +1,4 @@ +// skipcq: JS-C1003 - Added to ReportData import * as dateTimeFunctions from '@cityssm/utils-datetime' import getLot from '../database/getLot.js' @@ -5,7 +6,9 @@ import getLotOccupancy from '../database/getLotOccupancy.js' import getWorkOrder from '../database/getWorkOrder.js' import type { Lot, LotOccupancy, WorkOrder } from '../types/recordTypes.js' +// skipcq: JS-C1003 - Added to ReportData import * as configFunctions from './functions.config.js' +// skipcq: JS-C1003 - Added to ReportData import * as lotOccupancyFunctions from './functions.lotOccupancy.js' interface PrintConfig { diff --git a/public-typescript/lotOccupancySearch.ts b/public-typescript/lotOccupancySearch.ts index 99fd35c7..7aecda2f 100644 --- a/public-typescript/lotOccupancySearch.ts +++ b/public-typescript/lotOccupancySearch.ts @@ -4,7 +4,7 @@ import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { LOS } from '../types/globalTypes.js' -import type * as recordTypes from '../types/recordTypes.js' +import type { LotOccupancy } from '../types/recordTypes.js' declare const cityssm: cityssmGlobal @@ -33,7 +33,7 @@ declare const exports: Record const responseJSON = rawResponseJSON as { count: number offset: number - lotOccupancies: recordTypes.LotOccupancy[] + lotOccupancies: LotOccupancy[] } if (responseJSON.lotOccupancies.length === 0) { diff --git a/public-typescript/mapSearch.ts b/public-typescript/mapSearch.ts index c06997eb..684a1d9e 100644 --- a/public-typescript/mapSearch.ts +++ b/public-typescript/mapSearch.ts @@ -4,7 +4,7 @@ import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js' import type { LOS } from '../types/globalTypes.js' -import type * as recordTypes from '../types/recordTypes.js' +import type { MapRecord } from '../types/recordTypes.js' declare const cityssm: cityssmGlobal @@ -12,7 +12,7 @@ declare const exports: Record ;(() => { const los = exports.los as LOS - const maps = exports.maps as recordTypes.MapRecord[] + const maps = exports.maps as MapRecord[] const searchFilterElement = document.querySelector( '#searchFilter--map' diff --git a/public-typescript/mapView.js b/public-typescript/mapView.js index 8cbf3f3a..9912bed8 100644 --- a/public-typescript/mapView.js +++ b/public-typescript/mapView.js @@ -1,4 +1,6 @@ "use strict"; +// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair +/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */ Object.defineProperty(exports, "__esModule", { value: true }); (() => { var _a, _b; diff --git a/public-typescript/mapView.ts b/public-typescript/mapView.ts index 31080947..ba4d989c 100644 --- a/public-typescript/mapView.ts +++ b/public-typescript/mapView.ts @@ -1,3 +1,6 @@ +// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair +/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */ + import type * as Leaflet from 'leaflet' declare const L diff --git a/test/functions.ts b/test/functions.ts index ed9574ac..51c1863c 100644 --- a/test/functions.ts +++ b/test/functions.ts @@ -2,8 +2,11 @@ import assert from 'node:assert' import fs from 'node:fs' import { lotNameSortNameFunction } from '../data/config.cemetery.ssm.js' +// skipcq: JS-C1003 - Testing functions import * as cacheFunctions from '../helpers/functions.cache.js' +// skipcq: JS-C1003 - Testing functions import * as sqlFilterFunctions from '../helpers/functions.sqlFilters.js' +// skipcq: JS-C1003 - Testing functions import * as userFunctions from '../helpers/functions.user.js' describe('config.cemetery.ssm', () => {