@cspell/eslint-plugin 6.4.1 → 6.6.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 CHANGED
@@ -72,11 +72,25 @@ interface Options {
72
72
  * @default true
73
73
  */
74
74
  checkStringTemplates?: boolean;
75
+ /**
76
+ * Spell check JSX Text
77
+ * @default true
78
+ */
79
+ checkJSXText?: boolean;
75
80
  /**
76
81
  * Spell check comments
77
82
  * @default true
78
83
  */
79
84
  checkComments?: boolean;
85
+ /**
86
+ * Specify a path to a custom word list file.
87
+ *
88
+ * example:
89
+ * ```js
90
+ * customWordListFile: "./myWords.txt"
91
+ * ```
92
+ */
93
+ customWordListFile?: string | { path: string };
80
94
  /**
81
95
  * Output debug logs
82
96
  * @default false
package/dist/index.d.ts CHANGED
@@ -72,13 +72,23 @@ interface Check {
72
72
  * @default true
73
73
  */
74
74
  checkStringTemplates?: boolean;
75
+ /**
76
+ * Spell check JSX Text
77
+ * @default true
78
+ */
79
+ checkJSXText?: boolean;
75
80
  /**
76
81
  * Spell check comments
77
82
  * @default true
78
83
  */
79
84
  checkComments?: boolean;
80
85
  /**
81
- * Specify a path to a custom word list file
86
+ * Specify a path to a custom word list file.
87
+ *
88
+ * example:
89
+ * ```js
90
+ * customWordListFile: "./myWords.txt"
91
+ * ```
82
92
  */
83
93
  customWordListFile?: CustomWordListFilePath | CustomWordListFile | undefined;
84
94
  }
@@ -97,7 +107,7 @@ interface CustomWordListFile {
97
107
  *
98
108
  * Note: this does not yet work perfectly.
99
109
  */
100
- addWords: boolean;
110
+ addWords?: boolean;
101
111
  }
102
112
 
103
113
  export { Options, configs, rules };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cspell/eslint-plugin v6.4.0
2
+ * @cspell/eslint-plugin v6.5.0
3
3
  * Copyright 2022 Jason Dent <jason@streetsidesoftware.nl>
4
4
  * Released under the MIT License
5
5
  * https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-eslint-plugin#readme
@@ -77,6 +77,7 @@ function makeDir(dir) {
77
77
  const defaultCheckOptions = {
78
78
  checkComments: true,
79
79
  checkIdentifiers: true,
80
+ checkJSXText: true,
80
81
  checkStrings: true,
81
82
  checkStringTemplates: true,
82
83
  customWordListFile: undefined,
@@ -109,6 +110,11 @@ var properties = {
109
110
  description: "Spell check identifiers (variables names, function names, class names, etc.)",
110
111
  type: "boolean"
111
112
  },
113
+ checkJSXText: {
114
+ "default": true,
115
+ description: "Spell check JSX Text",
116
+ type: "boolean"
117
+ },
112
118
  checkStringTemplates: {
113
119
  "default": true,
114
120
  description: "Spell check template strings",
@@ -138,13 +144,12 @@ var properties = {
138
144
  }
139
145
  },
140
146
  required: [
141
- "path",
142
- "addWords"
147
+ "path"
143
148
  ],
144
149
  type: "object"
145
150
  }
146
151
  ],
147
- description: "Specify a path to a custom word list file"
152
+ description: "Specify a path to a custom word list file.\n\nexample: ```js customWordListFile: \"./myWords.txt\" ```"
148
153
  },
149
154
  debugMode: {
150
155
  "default": false,
@@ -239,6 +244,14 @@ function create(context) {
239
244
  checkNodeText(node, node.value);
240
245
  }
241
246
  }
