cspell 6.2.2 → 6.3.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.
@@ -2,11 +2,11 @@
2
2
  import type { CSpellReporter, RunResult } from '@cspell/cspell-types';
3
3
  import type { CheckTextInfo, TraceResult } from 'cspell-lib';
4
4
  import { TimedSuggestionsForWordResult } from './emitters/suggestionsEmitter';
5
- import { BaseOptions, LegacyOptions, LinterOptions, SuggestionOptions, TraceOptions } from './options';
5
+ import { BaseOptions, LegacyOptions, LinterCliOptions, SuggestionOptions, TraceOptions } from './options';
6
6
  export { IncludeExcludeFlag } from 'cspell-lib';
7
7
  export type { TraceResult } from 'cspell-lib';
8
8
  export declare type AppError = NodeJS.ErrnoException;
9
- export declare function lint(fileGlobs: string[], options: LinterOptions, emitters: CSpellReporter): Promise<RunResult>;
9
+ export declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>;
10
10
  export declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceResult[]>;
11
11
  export declare type CheckTextResult = CheckTextInfo;
12
12
  export declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>;
@@ -27,6 +27,7 @@ exports.createInit = exports.suggestions = exports.checkText = exports.trace = e
27
27
  const cspell_pipe_1 = require("@cspell/cspell-pipe");
28
28
  const cspell_lib_1 = require("cspell-lib");
29
29
  const path = __importStar(require("path"));
30
+ const cli_reporter_1 = require("./cli-reporter");
30
31
  const lint_1 = require("./lint");
31
32
  const options_1 = require("./options");
32
33
  const repl_1 = require("./repl");
@@ -36,9 +37,9 @@ const timer_1 = require("./util/timer");
36
37
  const util = __importStar(require("./util/util"));
37
38
  var cspell_lib_2 = require("cspell-lib");
38
39
  Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function () { return cspell_lib_2.IncludeExcludeFlag; } });
