Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Sep 27, 2023
1 parent bee69af commit 675740e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/cspell-eslint-plugin/src/common/logger.cts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { format } from 'util';
import fs from 'fs';
import path from 'path';
import { format } from 'util';

const debugMode = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
7 changes: 2 additions & 5 deletions packages/cspell-eslint-plugin/src/worker/spellCheck.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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));
});

Expand All @@ -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));
});
Expand Down

0 comments on commit 675740e

Please sign in to comment.