247
+ function checkJSXText(node) {
248
+ if (!options.checkJSXText)
249
+ return;
250
+ if (typeof node.value === 'string') {
251
+ debugNode(node, node.value);
252
+ checkNodeText(node, node.value);
253
+ }
254
+ }
242
255
  function checkTemplateElement(node) {
243
256
  if (!options.checkStringTemplates)
244
257
  return;
@@ -401,6 +414,7 @@ function create(context) {
401
414
  Literal: checkLiteral,
402
415
  TemplateElement: checkTemplateElement,
403
416
  Identifier: checkIdentifier,
417
+ JSXText: checkJSXText,
404
418
  };
405
419
  function mapNode(node, index, nodes) {
406
420
  const child = nodes[index + 1];
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cspell/eslint-plugin v6.4.0
2
+ * @cspell/eslint-plugin v6.5.0
3
3
  * Copyright 2022 Jason Dent <jason@streetsidesoftware.nl>
4
4
  * Released under the MIT License
5
5
  * https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-eslint-plugin#readme
@@ -49,6 +49,7 @@ function makeDir(dir) {
49
49
  const defaultCheckOptions = {
50
50
  checkComments: true,
51
51
  checkIdentifiers: true,
52
+ checkJSXText: true,
52
53
  checkStrings: true,
53
54
  checkStringTemplates: true,
54
55
  customWordListFile: undefined,
@@ -81,6 +82,11 @@ var properties = {
81
82
  description: "Spell check identifiers (variables names, function names, class names, etc.)",
82
83
  type: "boolean"
83
84
  },
85
+ checkJSXText: {
86
+ "default": true,
87
+ description: "Spell check JSX Text",
88
+ type: "boolean"
89
+ },
84
90
  checkStringTemplates: {
85
91
  "default": true,
86
92
  description: "Spell check template strings",
@@ -110,13 +116,12 @@ var properties = {
110
116
  }
111
117
  },
112
118
  required: [
113
- "path",
114
- "addWords"
119
+ "path"
115
120
  ],
116
121
  type: "object"
117
122
  }
118
123
  ],
119
- description: "Specify a path to a custom word list file"
124
+ description: "Specify a path to a custom word list file.\n\nexample: ```js customWordListFile: \"./myWords.txt\" ```"
120
125
  },
121
126
  debugMode: {
122
127
  "default": false,
@@ -211,6 +216,14 @@ function create(context) {
211
216
  checkNodeText(node, node.value);
212
217
  }
213
218
  }
219
+ function checkJSXText(node) {
220
+ if (!options.checkJSXText)
221
+ return;
222
+ if (typeof node.value === 'string') {
223
+ debugNode(node, node.value);
224
+ checkNodeText(node, node.value);
225
+ }
226
+ }
214
227
  function checkTemplateElement(node) {
215
228
  if (!options.checkStringTemplates)
216
229
  return;
@@ -373,6 +386,7 @@ function create(context) {
373
386
  Literal: checkLiteral,
374
387
  TemplateElement: checkTemplateElement,
375
388
  Identifier: checkIdentifier,
389
+ JSXText: checkJSXText,
376
390
  };
377
391
  function mapNode(node, index, nodes) {
378
392
  const child = nodes[index + 1];
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "6.4.1",
6
+ "version": "6.6.0",
7
7
  "description": "[WIP] CSpell ESLint plugin",
8
8
  "keywords": [
9
9
  "cspell",
@@ -54,25 +54,26 @@
54
54
  "node": ">=14"
55
55
  },
56
56
  "devDependencies": {
57
- "@rollup/plugin-commonjs": "^22.0.1",
57
+ "@rollup/plugin-commonjs": "^22.0.2",
58
58
  "@rollup/plugin-json": "^4.1.0",
59
59
  "@rollup/plugin-node-resolve": "^13.3.0",
60
- "@rollup/plugin-typescript": "^8.3.3",
60
+ "@rollup/plugin-typescript": "^8.3.4",
61
61
  "@types/eslint": "^8.4.5",
62
62
  "@types/estree": "^1.0.0",
63
- "@types/node": "^18.0.6",
64
- "@typescript-eslint/parser": "^5.30.7",
65
- "@typescript-eslint/types": "^5.30.7",
66
- "@typescript-eslint/typescript-estree": "^5.30.7",
67
- "eslint": "^8.20.0",
63
+ "@types/node": "^18.6.4",
64
+ "@typescript-eslint/parser": "^5.32.0",
65
+ "@typescript-eslint/types": "^5.32.0",
66
+ "@typescript-eslint/typescript-estree": "^5.32.0",
67
+ "eslint": "^8.21.0",
68
+ "eslint-plugin-react": "^7.30.1",
68
69
  "mocha": "^10.0.0",
69
70
  "rimraf": "^3.0.2",
70
- "rollup": "^2.77.0",
71
+ "rollup": "^2.77.2",
71
72
  "rollup-plugin-dts": "^4.2.2",
72
73
  "ts-json-schema-generator": "^1.0.0"
73
74
  },
74
75
  "dependencies": {
75
- "cspell-lib": "^6.4.1"
76
+ "cspell-lib": "^6.6.0"
76
77
  },
77
- "gitHead": "578f97ba68078fb5f3284cf13abb06c518d8e1ad"
78
+ "gitHead": "673377e6b8b79834d018f9b4d02aef90406b7a29"
78
79
  }