cspell 7.3.8 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/esm/cli-reporter.js +1 -0
- package/dist/esm/cli-reporter.mjs +1 -0
- package/dist/esm/lint/LintRequest.js +11 -0
- package/dist/esm/lint/LintRequest.mjs +11 -0
- package/dist/esm/repl/index.js +5 -0
- package/dist/esm/repl/index.mjs +5 -0
- package/dist/esm/util/InMemoryReporter.js +36 -37
- package/dist/esm/util/InMemoryReporter.mjs +36 -37
- package/dist/esm/util/cache/DiskCache.js +11 -4
- package/dist/esm/util/cache/DiskCache.mjs +11 -4
- package/dist/esm/util/cache/ObjectCollection.js +2 -6
- package/dist/esm/util/cache/ObjectCollection.mjs +2 -6
- package/dist/esm/util/errors.js +4 -0
- package/dist/esm/util/errors.mjs +4 -0
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -451,9 +451,9 @@ By default the flags `gim` are added if no flags are given.
|
|
|
451
451
|
|
|
452
452
|
The spell checker works in the following way:
|
|
453
453
|
|
|
454
|
-
1.
|
|
455
|
-
1.
|
|
456
|
-
1.
|
|
454
|
+
1. Find all text matching `includeRegExp`
|
|
455
|
+
1. Remove any text matching `ignoreRegExp`
|
|
456
|
+
1. Check the remaining text.
|
|
457
457
|
|
|
458
458
|
#### Exclude Example
|
|
459
459
|
|
package/dist/esm/cli-reporter.js
CHANGED
|
@@ -3,6 +3,17 @@ import { calcExcludeGlobInfo } from '../util/glob.js';
|
|
|
3
3
|
import * as util from '../util/util.js';
|
|
4
4
|
const defaultContextRange = 20;
|
|
5
5
|
export class LintRequest {
|
|
6
|
+
fileGlobs;
|
|
7
|
+
options;
|
|
8
|
+
reporter;
|
|
9
|
+
uniqueFilter;
|
|
10
|
+
locale;
|
|
11
|
+
configFile;
|
|
12
|
+
excludes;
|
|
13
|
+
root;
|
|
14
|
+
showContext;
|
|
15
|
+
enableGlobDot;
|
|
16
|
+
fileLists;
|
|
6
17
|
constructor(fileGlobs, options, reporter) {
|
|
7
18
|
this.fileGlobs = fileGlobs;
|
|
8
19
|
this.options = options;
|
|
@@ -3,6 +3,17 @@ import { calcExcludeGlobInfo } from '../util/glob.mjs';
|
|
|
3
3
|
import * as util from '../util/util.mjs';
|
|
4
4
|
const defaultContextRange = 20;
|
|
5
5
|
export class LintRequest {
|
|
6
|
+
fileGlobs;
|
|
7
|
+
options;
|
|
8
|
+
reporter;
|
|
9
|
+
uniqueFilter;
|
|
10
|
+
locale;
|
|
11
|
+
configFile;
|
|
12
|
+
excludes;
|
|
13
|
+
root;
|
|
14
|
+
showContext;
|
|
15
|
+
enableGlobDot;
|
|
16
|
+
fileLists;
|
|
6
17
|
constructor(fileGlobs, options, reporter) {
|
|
7
18
|
this.fileGlobs = fileGlobs;
|
|
8
19
|
this.options = options;
|
package/dist/esm/repl/index.js
CHANGED
package/dist/esm/repl/index.mjs
CHANGED
|
@@ -2,42 +2,41 @@
|
|
|
2
2
|
* Simple reporter for test purposes
|
|
3
3
|
*/
|
|
4
4
|
export class InMemoryReporter {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
5
|
+
log = [];
|
|
6
|
+
errors = [];
|
|
7
|
+
issueCount = 0;
|
|
8
|
+
errorCount = 0;
|
|
9
|
+
debugCount = 0;
|
|
10
|
+
infoCount = 0;
|
|
11
|
+
progressCount = 0;
|
|
12
|
+
issues = [];
|
|
13
|
+
runResult;
|
|
14
|
+
issue = (issue) => {
|
|
15
|
+
this.issues.push(issue);
|
|
16
|
+
this.issueCount += 1;
|
|
17
|
+
const { uri, row, col, text } = issue;
|
|
18
|
+
this.log.push(`Issue: ${uri}[${row}, ${col}]: Unknown word: ${text}`);
|
|
19
|
+
};
|
|
20
|
+
error = (message, error) => {
|
|
21
|
+
this.errorCount += 1;
|
|
22
|
+
this.errors.push(error);
|
|
23
|
+
this.log.push(`Error: ${message} ${error.toString()}`);
|
|
24
|
+
};
|
|
25
|
+
info = (message) => {
|
|
26
|
+
this.infoCount += 1;
|
|
27
|
+
this.log.push(`Info: ${message}`);
|
|
28
|
+
};
|
|
29
|
+
debug = (message) => {
|
|
30
|
+
this.debugCount += 1;
|
|
31
|
+
this.log.push(`Debug: ${message}`);
|
|
32
|
+
};
|
|
33
|
+
progress = (p) => {
|
|
34
|
+
this.progressCount += 1;
|
|
35
|
+
this.log.push(`Progress: ${p.type} ${p.fileNum} ${p.fileCount} ${p.filename}`);
|
|
36
|
+
};
|
|
37
|
+
result = (r) => {
|
|
38
|
+
this.runResult = r;
|
|
39
|
+
};
|
|
40
|
+
dump = () => ({ log: this.log, issues: this.issues, runResult: this.runResult });
|
|
42
41
|
}
|
|
43
42
|
//# sourceMappingURL=InMemoryReporter.js.map
|
|
@@ -2,42 +2,41 @@
|
|
|
2
2
|
* Simple reporter for test purposes
|
|
3
3
|
*/
|
|
4
4
|
export class InMemoryReporter {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
5
|
+
log = [];
|
|
6
|
+
errors = [];
|
|
7
|
+
issueCount = 0;
|
|
8
|
+
errorCount = 0;
|
|
9
|
+
debugCount = 0;
|
|
10
|
+
infoCount = 0;
|
|
11
|
+
progressCount = 0;
|
|
12
|
+
issues = [];
|
|
13
|
+
runResult;
|
|
14
|
+
issue = (issue) => {
|
|
15
|
+
this.issues.push(issue);
|
|
16
|
+
this.issueCount += 1;
|
|
17
|
+
const { uri, row, col, text } = issue;
|
|
18
|
+
this.log.push(`Issue: ${uri}[${row}, ${col}]: Unknown word: ${text}`);
|
|
19
|
+
};
|
|
20
|
+
error = (message, error) => {
|
|
21
|
+
this.errorCount += 1;
|
|
22
|
+
this.errors.push(error);
|
|
23
|
+
this.log.push(`Error: ${message} ${error.toString()}`);
|
|
24
|
+
};
|
|
25
|
+
info = (message) => {
|
|
26
|
+
this.infoCount += 1;
|
|
27
|
+
this.log.push(`Info: ${message}`);
|
|
28
|
+
};
|
|
29
|
+
debug = (message) => {
|
|
30
|
+
this.debugCount += 1;
|
|
31
|
+
this.log.push(`Debug: ${message}`);
|
|
32
|
+
};
|
|
33
|
+
progress = (p) => {
|
|
34
|
+
this.progressCount += 1;
|
|
35
|
+
this.log.push(`Progress: ${p.type} ${p.fileNum} ${p.fileCount} ${p.filename}`);
|
|
36
|
+
};
|
|
37
|
+
result = (r) => {
|
|
38
|
+
this.runResult = r;
|
|
39
|
+
};
|
|
40
|
+
dump = () => ({ log: this.log, issues: this.issues, runResult: this.runResult });
|
|
42
41
|
}
|
|
43
42
|
//# sourceMappingURL=InMemoryReporter.mjs.map
|
|
@@ -20,14 +20,21 @@ const META_DATA_VERSION_SUFFIX = '-' + META_DATA_BASE_VERSION + '-' + Object.key
|
|
|
20
20
|
* Caches cspell results on disk
|
|
21
21
|
*/
|
|
22
22
|
export class DiskCache {
|
|
23
|
+
useCheckSum;
|
|
24
|
+
cspellVersion;
|
|
25
|
+
useUniversalCache;
|
|
26
|
+
cacheFileLocation;
|
|
27
|
+
cacheDir;
|
|
28
|
+
fileEntryCache;
|
|
29
|
+
dependencyCache = new Map();
|
|
30
|
+
dependencyCacheTree = {};
|
|
31
|
+
objectCollection = new ShallowObjectCollection();
|
|
32
|
+
ocCacheFileResult = new ShallowObjectCollection();
|
|
33
|
+
version;
|
|
23
34
|
constructor(cacheFileLocation, useCheckSum, cspellVersion, useUniversalCache) {
|
|
24
35
|
this.useCheckSum = useCheckSum;
|
|
25
36
|
this.cspellVersion = cspellVersion;
|
|
26
37
|
this.useUniversalCache = useUniversalCache;
|
|
27
|
-
this.dependencyCache = new Map();
|
|
28
|
-
this.dependencyCacheTree = {};
|
|
29
|
-
this.objectCollection = new ShallowObjectCollection();
|
|
30
|
-
this.ocCacheFileResult = new ShallowObjectCollection();
|
|
31
38
|
this.cacheFileLocation = resolvePath(cacheFileLocation);
|
|
32
39
|
this.cacheDir = dirname(this.cacheFileLocation);
|
|
33
40
|
this.fileEntryCache = createFromFile(this.cacheFileLocation, useCheckSum, useUniversalCache);
|
|
@@ -20,14 +20,21 @@ const META_DATA_VERSION_SUFFIX = '-' + META_DATA_BASE_VERSION + '-' + Object.key
|
|
|
20
20
|
* Caches cspell results on disk
|
|
21
21
|
*/
|
|
22
22
|
export class DiskCache {
|
|
23
|
+
useCheckSum;
|
|
24
|
+
cspellVersion;
|
|
25
|
+
useUniversalCache;
|
|
26
|
+
cacheFileLocation;
|
|
27
|
+
cacheDir;
|
|
28
|
+
fileEntryCache;
|
|
29
|
+
dependencyCache = new Map();
|
|
30
|
+
dependencyCacheTree = {};
|
|
31
|
+
objectCollection = new ShallowObjectCollection();
|
|
32
|
+
ocCacheFileResult = new ShallowObjectCollection();
|
|
33
|
+
version;
|
|
23
34
|
constructor(cacheFileLocation, useCheckSum, cspellVersion, useUniversalCache) {
|
|
24
35
|
this.useCheckSum = useCheckSum;
|
|
25
36
|
this.cspellVersion = cspellVersion;
|
|
26
37
|
this.useUniversalCache = useUniversalCache;
|
|
27
|
-
this.dependencyCache = new Map();
|
|
28
|
-
this.dependencyCacheTree = {};
|
|
29
|
-
this.objectCollection = new ShallowObjectCollection();
|
|
30
|
-
this.ocCacheFileResult = new ShallowObjectCollection();
|
|
31
38
|
this.cacheFileLocation = resolvePath(cacheFileLocation);
|
|
32
39
|
this.cacheDir = dirname(this.cacheFileLocation);
|
|
33
40
|
this.fileEntryCache = createFromFile(this.cacheFileLocation, useCheckSum, useUniversalCache);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
const compare = Intl.Collator().compare;
|
|
3
3
|
export class ShallowObjectCollection {
|
|
4
|
-
|
|
5
|
-
this.tree = {};
|
|
6
|
-
}
|
|
4
|
+
tree = {};
|
|
7
5
|
get(v) {
|
|
8
6
|
if (typeof v !== 'object' || v === null) {
|
|
9
7
|
return v;
|
|
@@ -35,9 +33,7 @@ export class ShallowObjectCollection {
|
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
export class Collection {
|
|
38
|
-
|
|
39
|
-
this.col = { contains: new Map() };
|
|
40
|
-
}
|
|
36
|
+
col = { contains: new Map() };
|
|
41
37
|
/**
|
|
42
38
|
* Add a plain object to the collection.
|
|
43
39
|
* The actual object used is returned.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
const compare = Intl.Collator().compare;
|
|
3
3
|
export class ShallowObjectCollection {
|
|
4
|
-
|
|
5
|
-
this.tree = {};
|
|
6
|
-
}
|
|
4
|
+
tree = {};
|
|
7
5
|
get(v) {
|
|
8
6
|
if (typeof v !== 'object' || v === null) {
|
|
9
7
|
return v;
|
|
@@ -35,9 +33,7 @@ export class ShallowObjectCollection {
|
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
export class Collection {
|
|
38
|
-
|
|
39
|
-
this.col = { contains: new Map() };
|
|
40
|
-
}
|
|
36
|
+
col = { contains: new Map() };
|
|
41
37
|
/**
|
|
42
38
|
* Add a plain object to the collection.
|
|
43
39
|
* The actual object used is returned.
|
package/dist/esm/util/errors.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { format } from 'util';
|
|
2
2
|
export class CheckFailed extends Error {
|
|
3
|
+
exitCode;
|
|
3
4
|
constructor(message, exitCode = 1) {
|
|
4
5
|
super(message);
|
|
5
6
|
this.exitCode = exitCode;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
export class ApplicationError extends Error {
|
|
10
|
+
exitCode;
|
|
11
|
+
cause;
|
|
9
12
|
constructor(message, exitCode = 1, cause) {
|
|
10
13
|
super(message);
|
|
11
14
|
this.exitCode = exitCode;
|
|
@@ -13,6 +16,7 @@ export class ApplicationError extends Error {
|
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
export class IOError extends ApplicationError {
|
|
19
|
+
cause;
|
|
16
20
|
constructor(message, cause) {
|
|
17
21
|
super(message, undefined, cause);
|
|
18
22
|
this.cause = cause;
|
package/dist/esm/util/errors.mjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { format } from 'util';
|
|
2
2
|
export class CheckFailed extends Error {
|
|
3
|
+
exitCode;
|
|
3
4
|
constructor(message, exitCode = 1) {
|
|
4
5
|
super(message);
|
|
5
6
|
this.exitCode = exitCode;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
export class ApplicationError extends Error {
|
|
10
|
+
exitCode;
|
|
11
|
+
cause;
|
|
9
12
|
constructor(message, exitCode = 1, cause) {
|
|
10
13
|
super(message);
|
|
11
14
|
this.exitCode = exitCode;
|
|
@@ -13,6 +16,7 @@ export class ApplicationError extends Error {
|
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
export class IOError extends ApplicationError {
|
|
19
|
+
cause;
|
|
16
20
|
constructor(message, cause) {
|
|
17
21
|
super(message, undefined, cause);
|
|
18
22
|
this.cause = cause;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "A Spelling Checker for Code!",
|
|
5
5
|
"funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
|
|
6
6
|
"bin": {
|
|
@@ -80,18 +80,18 @@
|
|
|
80
80
|
},
|
|
81
81
|
"homepage": "https://streetsidesoftware.github.io/cspell/",
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@cspell/cspell-json-reporter": "
|
|
84
|
-
"@cspell/cspell-pipe": "
|
|
85
|
-
"@cspell/cspell-types": "
|
|
86
|
-
"@cspell/dynamic-import": "
|
|
83
|
+
"@cspell/cspell-json-reporter": "8.0.0",
|
|
84
|
+
"@cspell/cspell-pipe": "8.0.0",
|
|
85
|
+
"@cspell/cspell-types": "8.0.0",
|
|
86
|
+
"@cspell/dynamic-import": "8.0.0",
|
|
87
87
|
"chalk": "^5.3.0",
|
|
88
88
|
"chalk-template": "^1.1.0",
|
|
89
89
|
"commander": "^11.1.0",
|
|
90
|
-
"cspell-gitignore": "
|
|
91
|
-
"cspell-glob": "
|
|
92
|
-
"cspell-io": "
|
|
93
|
-
"cspell-lib": "
|
|
94
|
-
"fast-glob": "^3.3.
|
|
90
|
+
"cspell-gitignore": "8.0.0",
|
|
91
|
+
"cspell-glob": "8.0.0",
|
|
92
|
+
"cspell-io": "8.0.0",
|
|
93
|
+
"cspell-lib": "8.0.0",
|
|
94
|
+
"fast-glob": "^3.3.2",
|
|
95
95
|
"fast-json-stable-stringify": "^2.1.0",
|
|
96
96
|
"file-entry-cache": "^7.0.1",
|
|
97
97
|
"get-stdin": "^9.0.0",
|
|
@@ -100,15 +100,15 @@
|
|
|
100
100
|
"vscode-uri": "^3.0.8"
|
|
101
101
|
},
|
|
102
102
|
"engines": {
|
|
103
|
-
"node": ">=
|
|
103
|
+
"node": ">=18"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@types/file-entry-cache": "^5.0.
|
|
106
|
+
"@types/file-entry-cache": "^5.0.4",
|
|
107
107
|
"@types/glob": "^8.1.0",
|
|
108
|
-
"@types/micromatch": "^4.0.
|
|
109
|
-
"@types/semver": "^7.5.
|
|
108
|
+
"@types/micromatch": "^4.0.4",
|
|
109
|
+
"@types/semver": "^7.5.4",
|
|
110
110
|
"micromatch": "^4.0.5",
|
|
111
111
|
"minimatch": "^9.0.3"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "67c22bf98baed1c17bbc658fba8656262d17e370"
|
|
114
114
|
}
|