39
- function lint(fileGlobs, options, emitters) {
40
+ function lint(fileGlobs, options, reporter) {
40
41
  options = (0, options_1.fixLegacy)(options);
41
- const cfg = new lint_1.LintRequest(fileGlobs, options, emitters);
42
+ const cfg = new lint_1.LintRequest(fileGlobs, options, reporter ?? (0, cli_reporter_1.getReporter)({ ...options, fileGlobs }));
42
43
  return (0, lint_1.runLint)(cfg);
43
44
  }
44
45
  exports.lint = lint;
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.commandLint = void 0;
27
27
  const commander_1 = require("commander");
28
28
  const App = __importStar(require("./application"));
29
- const cli_reporter_1 = require("./cli-reporter");
30
29
  const cache_1 = require("./util/cache");
31
30
  const errors_1 = require("./util/errors");
32
31
  // interface InitOptions extends Options {}
@@ -100,9 +99,7 @@ function commandLint(prog) {
100
99
  .arguments('[globs...]')
101
100
  .action((fileGlobs, options) => {
102
101
  const { mustFindFiles, fileList } = options;
103
- const cliReporter = (0, cli_reporter_1.getReporter)({ ...options, fileGlobs });
104
- const lintOptions = { ...options, fileLists: fileList };
105
- return App.lint(fileGlobs, lintOptions, cliReporter).then((result) => {
102
+ return App.lint(fileGlobs, options).then((result) => {
106
103
  if (!fileGlobs.length && !result.files && !result.errors && !fileList) {
107
104
  spellCheckCommand.outputHelp();
108
105
  throw new errors_1.CheckFailed('outputHelp', 1);
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from '@cspell/cspell-types';
2
2
  export * from './application';
3
- export type { BaseOptions, LinterOptions as CSpellApplicationOptions, TraceOptions } from './options';
3
+ export type { BaseOptions, LinterCliOptions as CSpellApplicationOptions, TraceOptions } from './options';
4
+ export { getReporter as getDefaultReporter } from './cli-reporter';
4
5
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,6 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.getDefaultReporter = void 0;
17
18
  __exportStar(require("@cspell/cspell-types"), exports);
18
19
  __exportStar(require("./application"), exports);
20
+ var cli_reporter_1 = require("./cli-reporter");
21
+ Object.defineProperty(exports, "getDefaultReporter", { enumerable: true, get: function () { return cli_reporter_1.getReporter; } });
19
22
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,12 @@
1
1
  import type { CSpellReporter, Issue } from '@cspell/cspell-types';
2
2
  import { LinterOptions } from '../options';
3
3
  import { GlobSrcInfo } from '../util/glob';
4
+ interface Deprecated {
5
+ fileLists?: LinterOptions['fileList'];
6
+ }
4
7
  export declare class LintRequest {
5
8
  readonly fileGlobs: string[];
6
- readonly options: LinterOptions;
9
+ readonly options: LinterOptions & Deprecated;
7
10
  readonly reporter: CSpellReporter;
8
11
  readonly uniqueFilter: (issue: Issue) => boolean;
9
12
  readonly locale: string;
@@ -13,6 +16,7 @@ export declare class LintRequest {
13
16
  readonly showContext: number;
14
17
  readonly enableGlobDot: boolean | undefined;
15
18
  readonly fileLists: string[];
16
- constructor(fileGlobs: string[], options: LinterOptions, reporter: CSpellReporter);
19
+ constructor(fileGlobs: string[], options: LinterOptions & Deprecated, reporter: CSpellReporter);
17
20
  }
21
+ export {};
18
22
  //# sourceMappingURL=LintRequest.d.ts.map
@@ -41,7 +41,7 @@ class LintRequest {
41
41
  this.uniqueFilter = options.unique ? util.uniqueFilterFnGenerator((issue) => issue.text) : () => true;
42
42
  this.showContext =
43
43
  options.showContext === true ? defaultContextRange : options.showContext ? options.showContext : 0;
44
- this.fileLists = options.fileLists || [];
44
+ this.fileLists = (options.fileList ?? options.fileLists) || [];
45
45
  }
46
46
  }
47
47
  exports.LintRequest = LintRequest;
package/dist/options.d.ts CHANGED
@@ -53,7 +53,7 @@ export interface LinterOptions extends BaseOptions, Omit<CacheOptions, 'version'
53
53
  * The files in the lists will be filtered against the glob patterns.
54
54
  * - an entry of `stdin` means to read the file list from **`stdin`**
55
55
  */
56
- fileLists?: string[] | undefined;
56
+ fileList?: string[] | undefined;
57
57
  /**
58
58
  * Files must be found and processed otherwise it is considered an error.
59
59
  */
@@ -125,21 +125,36 @@ export interface BaseOptions {
125
125
  */
126
126
  defaultConfiguration?: boolean;
127
127
  }
128
- export interface LinterCliOptions extends Omit<LinterOptions, 'fileLists'> {
128
+ export interface LinterCliOptions extends LinterOptions {
129
+ /**
130
+ * Show legacy output
131
+ */
129
132
  legacy?: boolean;
130
- summary: boolean;
131
- issues: boolean;
132
- silent: boolean;
133
- mustFindFiles: boolean;
133
+ /**
134
+ * Show summary at the end
135
+ */
136
+ summary?: boolean;
137
+ /**
138
+ * Show issues
139
+ */
140
+ issues?: boolean;
141
+ /**
142
+ * Run in silent mode.
143
+ * @default false
144
+ */
145
+ silent?: boolean;
146
+ /**
147
+ * Show progress
148
+ */
134
149
  progress?: boolean;
135
150
  /**
136
151
  * issues are shown with a relative path to the root or `cwd`
137
152
  */
138
153
  relative?: boolean;
139
154
  /**
140
- * List of file paths to files that contains a list of files to be spell checked.
155
+ * Files must be found or cli will exit with an error.
141
156
  */
142
- fileList?: string[];
157
+ mustFindFiles?: boolean;
143
158
  }
144
159
  export declare function fixLegacy<T extends BaseOptions>(opts: T & LegacyOptions): Omit<T & LegacyOptions, 'local'>;
145
160
  //# sourceMappingURL=options.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell",
3
- "version": "6.2.2",
3
+ "version": "6.3.0",
4
4
  "description": "A Spelling Checker for Code!",
5
5
  "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
6
6
  "main": "dist/index.js",
@@ -70,12 +70,12 @@
70
70
  },
71
71
  "homepage": "https://streetsidesoftware.github.io/cspell/",
72
72
  "dependencies": {
73
- "@cspell/cspell-pipe": "^6.2.2",
73
+ "@cspell/cspell-pipe": "^6.3.0",
74
74
  "chalk": "^4.1.2",
75
75
  "commander": "^9.3.0",
76
- "cspell-gitignore": "^6.2.2",
77
- "cspell-glob": "^6.2.2",
78
- "cspell-lib": "^6.2.2",
76
+ "cspell-gitignore": "^6.3.0",
77
+ "cspell-glob": "^6.3.0",
78
+ "cspell-lib": "^6.3.0",
79
79
  "fast-json-stable-stringify": "^2.1.0",
80
80
  "file-entry-cache": "^6.0.1",
81
81
  "fs-extra": "^10.1.0",
@@ -90,8 +90,8 @@
90
90
  "node": ">=14"
91
91
  },
92
92
  "devDependencies": {
93
- "@cspell/cspell-json-reporter": "^6.2.2",
94
- "@cspell/cspell-types": "^6.2.2",
93
+ "@cspell/cspell-json-reporter": "^6.3.0",
94
+ "@cspell/cspell-types": "^6.3.0",
95
95
  "@types/file-entry-cache": "^5.0.2",
96
96
  "@types/fs-extra": "^9.0.13",
97
97
  "@types/glob": "^7.2.0",
@@ -103,8 +103,8 @@
103
103
  "micromatch": "^4.0.5",
104
104
  "minimatch": "^5.1.0",
105
105
  "rimraf": "^3.0.2",
106
- "rollup": "^2.75.7",
106
+ "rollup": "^2.76.0",
107
107
  "rollup-plugin-dts": "^4.2.2"
108
108
  },
109
- "gitHead": "b7716e80c39a780f98cde747ad66c55247636621"
109
+ "gitHead": "6b7b2a0e92f0b3c760dd3c3fd6bc8a8a873e1987"
110
110
  }