@cspell/eslint-plugin 8.6.1 → 8.7.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.
@@ -43,7 +43,7 @@ function create(context) {
43
43
  const data = {
44
44
  word,
45
45
  };
46
- const code = context.sourceCode || context.getSourceCode();
46
+ const code = contextSourceCode(context);
47
47
  const startPos = code.getLocFromIndex(start);
48
48
  const endPos = code.getLocFromIndex(end);
49
49
  const loc = { start: startPos, end: endPos };
@@ -106,10 +106,13 @@ function logContext(log, context) {
106
106
  cwd: context.cwd,
107
107
  filename: context.filename,
108
108
  physicalFilename: context.physicalFilename,
109
- scope: context.getScope().type,
109
+ // scope: context.getScope().type,
110
110
  options: context.options.length === 1 ? context.options[0] : context.options,
111
111
  });
112
112
  }
113
+ function contextSourceCode(context) {
114
+ return context.sourceCode || context.getSourceCode();
115
+ }
113
116
  exports.meta = { name: '@cspell' };
114
117
  const recommended = {
115
118
  plugins: ['@cspell'],
@@ -1,6 +1,5 @@
1
- /* eslint-disable import/no-unresolved */
2
- /* eslint-disable node/no-missing-import */
3
1
  // @ts-check
2
+ /* eslint-disable n/no-missing-import */
4
3
  /**
5
4
  * @typedef {import('estree').Node} Node
6
5
  * @typedef {import('./types.cjs').Issue} Issue
@@ -22,6 +21,7 @@ runAsWorker(
22
21
  */
23
22
  async (filename, text, root, options) => {
24
23
  if (!spellChecker) {
24
+ // eslint-disable-next-line import/no-unresolved
25
25
  spellChecker = await import('./spellCheck.mjs');
26
26
  }
27
27
  return spellChecker.spellCheck(filename, text, root, options);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "8.6.1",
6
+ "version": "8.7.0",
7
7
  "description": "CSpell ESLint plugin",
8
8
  "keywords": [
9
9
  "cspell",
@@ -51,6 +51,7 @@
51
51
  "!**/*.map"
52
52
  ],
53
53
  "scripts": {
54
+ "bt": "pnpm build && pnpm test",
54
55
  "build": "pnpm build:schema && pnpm build:src",
55
56
  "build:src": "tsc -b ./tsconfig.json",
56
57
  "build:schema": "ts-json-schema-generator --no-top-ref --expose none --path src/common/options.cts --type Options -o ./assets/options.schema.json",
@@ -59,7 +60,7 @@
59
60
  "clean-build": "pnpm run clean && pnpm run build",
60
61
  "coverage": "echo coverage",
61
62
  "test-watch": "pnpm run test -- --watch",
62
- "test": "npx mocha --timeout 10000 \"dist/**/*.test.cjs\""
63
+ "test": "npx mocha --timeout 10000 \"dist/**/*.test.mjs\""
63
64
  },
64
65
  "repository": {
65
66
  "type": "git",
@@ -73,24 +74,30 @@
73
74
  "node": ">=18"
74
75
  },
75
76
  "devDependencies": {
76
- "@types/eslint": "^8.56.6",
77
+ "@eslint/eslintrc": "^3.0.2",
78
+ "@eslint/js": "^9.0.0",
77
79
  "@types/estree": "^1.0.5",
78
80
  "@types/mocha": "^10.0.6",
79
- "@typescript-eslint/eslint-plugin": "^7.3.1",
80
- "@typescript-eslint/parser": "^7.3.1",
81
- "@typescript-eslint/types": "^7.3.1",
82
- "@typescript-eslint/typescript-estree": "^7.3.1",
83
- "eslint": "^8.57.0",
81
+ "@typescript-eslint/parser": "^7.6.0",
82
+ "@typescript-eslint/types": "^7.6.0",
83
+ "eslint": "^9.0.0",
84
+ "eslint-plugin-n": "^17.1.0",
84
85
  "eslint-plugin-react": "^7.34.1",
85
- "mocha": "^10.3.0",
86
- "ts-json-schema-generator": "^1.5.0",
87
- "typescript": "^5.4.3"
86
+ "eslint-plugin-simple-import-sort": "^12.0.0",
87
+ "globals": "^15.0.0",
88
+ "mocha": "^10.4.0",
89
+ "ts-json-schema-generator": "^1.5.1",
90
+ "typescript": "^5.4.4",
91
+ "typescript-eslint": "^7.6.0"
88
92
  },
89
93
  "dependencies": {
90
- "@cspell/cspell-types": "8.6.1",
91
- "cspell-lib": "8.6.1",
94
+ "@cspell/cspell-types": "8.7.0",
95
+ "cspell-lib": "8.7.0",
92
96
  "estree-walker": "^3.0.3",
93
97
  "synckit": "^0.9.0"
94
98
  },
95
- "gitHead": "9279c50f26a32327e38fb1480ac1b823aa898a5f"
99
+ "peerDependencies": {
100
+ "eslint": "^7 || ^8 || ^9"
101
+ },
102
+ "gitHead": "5318079ed11fe77e981287ecf1c40d6f28dd91ed"
96
103
  }