diff --git a/packages/cspell-eslint-plugin/src/common/logger.cts b/packages/cspell-eslint-plugin/src/common/logger.cts index 42f66d0e018..beea5e33b06 100644 --- a/packages/cspell-eslint-plugin/src/common/logger.cts +++ b/packages/cspell-eslint-plugin/src/common/logger.cts @@ -1,6 +1,6 @@ -import { format } from 'util'; import fs from 'fs'; import path from 'path'; +import { format } from 'util'; const debugMode = false; diff --git a/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts b/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts index 7c20733f17e..03af5d03747 100644 --- a/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts +++ b/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts @@ -4,9 +4,9 @@ import { readFileSync } from 'fs'; import { join as pathJoin } from 'path'; import { createSyncFn } from 'synckit'; +import { getDefaultLogger } from '../common/logger.cjs'; import type { Issue, SpellCheckSyncFn } from '../worker/types.cjs'; import { normalizeOptions } from './defaultCheckOptions.cjs'; -import { getDefaultLogger } from '../common/logger.cjs'; const optionsSchema = JSON.parse(readFileSync(pathJoin(__dirname, '../../assets/options.schema.json'), 'utf8')); diff --git a/packages/cspell-eslint-plugin/src/worker/spellCheck.mts b/packages/cspell-eslint-plugin/src/worker/spellCheck.mts index 5a73774ee2f..d43b9fbec2e 100644 --- a/packages/cspell-eslint-plugin/src/worker/spellCheck.mts +++ b/packages/cspell-eslint-plugin/src/worker/spellCheck.mts @@ -3,11 +3,11 @@ import type { TSESTree } from '@typescript-eslint/types'; import assert from 'assert'; import type { CSpellSettings, TextDocument, ValidationIssue } from 'cspell-lib'; import { - DocumentValidator, createTextDocument, - refreshDictionaryCache, + DocumentValidator, extractImportErrors, getDictionary, + refreshDictionaryCache, } from 'cspell-lib'; import type { Comment, Identifier, ImportSpecifier, Literal, Node, TemplateElement } from 'estree'; import * as path from 'path'; @@ -454,12 +454,10 @@ async function reportConfigurationErrors(config: CSpellSettings, knownConfigErro const errors: Error[] = []; const importErrors = extractImportErrors(config); - let count = 0; importErrors.forEach((ref) => { const key = ref.error.toString(); if (knownConfigErrors.has(key)) return; knownConfigErrors.add(key); - count += 1; errors.push(Error('Configuration Error: \n ' + ref.error.message)); }); @@ -471,7 +469,6 @@ async function reportConfigurationErrors(config: CSpellSettings, knownConfigErro const key = msg + error.toString(); if (knownConfigErrors.has(key)) return; knownConfigErrors.add(key); - count += 1; const errMsg = `${msg}: ${error.message}\n Source: ${dict.source}`; errors.push(Error(errMsg)); });