diff --git a/eslint.config.js b/eslint.config.js index 13370ab..20cc0a9 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,12 +8,39 @@ export const config = tseslint.config(...configCityssm, { cspell: { words: [ ...cspellWords, + 'worktech', + 'rtrim', + // Column name abbreviations + 'accomp', 'actv', - 'wmitm' + 'defaul', + 'enddatetime', + 'sched', + 'scheddatetime', + 'srisysid', + 'srqi', + 'srqisysid', + 'unitprice', + 'wonos', + 'workdesc', + // Table names + 'amsri', + 'amsrqi', + 'wmabca', + 'wmacd', + 'wmbac', + 'wmiln', + 'wmitm', + 'wmjaca', + 'wmjoca', + 'wmjom', + 'wmocd', + 'wmtsi' ] } } ], + '@typescript-eslint/no-unsafe-type-assertion': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', 'unicorn/no-null': 'warn' } diff --git a/eslint.config.ts b/eslint.config.ts index e7c7dba..050489a 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -9,12 +9,42 @@ export const config = tseslint.config(...configCityssm, { cspell: { words: [ ...cspellWords, + 'worktech', + + 'rtrim', + + // Column name abbreviations + 'accomp', 'actv', - 'wmitm' + 'defaul', + 'enddatetime', + 'sched', + 'scheddatetime', + 'srisysid', + 'srqi', + 'srqisysid', + 'unitprice', + 'wonos', + 'workdesc', + + // Table names + 'amsri', + 'amsrqi', + 'wmabca', + 'wmacd', + 'wmbac', + 'wmiln', + 'wmitm', + 'wmjaca', + 'wmjoca', + 'wmjom', + 'wmocd', + 'wmtsi' ] } } ], + '@typescript-eslint/no-unsafe-type-assertion': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', 'unicorn/no-null': 'warn' } diff --git a/queries/equipment/getEquipment.js b/queries/equipment/getEquipment.js index 886a6a6..29dbde8 100644 --- a/queries/equipment/getEquipment.js +++ b/queries/equipment/getEquipment.js @@ -49,7 +49,6 @@ export async function getEquipmentByEquipmentId(mssqlConfig, equipmentId) { return equipment; } const pool = await connect(mssqlConfig); - // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion const equipmentResult = (await pool .request() .input('equipmentId', equipmentId) diff --git a/queries/equipment/getEquipment.ts b/queries/equipment/getEquipment.ts index 31aaf74..4bd729e 100644 --- a/queries/equipment/getEquipment.ts +++ b/queries/equipment/getEquipment.ts @@ -64,7 +64,6 @@ export async function getEquipmentByEquipmentId( const pool = await connect(mssqlConfig) - // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion const equipmentResult = (await pool .request() .input('equipmentId', equipmentId) diff --git a/queries/items/addResourceItem.js b/queries/items/addResourceItem.js index 64ae2a2..5891256 100644 --- a/queries/items/addResourceItem.js +++ b/queries/items/addResourceItem.js @@ -1,3 +1,5 @@ +// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair +/* eslint-disable @cspell/spellchecker */ import { connect } from '@cityssm/mssql-multi-pool'; import { getLastSystemId, incrementLastSystemId } from '../systemId.js'; /** @@ -19,7 +21,6 @@ export async function addResourceItem(mssqlConfig, resourceItem) { throw new Error('Last used system id is unavailable.'); } const itemSystemId = (Number.parseInt(lastSystemId, 10) + 1).toString(); - // eslint-disable-next-line no-secrets/no-secrets await transaction .request() .input('itemSystemId', itemSystemId) diff --git a/queries/items/addResourceItem.ts b/queries/items/addResourceItem.ts index 271d7ad..224c8e0 100644 --- a/queries/items/addResourceItem.ts +++ b/queries/items/addResourceItem.ts @@ -1,3 +1,6 @@ +// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair +/* eslint-disable @cspell/spellchecker */ + import { connect, type mssql } from '@cityssm/mssql-multi-pool' import { getLastSystemId, incrementLastSystemId } from '../systemId.js' @@ -44,7 +47,6 @@ export async function addResourceItem( Number.parseInt(lastSystemId, 10) + 1 ).toString() as BigIntString - // eslint-disable-next-line no-secrets/no-secrets await transaction .request() .input('itemSystemId', itemSystemId) diff --git a/queries/jobs/getJobActivityObjectCodes.js b/queries/jobs/getJobActivityObjectCodes.js index ee7be10..7772797 100644 --- a/queries/jobs/getJobActivityObjectCodes.js +++ b/queries/jobs/getJobActivityObjectCodes.js @@ -16,7 +16,6 @@ const sql = `SELECT [Job_ID] as jobId, * @returns - The job - activity - object code combination if available. */ export async function getJobActivityObjectCodeByKeys(mssqlConfig, keys) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig); const result = (await pool .request() diff --git a/queries/jobs/getJobActivityObjectCodes.ts b/queries/jobs/getJobActivityObjectCodes.ts index 80a3cae..3c52f83 100644 --- a/queries/jobs/getJobActivityObjectCodes.ts +++ b/queries/jobs/getJobActivityObjectCodes.ts @@ -28,7 +28,6 @@ export async function getJobActivityObjectCodeByKeys( fiscalYear: number | string } ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig) const result = (await pool diff --git a/queries/jobs/getJobs.js b/queries/jobs/getJobs.js index 9e512e5..e911d85 100644 --- a/queries/jobs/getJobs.js +++ b/queries/jobs/getJobs.js @@ -35,7 +35,6 @@ export async function getJobByJobId(mssqlConfig, jobId) { if (jobObject !== undefined) { return jobObject; } - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig); const jobResult = await pool .request() diff --git a/queries/jobs/getJobs.ts b/queries/jobs/getJobs.ts index f65fc30..4b1441e 100644 --- a/queries/jobs/getJobs.ts +++ b/queries/jobs/getJobs.ts @@ -49,7 +49,6 @@ export async function getJobByJobId( return jobObject } - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig) const jobResult = await pool diff --git a/queries/jobs/getObjectCodes.js b/queries/jobs/getObjectCodes.js index de1e4be..f7b2fba 100644 --- a/queries/jobs/getObjectCodes.js +++ b/queries/jobs/getObjectCodes.js @@ -20,7 +20,6 @@ export async function getObjectCodeByObjectCode(mssqlConfig, objectCode) { if (objectCodeObject !== undefined) { return objectCodeObject; } - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig); const result = (await pool .request() @@ -48,7 +47,6 @@ const jobAssignedSql = `SELECT o.[OCSysID] as objectCodeSystemId, * @returns - An array of object codes assigned to a given job. */ export async function getObjectCodesAssignedToJobByFiscalYear(mssqlConfig, jobId, fiscalYear) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig); const result = (await pool .request() @@ -66,7 +64,6 @@ export async function getObjectCodesAssignedToJobByFiscalYear(mssqlConfig, jobId * @returns - The object code, if available. */ export async function getObjectCodeAssignedToJobByObjectCodeAndFiscalYear(mssqlConfig, jobId, objectCode, fiscalYear) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig); const result = (await pool .request() diff --git a/queries/jobs/getObjectCodes.ts b/queries/jobs/getObjectCodes.ts index f77445c..156eae5 100644 --- a/queries/jobs/getObjectCodes.ts +++ b/queries/jobs/getObjectCodes.ts @@ -31,15 +31,12 @@ export async function getObjectCodeByObjectCode( return objectCodeObject } - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig) const result = (await pool .request() .input('objectCode', objectCode) - .query( - `${sql} where CodeID = @objectCode` - )) as mssql.IResult + .query(`${sql} where CodeID = @objectCode`)) as mssql.IResult if (result.recordset.length === 0) { return undefined @@ -72,7 +69,6 @@ export async function getObjectCodesAssignedToJobByFiscalYear( jobId: string, fiscalYear: number | string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig) const result = (await pool @@ -100,7 +96,6 @@ export async function getObjectCodeAssignedToJobByObjectCodeAndFiscalYear( objectCode: string, fiscalYear: number | string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig) const result = (await pool diff --git a/queries/systemId.js b/queries/systemId.js index bbe67e5..7dc1426 100644 --- a/queries/systemId.js +++ b/queries/systemId.js @@ -1,5 +1,3 @@ -// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -/* eslint-disable @typescript-eslint/no-unsafe-assignment */ const tableId = 'SRISYSID'; /** * Returns the last used system id. diff --git a/queries/systemId.ts b/queries/systemId.ts index 7dc8f39..ff9d989 100644 --- a/queries/systemId.ts +++ b/queries/systemId.ts @@ -1,6 +1,3 @@ -// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -/* eslint-disable @typescript-eslint/no-unsafe-assignment */ - import type { mssql } from '@cityssm/mssql-multi-pool' const tableId = 'SRISYSID' diff --git a/queries/workOrders/addWorkOrderResource.js b/queries/workOrders/addWorkOrderResource.js index 1b00062..cff3aad 100644 --- a/queries/workOrders/addWorkOrderResource.js +++ b/queries/workOrders/addWorkOrderResource.js @@ -1,3 +1,5 @@ +// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair +/* eslint-disable @cspell/spellchecker */ import { connect } from '@cityssm/mssql-multi-pool'; import { dateToString, dateToTimeString } from '@cityssm/utils-datetime'; import { getItemByItemId } from '../items/getItems.js'; diff --git a/queries/workOrders/addWorkOrderResource.ts b/queries/workOrders/addWorkOrderResource.ts index 91557ea..410c8c7 100644 --- a/queries/workOrders/addWorkOrderResource.ts +++ b/queries/workOrders/addWorkOrderResource.ts @@ -1,3 +1,6 @@ +// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair +/* eslint-disable @cspell/spellchecker */ + import { connect, type mssql } from '@cityssm/mssql-multi-pool' import { dateToString, dateToTimeString } from '@cityssm/utils-datetime' diff --git a/queries/workOrders/getWorkOrderResources.js b/queries/workOrders/getWorkOrderResources.js index b358ffc..b865ec1 100644 --- a/queries/workOrders/getWorkOrderResources.js +++ b/queries/workOrders/getWorkOrderResources.js @@ -22,7 +22,6 @@ const sql = `SELECT [SRISysID] as serviceRequestItemSystemId, * @returns - An array of resources associated with a work order. */ export async function getWorkOrderResourcesByWorkOrderNumber(mssqlConfig, workOrderNumber) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig); const resourcesResult = (await pool .request() @@ -44,7 +43,6 @@ export async function getWorkOrderResourcesByStartDateTimeRange(mssqlConfig, sta const startDateToString = typeof startDateTimeTo === 'string' ? startDateTimeTo : `${dateToString(startDateTimeTo)} ${dateToTimeString(startDateTimeTo)}`; - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig); const resourcesResult = (await pool .request() diff --git a/queries/workOrders/getWorkOrderResources.ts b/queries/workOrders/getWorkOrderResources.ts index 720c1a2..6ef3ccc 100644 --- a/queries/workOrders/getWorkOrderResources.ts +++ b/queries/workOrders/getWorkOrderResources.ts @@ -1,7 +1,4 @@ -import { - connect, - type mssql -} from '@cityssm/mssql-multi-pool' +import { connect, type mssql } from '@cityssm/mssql-multi-pool' import { type DateString, dateToString, @@ -36,7 +33,6 @@ export async function getWorkOrderResourcesByWorkOrderNumber( mssqlConfig: mssql.config, workOrderNumber: string ): Promise { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig) const resourcesResult = (await pool @@ -73,7 +69,6 @@ export async function getWorkOrderResourcesByStartDateTimeRange( ? startDateTimeTo : `${dateToString(startDateTimeTo)} ${dateToTimeString(startDateTimeTo)}` - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const pool = await connect(mssqlConfig) const resourcesResult = (await pool