Comparing version 8.17.2 to 8.17.3
import type { RunResult } from '@cspell/cspell-types'; | ||
import type { LintRequest } from './LintRequest.js'; | ||
export declare function runLint(cfg: LintRequest): Promise<RunResult>; | ||
export declare class LinterError extends Error { | ||
constructor(message: string); | ||
toString(): string; | ||
} | ||
//# sourceMappingURL=lint.d.ts.map |
@@ -91,3 +91,3 @@ import * as path from 'node:path'; | ||
if (fileInfo.errorCode !== 'EISDIR' && cfg.options.mustFindFiles) { | ||
const err = toError(`File not found: "${filename}"`); | ||
const err = new LinterError(`File not found: "${filename}"`); | ||
reporter.error('Linter:', err); | ||
@@ -545,2 +545,10 @@ result.errors += 1; | ||
} | ||
export class LinterError extends Error { | ||
constructor(message) { | ||
super(message); | ||
} | ||
toString() { | ||
return this.message; | ||
} | ||
} | ||
//# sourceMappingURL=lint.js.map |
export { pkgDir } from './dirname.js'; | ||
export declare const name = "cspell"; | ||
export declare const version = "8.17.2"; | ||
export declare const version = "8.17.3"; | ||
export declare const engines: { | ||
@@ -5,0 +5,0 @@ node: string; |
// This file is generated by tools/patch-version.mjs | ||
export { pkgDir } from './dirname.js'; | ||
export const name = 'cspell'; | ||
export const version = '8.17.2'; | ||
export const version = '8.17.3'; | ||
export const engines = { node: '>=18' }; | ||
export const npmPackage = { name, version, engines }; | ||
//# sourceMappingURL=pkgInfo.js.map |
import assert from 'node:assert'; | ||
import { stat } from 'node:fs/promises'; | ||
import path from 'node:path'; | ||
import { isError } from '../errors.js'; | ||
import { isErrorLike } from '../errors.js'; | ||
import { DiskCache } from './DiskCache.js'; | ||
@@ -50,3 +50,3 @@ import { DummyCache } from './DummyCache.js'; | ||
catch (err) { | ||
if (isError(err) && err.code === 'ENOENT') { | ||
if (isErrorLike(err) && err.code === 'ENOENT') { | ||
return cacheLocation; | ||
@@ -53,0 +53,0 @@ } |
@@ -18,2 +18,3 @@ export declare class CheckFailed extends Error { | ||
export declare function isError(e: unknown): e is NodeError; | ||
export declare function isErrorLike(e: unknown): e is NodeError; | ||
export declare function toApplicationError(e: unknown, message?: string): ApplicationError; | ||
@@ -20,0 +21,0 @@ export interface NodeError extends Error { |
@@ -34,10 +34,15 @@ import { format } from 'node:util'; | ||
return e; | ||
if (isErrorLike(e)) { | ||
const ex = new Error(e.message, { cause: e }); | ||
if (e.code !== undefined) | ||
ex.code = e.code; | ||
return ex; | ||
} | ||
const message = format(e); | ||
return { | ||
name: 'error', | ||
message, | ||
toString: () => message, | ||
}; | ||
return new Error(message); | ||
} | ||
export function isError(e) { | ||
return e instanceof Error; | ||
} | ||
export function isErrorLike(e) { | ||
if (e instanceof Error) | ||
@@ -44,0 +49,0 @@ return true; |
{ | ||
"name": "cspell", | ||
"version": "8.17.2", | ||
"version": "8.17.3", | ||
"description": "A Spelling Checker for Code!", | ||
@@ -84,15 +84,15 @@ "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1", | ||
"dependencies": { | ||
"@cspell/cspell-json-reporter": "8.17.2", | ||
"@cspell/cspell-pipe": "8.17.2", | ||
"@cspell/cspell-types": "8.17.2", | ||
"@cspell/dynamic-import": "8.17.2", | ||
"@cspell/url": "8.17.2", | ||
"@cspell/cspell-json-reporter": "8.17.3", | ||
"@cspell/cspell-pipe": "8.17.3", | ||
"@cspell/cspell-types": "8.17.3", | ||
"@cspell/dynamic-import": "8.17.3", | ||
"@cspell/url": "8.17.3", | ||
"chalk": "^5.4.1", | ||
"chalk-template": "^1.1.0", | ||
"commander": "^13.0.0", | ||
"cspell-dictionary": "8.17.2", | ||
"cspell-gitignore": "8.17.2", | ||
"cspell-glob": "8.17.2", | ||
"cspell-io": "8.17.2", | ||
"cspell-lib": "8.17.2", | ||
"commander": "^13.1.0", | ||
"cspell-dictionary": "8.17.3", | ||
"cspell-gitignore": "8.17.3", | ||
"cspell-glob": "8.17.3", | ||
"cspell-io": "8.17.3", | ||
"cspell-lib": "8.17.3", | ||
"fast-json-stable-stringify": "^2.1.0", | ||
@@ -115,3 +115,3 @@ "file-entry-cache": "^9.1.0", | ||
}, | ||
"gitHead": "160c982e8d1e3b4951acb6fc003d013f3b0597e0" | ||
"gitHead": "9a0d2b4584112b33d137faa98e9931ad4e7b6050" | ||
} |
@@ -317,3 +317,3 @@ # cspell | ||
cspell needs Node 14 and above. | ||
CSpell needs Node 18 and above. | ||
@@ -320,0 +320,0 @@ ## How it works |
204435
4221
+ Added@cspell/cspell-bundled-dicts@8.17.3(transitive)
+ Added@cspell/cspell-json-reporter@8.17.3(transitive)
+ Added@cspell/cspell-pipe@8.17.3(transitive)
+ Added@cspell/cspell-resolver@8.17.3(transitive)
+ Added@cspell/cspell-service-bus@8.17.3(transitive)
+ Added@cspell/cspell-types@8.17.3(transitive)
+ Added@cspell/dict-companies@3.1.13(transitive)
+ Added@cspell/dict-en_us@4.3.30(transitive)
+ Added@cspell/dict-npm@5.1.24(transitive)
+ Added@cspell/dict-software-terms@4.2.4(transitive)
+ Added@cspell/dynamic-import@8.17.3(transitive)
+ Added@cspell/filetypes@8.17.3(transitive)
+ Added@cspell/strong-weak-map@8.17.3(transitive)
+ Added@cspell/url@8.17.3(transitive)
+ Addedcspell-config-lib@8.17.3(transitive)
+ Addedcspell-dictionary@8.17.3(transitive)
+ Addedcspell-gitignore@8.17.3(transitive)
+ Addedcspell-glob@8.17.3(transitive)
+ Addedcspell-grammar@8.17.3(transitive)
+ Addedcspell-io@8.17.3(transitive)
+ Addedcspell-lib@8.17.3(transitive)
+ Addedcspell-trie-lib@8.17.3(transitive)
+ Addedsemver@7.7.0(transitive)
+ Addedvscode-uri@3.0.8(transitive)
- Removed@cspell/cspell-bundled-dicts@8.17.2(transitive)
- Removed@cspell/cspell-json-reporter@8.17.2(transitive)
- Removed@cspell/cspell-pipe@8.17.2(transitive)
- Removed@cspell/cspell-resolver@8.17.2(transitive)
- Removed@cspell/cspell-service-bus@8.17.2(transitive)
- Removed@cspell/cspell-types@8.17.2(transitive)
- Removed@cspell/dict-companies@3.1.14(transitive)
- Removed@cspell/dict-en_us@4.3.31(transitive)
- Removed@cspell/dict-npm@5.1.25(transitive)
- Removed@cspell/dict-software-terms@4.2.5(transitive)
- Removed@cspell/dynamic-import@8.17.2(transitive)
- Removed@cspell/filetypes@8.17.2(transitive)
- Removed@cspell/strong-weak-map@8.17.2(transitive)
- Removed@cspell/url@8.17.2(transitive)
- Removedcspell-config-lib@8.17.2(transitive)
- Removedcspell-dictionary@8.17.2(transitive)
- Removedcspell-gitignore@8.17.2(transitive)
- Removedcspell-glob@8.17.2(transitive)
- Removedcspell-grammar@8.17.2(transitive)
- Removedcspell-io@8.17.2(transitive)
- Removedcspell-lib@8.17.2(transitive)
- Removedcspell-trie-lib@8.17.2(transitive)
- Removedsemver@7.7.1(transitive)
- Removedvscode-uri@3.1.0(transitive)
Updated@cspell/cspell-pipe@8.17.3
Updated@cspell/cspell-types@8.17.3
Updated@cspell/url@8.17.3
Updatedcommander@^13.1.0
Updatedcspell-dictionary@8.17.3
Updatedcspell-gitignore@8.17.3
Updatedcspell-glob@8.17.3
Updatedcspell-io@8.17.3
Updatedcspell-lib@8.17.3