cspell 5.12.5 → 5.13.2
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 +4 -1
- package/dist/app.d.ts +1 -1
- package/dist/application.d.ts +3 -3
- package/dist/application.js +1 -2
- package/dist/commandLint.d.ts +2 -2
- package/dist/commandLint.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/lint/LintRequest.d.ts +17 -0
- package/dist/{CSpellApplicationConfiguration.js → lint/LintRequest.js} +7 -10
- package/dist/lint/index.d.ts +3 -0
- package/dist/lint/index.js +8 -0
- package/dist/lint/lint.d.ts +4 -0
- package/dist/{lint.js → lint/lint.js} +20 -11
- package/dist/options.d.ts +8 -15
- package/dist/util/InMemoryReporter.d.ts +1 -0
- package/dist/util/InMemoryReporter.js +2 -0
- package/dist/util/cache/CSpellLintResultCache.d.ts +16 -0
- package/dist/util/cache/CSpellLintResultCache.js +3 -0
- package/dist/util/cache/CacheOptions.d.ts +17 -0
- package/dist/util/{IOptions.js → cache/CacheOptions.js} +1 -1
- package/dist/util/cache/DiskCache.d.ts +1 -1
- package/dist/util/cache/DummyCache.d.ts +1 -1
- package/dist/util/cache/createCache.d.ts +11 -0
- package/dist/util/cache/createCache.js +20 -0
- package/dist/util/cache/index.d.ts +4 -21
- package/dist/util/cache/index.js +4 -17
- package/dist/util/glob.d.ts +2 -6
- package/package.json +8 -8
- package/dist/CSpellApplicationConfiguration.d.ts +0 -19
- package/dist/lint.d.ts +0 -4
- package/dist/util/IOptions.d.ts +0 -79
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ Options:
|
|
|
86
86
|
--language-id <language> Force programming language for unknown
|
|
87
87
|
extensions. i.e. "php" or "scala"
|
|
88
88
|
|
|
89
|
-
--
|
|
89
|
+
--words-only Only output the words not found in the
|
|
90
90
|
dictionaries.
|
|
91
91
|
|
|
92
92
|
-u, --unique Only output the first instance of a word not
|
|
@@ -116,6 +116,9 @@ Options:
|
|
|
116
116
|
--cache-location <path> Path to the cache file or directory (default:
|
|
117
117
|
".cspellcache")
|
|
118
118
|
|
|
119
|
+
--dot Include files and directories starting with `.`
|
|
120
|
+
(period) when matching globs.
|
|
121
|
+
|
|
119
122
|
--gitignore Ignore files matching glob patterns found in
|
|
120
123
|
.gitignore files.
|
|
121
124
|
|
package/dist/app.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as commander from 'commander';
|
|
2
|
-
export { Options } from './commandLint';
|
|
2
|
+
export { LinterCliOptions as Options } from './commandLint';
|
|
3
3
|
export { CheckFailed } from './util/errors';
|
|
4
4
|
export declare function run(program?: commander.Command, argv?: string[]): Promise<void>;
|
|
5
5
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/application.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { CSpellReporter, RunResult } from '@cspell/cspell-types';
|
|
3
3
|
import { CheckTextInfo, TraceResult } from 'cspell-lib';
|
|
4
|
-
import { BaseOptions,
|
|
5
|
-
export type { TraceResult } from 'cspell-lib';
|
|
4
|
+
import { BaseOptions, LinterOptions, TraceOptions } from './options';
|
|
6
5
|
export { IncludeExcludeFlag } from 'cspell-lib';
|
|
6
|
+
export type { TraceResult } from 'cspell-lib';
|
|
7
7
|
export declare type AppError = NodeJS.ErrnoException;
|
|
8
|
-
export declare function lint(files: string[], options:
|
|
8
|
+
export declare function lint(files: string[], options: LinterOptions, emitters: CSpellReporter): Promise<RunResult>;
|
|
9
9
|
export declare function trace(words: string[], options: TraceOptions): Promise<TraceResult[]>;
|
|
10
10
|
export declare type CheckTextResult = CheckTextInfo;
|
|
11
11
|
export declare function checkText(filename: string, options: BaseOptions): Promise<CheckTextResult>;
|
package/dist/application.js
CHANGED
|
@@ -23,14 +23,13 @@ exports.createInit = exports.checkText = exports.trace = exports.lint = exports.
|
|
|
23
23
|
const cspell = __importStar(require("cspell-lib"));
|
|
24
24
|
const cspell_lib_1 = require("cspell-lib");
|
|
25
25
|
const path = __importStar(require("path"));
|
|
26
|
-
const CSpellApplicationConfiguration_1 = require("./CSpellApplicationConfiguration");
|
|
27
26
|
const fileHelper_1 = require("./fileHelper");
|
|
28
27
|
const lint_1 = require("./lint");
|
|
29
28
|
const util = __importStar(require("./util/util"));
|
|
30
29
|
var cspell_lib_2 = require("cspell-lib");
|
|
31
30
|
Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function () { return cspell_lib_2.IncludeExcludeFlag; } });
|
|
32
31
|
function lint(files, options, emitters) {
|
|
33
|
-
const cfg = new
|
|
32
|
+
const cfg = new lint_1.LintRequest(files, options, emitters);
|
|
34
33
|
return (0, lint_1.runLint)(cfg);
|
|
35
34
|
}
|
|
36
35
|
exports.lint = lint;
|
package/dist/commandLint.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
2
|
+
import { LinterOptions } from './options';
|
|
3
|
+
export interface LinterCliOptions extends LinterOptions {
|
|
4
4
|
files: string[];
|
|
5
5
|
legacy?: boolean;
|
|
6
6
|
summary: boolean;
|
package/dist/commandLint.js
CHANGED
|
@@ -77,6 +77,7 @@ function commandLint(prog) {
|
|
|
77
77
|
'content',
|
|
78
78
|
]))
|
|
79
79
|
.option('--cache-location <path>', `Path to the cache file or directory`, cache_1.DEFAULT_CACHE_LOCATION)
|
|
80
|
+
.option('--dot', 'Include files and directories starting with `.` (period) when matching globs.')
|
|
80
81
|
.option('--gitignore', 'Ignore files matching glob patterns found in .gitignore files.')
|
|
81
82
|
.option('--no-gitignore', 'Do NOT use .gitignore files.')
|
|
82
83
|
.option('--gitignore-root <path>', 'Prevent searching for .gitignore files past root.', collect)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from '@cspell/cspell-types';
|
|
2
2
|
export * from './application';
|
|
3
|
-
export type { BaseOptions, CSpellApplicationOptions, TraceOptions } from './options';
|
|
3
|
+
export type { BaseOptions, LinterOptions as CSpellApplicationOptions, TraceOptions } from './options';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CSpellReporter, Issue } from '@cspell/cspell-types';
|
|
2
|
+
import { LinterOptions } from '../options';
|
|
3
|
+
import { GlobSrcInfo } from '../util/glob';
|
|
4
|
+
export declare class LintRequest {
|
|
5
|
+
readonly files: string[];
|
|
6
|
+
readonly options: LinterOptions;
|
|
7
|
+
readonly reporter: CSpellReporter;
|
|
8
|
+
readonly uniqueFilter: (issue: Issue) => boolean;
|
|
9
|
+
readonly locale: string;
|
|
10
|
+
readonly configFile: string | undefined;
|
|
11
|
+
readonly excludes: GlobSrcInfo[];
|
|
12
|
+
readonly root: string;
|
|
13
|
+
readonly showContext: number;
|
|
14
|
+
readonly enableGlobDot: boolean | undefined;
|
|
15
|
+
constructor(files: string[], options: LinterOptions, reporter: CSpellReporter);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=LintRequest.d.ts.map
|
|
@@ -19,28 +19,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.LintRequest = void 0;
|
|
23
23
|
const path = __importStar(require("path"));
|
|
24
|
-
const glob_1 = require("
|
|
25
|
-
const util = __importStar(require("
|
|
24
|
+
const glob_1 = require("../util/glob");
|
|
25
|
+
const util = __importStar(require("../util/util"));
|
|
26
26
|
const defaultContextRange = 20;
|
|
27
|
-
|
|
28
|
-
const defaultMinimatchOptions = { nocase: true };
|
|
29
|
-
exports.defaultConfigGlobOptions = defaultMinimatchOptions;
|
|
30
|
-
class CSpellApplicationConfiguration {
|
|
27
|
+
class LintRequest {
|
|
31
28
|
constructor(files, options, reporter) {
|
|
32
29
|
this.files = files;
|
|
33
30
|
this.options = options;
|
|
34
31
|
this.reporter = reporter;
|
|
35
|
-
this.configGlobOptions = exports.defaultConfigGlobOptions;
|
|
36
32
|
this.root = path.resolve(options.root || process.cwd());
|
|
37
33
|
this.configFile = options.config;
|
|
38
34
|
this.excludes = (0, glob_1.calcExcludeGlobInfo)(this.root, options.exclude);
|
|
39
35
|
this.locale = options.locale || options.local || '';
|
|
36
|
+
this.enableGlobDot = options.dot;
|
|
40
37
|
this.uniqueFilter = options.unique ? util.uniqueFilterFnGenerator((issue) => issue.text) : () => true;
|
|
41
38
|
this.showContext =
|
|
42
39
|
options.showContext === true ? defaultContextRange : options.showContext ? options.showContext : 0;
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
|
-
exports.
|
|
46
|
-
//# sourceMappingURL=
|
|
42
|
+
exports.LintRequest = LintRequest;
|
|
43
|
+
//# sourceMappingURL=LintRequest.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LintRequest = exports.runLint = void 0;
|
|
4
|
+
var lint_1 = require("./lint");
|
|
5
|
+
Object.defineProperty(exports, "runLint", { enumerable: true, get: function () { return lint_1.runLint; } });
|
|
6
|
+
var LintRequest_1 = require("./LintRequest");
|
|
7
|
+
Object.defineProperty(exports, "LintRequest", { enumerable: true, get: function () { return LintRequest_1.LintRequest; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -22,18 +22,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.runLint = void 0;
|
|
23
23
|
const cspell_types_1 = require("@cspell/cspell-types");
|
|
24
24
|
const commentJson = __importStar(require("comment-json"));
|
|
25
|
+
const cspell_gitignore_1 = require("cspell-gitignore");
|
|
25
26
|
const cspell = __importStar(require("cspell-lib"));
|
|
26
27
|
const path = __importStar(require("path"));
|
|
27
28
|
const util_1 = require("util");
|
|
28
29
|
const vscode_uri_1 = require("vscode-uri");
|
|
29
|
-
const fileHelper_1 = require("
|
|
30
|
-
const cache_1 = require("
|
|
31
|
-
const errors_1 = require("
|
|
32
|
-
const glob_1 = require("
|
|
33
|
-
const reporters_1 = require("
|
|
34
|
-
const timer_1 = require("
|
|
35
|
-
const util = __importStar(require("
|
|
36
|
-
const cspell_gitignore_1 = require("cspell-gitignore");
|
|
30
|
+
const fileHelper_1 = require("../fileHelper");
|
|
31
|
+
const cache_1 = require("../util/cache");
|
|
32
|
+
const errors_1 = require("../util/errors");
|
|
33
|
+
const glob_1 = require("../util/glob");
|
|
34
|
+
const reporters_1 = require("../util/reporters");
|
|
35
|
+
const timer_1 = require("../util/timer");
|
|
36
|
+
const util = __importStar(require("../util/util"));
|
|
37
37
|
async function runLint(cfg) {
|
|
38
38
|
let { reporter } = cfg;
|
|
39
39
|
cspell.setLogger(getLoggerFromReporter(reporter));
|
|
@@ -95,7 +95,7 @@ async function runLint(cfg) {
|
|
|
95
95
|
}
|
|
96
96
|
async function processFiles(files, configInfo, fileCount) {
|
|
97
97
|
const status = runResult();
|
|
98
|
-
const cache = (0, cache_1.createCache)(cfg);
|
|
98
|
+
const cache = (0, cache_1.createCache)({ ...cfg.options, root: cfg.root });
|
|
99
99
|
const emitProgress = (filename, fileNum, result) => reporter.progress({
|
|
100
100
|
type: 'ProgressFileComplete',
|
|
101
101
|
fileNum,
|
|
@@ -165,7 +165,7 @@ async function runLint(cfg) {
|
|
|
165
165
|
return reportConfigurationErrors(configInfo.config);
|
|
166
166
|
}
|
|
167
167
|
async function run() {
|
|
168
|
-
var _a, _b, _c;
|
|
168
|
+
var _a, _b, _c, _d;
|
|
169
169
|
if (cfg.options.root) {
|
|
170
170
|
process.env[cspell.ENV_CSPELL_GLOB_ROOT] = cfg.root;
|
|
171
171
|
}
|
|
@@ -198,7 +198,16 @@ async function runLint(cfg) {
|
|
|
198
198
|
const globMatcher = (0, glob_1.buildGlobMatcher)(globsToExclude, root, true);
|
|
199
199
|
const ignoreGlobs = (0, glob_1.extractGlobsFromMatcher)(globMatcher);
|
|
200
200
|
// cspell:word nodir
|
|
201
|
-
const globOptions = {
|
|
201
|
+
const globOptions = {
|
|
202
|
+
root,
|
|
203
|
+
cwd: root,
|
|
204
|
+
ignore: ignoreGlobs.concat(normalizedExcludes),
|
|
205
|
+
nodir: true,
|
|
206
|
+
};
|
|
207
|
+
const enableGlobDot = (_d = cfg.enableGlobDot) !== null && _d !== void 0 ? _d : configInfo.config.enableGlobDot;
|
|
208
|
+
if (enableGlobDot !== undefined) {
|
|
209
|
+
globOptions.dot = enableGlobDot;
|
|
210
|
+
}
|
|
202
211
|
const foundFiles = await (0, fileHelper_1.findFiles)(fileGlobs, globOptions);
|
|
203
212
|
const filtered = gitIgnore ? await gitIgnore.filterOutIgnored(foundFiles) : foundFiles;
|
|
204
213
|
const files = filterFiles(filtered, globMatcher);
|
package/dist/options.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CacheOptions } from './util/cache';
|
|
2
|
+
export interface LinterOptions extends BaseOptions, CacheOptions {
|
|
2
3
|
/**
|
|
3
4
|
* Display verbose information
|
|
4
5
|
*/
|
|
@@ -23,6 +24,12 @@ export interface CSpellApplicationOptions extends BaseOptions {
|
|
|
23
24
|
* root directory, defaults to `cwd`
|
|
24
25
|
*/
|
|
25
26
|
root?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Determine if files / directories starting with `.` should be part
|
|
29
|
+
* of the glob search.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
dot?: boolean;
|
|
26
33
|
/**
|
|
27
34
|
* Show part of a line where an issue is found.
|
|
28
35
|
* if true, it will show the default number of characters on either side.
|
|
@@ -33,20 +40,6 @@ export interface CSpellApplicationOptions extends BaseOptions {
|
|
|
33
40
|
* Show suggestions for spelling errors.
|
|
34
41
|
*/
|
|
35
42
|
showSuggestions?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Store the info about processed files in order to only operate on the changed ones.
|
|
38
|
-
*/
|
|
39
|
-
cache?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Path to the cache location. Can be a file or a directory.
|
|
42
|
-
* If none specified .cspellcache will be used.
|
|
43
|
-
* The file will be created in the directory where the cspell command is executed.
|
|
44
|
-
*/
|
|
45
|
-
cacheLocation?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Strategy to use for detecting changed files, default: metadata
|
|
48
|
-
*/
|
|
49
|
-
cacheStrategy?: 'metadata' | 'content';
|
|
50
43
|
/**
|
|
51
44
|
* Enable filtering out files matching globs found in `.gitignore` files.
|
|
52
45
|
*/
|
|
@@ -7,6 +7,7 @@ exports.InMemoryReporter = void 0;
|
|
|
7
7
|
class InMemoryReporter {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.log = [];
|
|
10
|
+
this.errors = [];
|
|
10
11
|
this.issueCount = 0;
|
|
11
12
|
this.errorCount = 0;
|
|
12
13
|
this.debugCount = 0;
|
|
@@ -21,6 +22,7 @@ class InMemoryReporter {
|
|
|
21
22
|
};
|
|
22
23
|
this.error = (message, error) => {
|
|
23
24
|
this.errorCount += 1;
|
|
25
|
+
this.errors.push(error);
|
|
24
26
|
this.log.push(`Error: ${message} ${error.toString()}`);
|
|
25
27
|
};
|
|
26
28
|
this.info = (message) => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConfigInfo, FileResult } from '../../fileHelper';
|
|
2
|
+
export interface CSpellLintResultCache {
|
|
3
|
+
/**
|
|
4
|
+
* Retrieve cached lint results for a given file name, if present in the cache.
|
|
5
|
+
*/
|
|
6
|
+
getCachedLintResults(filename: string, configInfo: ConfigInfo): Promise<FileResult | undefined>;
|
|
7
|
+
/**
|
|
8
|
+
* Set the cached lint results.
|
|
9
|
+
*/
|
|
10
|
+
setCachedLintResults(result: FileResult, configInfo: ConfigInfo): void;
|
|
11
|
+
/**
|
|
12
|
+
* Persists the in-memory cache to disk.
|
|
13
|
+
*/
|
|
14
|
+
reconcile(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=CSpellLintResultCache.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CacheOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Store the info about processed files in order to only operate on the changed ones.
|
|
4
|
+
*/
|
|
5
|
+
cache?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Path to the cache location. Can be a file or a directory.
|
|
8
|
+
* If none specified .cspellcache will be used.
|
|
9
|
+
* The file will be created in the directory where the cspell command is executed.
|
|
10
|
+
*/
|
|
11
|
+
cacheLocation?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Strategy to use for detecting changed files, default: metadata
|
|
14
|
+
*/
|
|
15
|
+
cacheStrategy?: 'metadata' | 'content';
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=CacheOptions.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CacheOptions } from './CacheOptions';
|
|
2
|
+
import { CSpellLintResultCache } from './CSpellLintResultCache';
|
|
3
|
+
export declare const DEFAULT_CACHE_LOCATION = ".cspellcache";
|
|
4
|
+
export interface CreateCacheOptions extends CacheOptions {
|
|
5
|
+
root: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Creates CSpellLintResultCache (disk cache if caching is enabled in config or dummy otherwise)
|
|
9
|
+
*/
|
|
10
|
+
export declare function createCache(options: CreateCacheOptions): CSpellLintResultCache;
|
|
11
|
+
//# sourceMappingURL=createCache.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createCache = exports.DEFAULT_CACHE_LOCATION = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const DiskCache_1 = require("./DiskCache");
|
|
9
|
+
const DummyCache_1 = require("./DummyCache");
|
|
10
|
+
// cspell:word cspellcache
|
|
11
|
+
exports.DEFAULT_CACHE_LOCATION = '.cspellcache';
|
|
12
|
+
/**
|
|
13
|
+
* Creates CSpellLintResultCache (disk cache if caching is enabled in config or dummy otherwise)
|
|
14
|
+
*/
|
|
15
|
+
function createCache(options) {
|
|
16
|
+
const { cache, cacheLocation = exports.DEFAULT_CACHE_LOCATION, cacheStrategy = 'metadata', root } = options;
|
|
17
|
+
return cache ? new DiskCache_1.DiskCache(path_1.default.resolve(root, cacheLocation), cacheStrategy === 'content') : new DummyCache_1.DummyCache();
|
|
18
|
+
}
|
|
19
|
+
exports.createCache = createCache;
|
|
20
|
+
//# sourceMappingURL=createCache.js.map
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
/**
|
|
6
|
-
* Retrieve cached lint results for a given file name, if present in the cache.
|
|
7
|
-
*/
|
|
8
|
-
getCachedLintResults(filename: string, configInfo: ConfigInfo): Promise<FileResult | undefined>;
|
|
9
|
-
/**
|
|
10
|
-
* Set the cached lint results.
|
|
11
|
-
*/
|
|
12
|
-
setCachedLintResults(result: FileResult, configInfo: ConfigInfo): void;
|
|
13
|
-
/**
|
|
14
|
-
* Persists the in-memory cache to disk.
|
|
15
|
-
*/
|
|
16
|
-
reconcile(): void;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Creates CSpellLintResultCache (disk cache if caching is enabled in config or dummy otherwise)
|
|
20
|
-
*/
|
|
21
|
-
export declare function createCache(cfg: CSpellApplicationConfiguration): CSpellLintResultCache;
|
|
1
|
+
export { createCache, DEFAULT_CACHE_LOCATION } from './createCache';
|
|
2
|
+
export type { CreateCacheOptions } from './createCache';
|
|
3
|
+
export type { CSpellLintResultCache } from './CSpellLintResultCache';
|
|
4
|
+
export type { CacheOptions } from './CacheOptions';
|
|
22
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/util/cache/index.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// cspell:word cspellcache
|
|
11
|
-
exports.DEFAULT_CACHE_LOCATION = '.cspellcache';
|
|
12
|
-
/**
|
|
13
|
-
* Creates CSpellLintResultCache (disk cache if caching is enabled in config or dummy otherwise)
|
|
14
|
-
*/
|
|
15
|
-
function createCache(cfg) {
|
|
16
|
-
const { cache, cacheLocation = exports.DEFAULT_CACHE_LOCATION, cacheStrategy = 'metadata' } = cfg.options;
|
|
17
|
-
return cache ? new DiskCache_1.DiskCache(path_1.default.resolve(cfg.root, cacheLocation), cacheStrategy === 'content') : new DummyCache_1.DummyCache();
|
|
18
|
-
}
|
|
19
|
-
exports.createCache = createCache;
|
|
3
|
+
exports.DEFAULT_CACHE_LOCATION = exports.createCache = void 0;
|
|
4
|
+
var createCache_1 = require("./createCache");
|
|
5
|
+
Object.defineProperty(exports, "createCache", { enumerable: true, get: function () { return createCache_1.createCache; } });
|
|
6
|
+
Object.defineProperty(exports, "DEFAULT_CACHE_LOCATION", { enumerable: true, get: function () { return createCache_1.DEFAULT_CACHE_LOCATION; } });
|
|
20
7
|
//# sourceMappingURL=index.js.map
|
package/dist/util/glob.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { CSpellUserSettings, Glob } from '@cspell/cspell-types';
|
|
2
2
|
import { GlobMatcher, GlobPatternWithRoot } from 'cspell-glob';
|
|
3
|
-
import { IOptions } from '
|
|
4
|
-
export
|
|
5
|
-
cwd?: string;
|
|
6
|
-
root?: string;
|
|
7
|
-
ignore?: string | string[];
|
|
8
|
-
}
|
|
3
|
+
import type { IOptions as IGlobOptions } from 'glob';
|
|
4
|
+
export declare type GlobOptions = IGlobOptions;
|
|
9
5
|
/**
|
|
10
6
|
*
|
|
11
7
|
* @param pattern - glob patterns and NOT file paths. It can be a file path turned into a glob.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.2",
|
|
4
4
|
"description": "A Spelling Checker for Code!",
|
|
5
5
|
"funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"chalk": "^4.1.2",
|
|
73
73
|
"commander": "^8.3.0",
|
|
74
74
|
"comment-json": "^4.1.1",
|
|
75
|
-
"cspell-gitignore": "^5.
|
|
76
|
-
"cspell-glob": "^5.
|
|
77
|
-
"cspell-lib": "^5.
|
|
75
|
+
"cspell-gitignore": "^5.13.2",
|
|
76
|
+
"cspell-glob": "^5.13.2",
|
|
77
|
+
"cspell-lib": "^5.13.2",
|
|
78
78
|
"fast-json-stable-stringify": "^2.1.0",
|
|
79
79
|
"file-entry-cache": "^6.0.1",
|
|
80
80
|
"fs-extra": "^10.0.0",
|
|
@@ -88,18 +88,18 @@
|
|
|
88
88
|
"node": ">=12.13.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@cspell/cspell-json-reporter": "^5.
|
|
92
|
-
"@cspell/cspell-types": "^5.
|
|
91
|
+
"@cspell/cspell-json-reporter": "^5.13.2",
|
|
92
|
+
"@cspell/cspell-types": "^5.13.2",
|
|
93
93
|
"@types/file-entry-cache": "^5.0.2",
|
|
94
94
|
"@types/fs-extra": "^9.0.13",
|
|
95
95
|
"@types/glob": "^7.2.0",
|
|
96
96
|
"@types/imurmurhash": "^0.1.1",
|
|
97
97
|
"@types/micromatch": "^4.0.2",
|
|
98
98
|
"@types/minimatch": "^3.0.5",
|
|
99
|
-
"jest": "^27.
|
|
99
|
+
"jest": "^27.4.0",
|
|
100
100
|
"micromatch": "^4.0.4",
|
|
101
101
|
"minimatch": "^3.0.4",
|
|
102
102
|
"rimraf": "^3.0.2"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "98bce0c75dcf4328b0adc80a9014809b393c0d37"
|
|
105
105
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CSpellReporter, Issue } from '@cspell/cspell-types';
|
|
2
|
-
import { CSpellApplicationOptions } from './options';
|
|
3
|
-
import { GlobSrcInfo } from './util/glob';
|
|
4
|
-
import { IOptions } from './util/IOptions';
|
|
5
|
-
export declare const defaultConfigGlobOptions: IOptions;
|
|
6
|
-
export declare class CSpellApplicationConfiguration {
|
|
7
|
-
readonly files: string[];
|
|
8
|
-
readonly options: CSpellApplicationOptions;
|
|
9
|
-
readonly reporter: CSpellReporter;
|
|
10
|
-
readonly uniqueFilter: (issue: Issue) => boolean;
|
|
11
|
-
readonly locale: string;
|
|
12
|
-
readonly configFile: string | undefined;
|
|
13
|
-
readonly configGlobOptions: IOptions;
|
|
14
|
-
readonly excludes: GlobSrcInfo[];
|
|
15
|
-
readonly root: string;
|
|
16
|
-
readonly showContext: number;
|
|
17
|
-
constructor(files: string[], options: CSpellApplicationOptions, reporter: CSpellReporter);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=CSpellApplicationConfiguration.d.ts.map
|
package/dist/lint.d.ts
DELETED
package/dist/util/IOptions.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mirror of minimatch.IOptions
|
|
3
|
-
* cspell:ignore nobrace noglobstar extglob noext nocase nonull nocomment nonegate
|
|
4
|
-
*/
|
|
5
|
-
export interface IOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Dump a ton of stuff to stderr.
|
|
8
|
-
*
|
|
9
|
-
* @default false
|
|
10
|
-
*/
|
|
11
|
-
debug?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Do not expand {a,b} and {1..3} brace sets.
|
|
14
|
-
*
|
|
15
|
-
* @default false
|
|
16
|
-
*/
|
|
17
|
-
nobrace?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Disable ** matching against multiple folder names.
|
|
20
|
-
*
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
noglobstar?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Allow patterns to match filenames starting with a period,
|
|
26
|
-
* even if the pattern does not explicitly have a period in that spot.
|
|
27
|
-
*
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
dot?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Disable "extglob" style patterns like +(a|b).
|
|
33
|
-
*
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
noext?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Perform a case-insensitive match.
|
|
39
|
-
*
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
nocase?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* When a match is not found by minimatch.match,
|
|
45
|
-
* return a list containing the pattern itself if this option is set.
|
|
46
|
-
* Otherwise, an empty list is returned if there are no matches.
|
|
47
|
-
*
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
nonull?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* If set, then patterns without slashes will be matched against
|
|
53
|
-
* the basename of the path if it contains slashes.
|
|
54
|
-
*
|
|
55
|
-
* @default false
|
|
56
|
-
*/
|
|
57
|
-
matchBase?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Suppress the behavior of treating #
|
|
60
|
-
* at the start of a pattern as a comment.
|
|
61
|
-
*
|
|
62
|
-
* @default false
|
|
63
|
-
*/
|
|
64
|
-
nocomment?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Suppress the behavior of treating a leading ! character as negation.
|
|
67
|
-
*
|
|
68
|
-
* @default false
|
|
69
|
-
*/
|
|
70
|
-
nonegate?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Returns from negate expressions the same as if they were not negated.
|
|
73
|
-
* (Ie, true on a hit, false on a miss.)
|
|
74
|
-
*
|
|
75
|
-
* @default false
|
|
76
|
-
*/
|
|
77
|
-
flipNegate?: boolean;
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=IOptions.d.ts.map
|