@cspell/eslint-plugin 6.31.1 → 7.0.0-alpha.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.
@@ -63,13 +63,14 @@ function create(context) {
63
63
  };
64
64
  }
65
65
  log('Suggestions: %o', issue.suggestions);
66
- const fixable = issue.suggestions?.filter((sug) => !!sug.isPreferred);
66
+ const issueSuggestions = issue.suggestions;
67
+ const fixable = issueSuggestions?.filter((sug) => !!sug.isPreferred);
67
68
  const canFix = fixable?.length === 1;
68
69
  const preferredSuggestion = autoFix && canFix && fixable[0];
69
70
  const fix = preferredSuggestion
70
71
  ? fixFactory(preferredSuggestion.wordAdjustedToMatchCase || preferredSuggestion.word)
71
72
  : nullFix;
72
- const suggestions = issue.suggestions?.map((sug) => createSug(sug));
73
+ const suggestions = issueSuggestions?.map((sug) => createSug(sug));
73
74
  const suggest = suggestions;
74
75
  const des = {
75
76
  messageId,
@@ -6,4 +6,4 @@ export type ASTNode = (Node | Comment | JSXText) & {
6
6
  parent?: Node;
7
7
  };
8
8
  export type NodeType = ASTNode['type'];
9
- //# sourceMappingURL=ASTNode.d.mts.map
9
+ //# sourceMappingURL=ASTNode.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ASTNode.js.map
@@ -1,18 +1,5 @@
1
- import type { ValidationIssue } from 'cspell-lib';
2
1
  import type { Node } from 'estree';
3
2
  import type { WorkerOptions } from '../common/options.js';
4
- import type { NodeType } from './ASTNode.mjs';
5
- type Suggestions = ValidationIssue['suggestionsEx'];
6
- export interface Issue {
7
- start: number;
8
- end: number;
9
- word: string;
10
- severity: 'Forbidden' | 'Unknown' | 'Hint';
11
- suggestions: Suggestions;
12
- nodeType: NodeType;
13
- }
14
- type SpellCheckFn = typeof spellCheck;
15
- export type SpellCheckSyncFn = (...p: Parameters<SpellCheckFn>) => Awaited<ReturnType<SpellCheckFn>>;
3
+ import type { Issue } from './types.js';
16
4
  export declare function spellCheck(filename: string, text: string, root: Node, options: WorkerOptions): Promise<Issue[]>;
17
- export {};
18
5
  //# sourceMappingURL=spellCheck.d.mts.map
@@ -0,0 +1,30 @@
1
+ import type { Node } from 'estree';
2
+ import type { WorkerOptions } from '../common/options.js';
3
+ import type { NodeType } from './ASTNode.js';
4
+ interface ExtendedSuggestion {
5
+ /**
6
+ * The suggestion.
7
+ */
8
+ word: string;
9
+ /**
10
+ * The word is preferred above others, except other "preferred" words.
11
+ */
12
+ isPreferred?: boolean;
13
+ /**
14
+ * The suggested word adjusted to match the original case.
15
+ */
16
+ wordAdjustedToMatchCase?: string;
17
+ }
18
+ export type Suggestions = ExtendedSuggestion[] | undefined;
19
+ export interface Issue {
20
+ start: number;
21
+ end: number;
22
+ word: string;
23
+ severity: 'Forbidden' | 'Unknown' | 'Hint';
24
+ suggestions: Suggestions;
25
+ nodeType: NodeType;
26
+ }
27
+ type SpellCheckFn = (filename: string, text: string, root: Node, options: WorkerOptions) => Promise<Issue[]>;
28
+ export type SpellCheckSyncFn = (...p: Parameters<SpellCheckFn>) => Awaited<ReturnType<SpellCheckFn>>;
29
+ export {};
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -1,4 +1,4 @@
1
- import type { ASTNode } from './ASTNode.mjs';
1
+ import type { ASTNode } from './ASTNode.js';
2
2
  type Key = string | number | symbol | null | undefined;
3
3
  export declare function walkTree(node: ASTNode, enter: (node: ASTNode, parent: ASTNode | undefined, key: Key) => void): void;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  export type Node = import('estree').Node;
2
- export type Issue = import('./spellCheck.mjs').Issue;
2
+ export type Issue = import('./types.js').Issue;
3
3
  export type WorkerOptions = import('../common/options.js').WorkerOptions;
4
4
  //# sourceMappingURL=worker.d.mts.map
@@ -3,7 +3,7 @@
3
3
  // @ts-check
4
4
  /**
5
5
  * @typedef {import('estree').Node} Node
6
- * @typedef {import('./spellCheck.mjs').Issue} Issue
6
+ * @typedef {import('./types.js').Issue} Issue
7
7
  * @typedef {import('../common/options.js').WorkerOptions} WorkerOptions
8
8
  */
9
9
  import { runAsWorker } from 'synckit';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "6.31.1",
6
+ "version": "7.0.0-alpha.2",
7
7
  "description": "CSpell ESLint plugin",
8
8
  "keywords": [
9
9
  "cspell",
@@ -38,7 +38,7 @@
38
38
  "build:src": "tsc -b ./tsconfig.json",
39
39
  "build:schema": "ts-json-schema-generator --no-top-ref --expose none --path src/common/options.ts --type Options -o ./assets/options.schema.json",
40
40
  "watch": "tsc -p . --watch",
41
- "clean": "shx rm -rf dist coverage .tsbuildinfo",
41
+ "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
42
42
  "clean-build": "pnpm run clean && pnpm run build",
43
43
  "coverage": "echo coverage",
44
44
  "test-watch": "pnpm run test -- --watch",
@@ -52,23 +52,23 @@
52
52
  "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-gitignore"
53
53
  },
54
54
  "engines": {
55
- "node": ">=14"
55
+ "node": ">=16"
56
56
  },
57
57
  "devDependencies": {
58
- "@types/eslint": "^8.21.3",
59
- "@types/estree": "^1.0.0",
60
- "@typescript-eslint/parser": "^5.56.0",
61
- "@typescript-eslint/types": "^5.56.0",
62
- "@typescript-eslint/typescript-estree": "^5.56.0",
63
- "eslint": "^8.36.0",
58
+ "@types/eslint": "^8.37.0",
59
+ "@types/estree": "^1.0.1",
60
+ "@typescript-eslint/parser": "^5.59.2",
61
+ "@typescript-eslint/types": "^5.59.2",
62
+ "@typescript-eslint/typescript-estree": "^5.59.2",
63
+ "eslint": "^8.40.0",
64
64
  "eslint-plugin-react": "^7.32.2",
65
65
  "mocha": "^10.2.0",
66
66
  "ts-json-schema-generator": "^1.2.0"
67
67
  },
68
68
  "dependencies": {
69
- "cspell-lib": "6.31.1",
69
+ "cspell-lib": "7.0.0-alpha.2",
70
70
  "estree-walker": "^3.0.3",
71
71
  "synckit": "^0.8.5"
72
72
  },
73
- "gitHead": "43c3652e27588f6643cf78fd764f12f497f89fbf"
73
+ "gitHead": "a1b7c5daeef5afdb14d6444318f450b9fd9c035a"
74
74
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ASTNode.mjs.map