@cspell/eslint-plugin 6.18.0 → 6.19.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.
Files changed (3) hide show
  1. package/dist/index.js +71 -71
  2. package/dist/index.mjs +58 -58
  3. package/package.json +14 -15
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @cspell/eslint-plugin v6.18.0
3
- * Copyright 2022 Jason Dent <jason@streetsidesoftware.nl>
2
+ * @cspell/eslint-plugin v6.19.0
3
+ * Copyright 2023 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
6
6
  */
@@ -14,81 +14,25 @@ var util = require('util');
14
14
  var fs = require('fs');
15
15
 
16
16
  function _interopNamespaceDefault(e) {
17
- var n = Object.create(null);
18
- if (e) {
19
- Object.keys(e).forEach(function (k) {
20
- if (k !== 'default') {
21
- var d = Object.getOwnPropertyDescriptor(e, k);
22
- Object.defineProperty(n, k, d.get ? d : {
23
- enumerable: true,
24
- get: function () { return e[k]; }
25
- });
26
- }
17
+ var n = Object.create(null);
18
+ if (e) {
19
+ Object.keys(e).forEach(function (k) {
20
+ if (k !== 'default') {
21
+ var d = Object.getOwnPropertyDescriptor(e, k);
22
+ Object.defineProperty(n, k, d.get ? d : {
23
+ enumerable: true,
24
+ get: function () { return e[k]; }
27
25
  });
28
- }
29
- n.default = e;
30
- return Object.freeze(n);
26
+ }
27
+ });
28
+ }
29
+ n.default = e;
30
+ return Object.freeze(n);
31
31
  }
32
32
 
33
33
  var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
34
34
  var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
35
35
 
36
- const sortFn = new Intl.Collator().compare;
37
- function addWordToCustomWordList(customWordListPath, word) {
38
- const content = readFile(customWordListPath) || '\n';
39
- const lineEndingMatch = content.match(/\r?\n/);
40
- const lineEnding = (lineEndingMatch === null || lineEndingMatch === void 0 ? void 0 : lineEndingMatch[0]) || '\n';
41
- const words = new Set(content
42
- .split(/\n/g)
43
- .map((a) => a.trim())
44
- .filter((a) => !!a));
45
- words.add(word);
46
- const lines = [...words];
47
- lines.sort(sortFn);
48
- writeFile(customWordListPath, lines.join(lineEnding) + lineEnding);
49
- }
50
- function readFile(file) {
51
- try {
52
- return fs__namespace.readFileSync(file, 'utf-8');
53
- }
54
- catch (e) {
55
- return undefined;
56
- }
57
- }
58
- function writeFile(file, content) {
59
- makeDir(path__namespace.dirname(file));
60
- fs__namespace.writeFileSync(file, content);
61
- }
62
- function makeDir(dir) {
63
- try {
64
- fs__namespace.mkdirSync(dir, { recursive: true });
65
- }
66
- catch (e) {
67
- console.log(e);
68
- }
69
- }
70
-
71
- const defaultCheckOptions = {
72
- checkComments: true,
73
- checkIdentifiers: true,
74
- checkJSXText: true,
75
- checkStrings: true,
76
- checkStringTemplates: true,
77
- customWordListFile: undefined,
78
- ignoreImportProperties: true,
79
- ignoreImports: true,
80
- };
81
- const defaultOptions = {
82
- ...defaultCheckOptions,
83
- numSuggestions: 8,
84
- generateSuggestions: true,
85
- debugMode: false,
86
- };
87
- function normalizeOptions(opts) {
88
- const options = Object.assign({}, defaultOptions, opts || {});
89
- return options;
90
- }
91
-
92
36
  var $schema = "http://json-schema.org/draft-07/schema#";
93
37
  var additionalProperties = false;
94
38
  var definitions = {
@@ -185,6 +129,62 @@ var optionsSchema = {
185
129
  type: type
186
130
  };
187
131
 
132
+ const sortFn = new Intl.Collator().compare;
133
+ function addWordToCustomWordList(customWordListPath, word) {
134
+ const content = readFile(customWordListPath) || '\n';
135
+ const lineEndingMatch = content.match(/\r?\n/);
136
+ const lineEnding = (lineEndingMatch === null || lineEndingMatch === void 0 ? void 0 : lineEndingMatch[0]) || '\n';
137
+ const words = new Set(content
138
+ .split(/\n/g)
139
+ .map((a) => a.trim())
140
+ .filter((a) => !!a));
141
+ words.add(word);
142
+ const lines = [...words];
143
+ lines.sort(sortFn);
144
+ writeFile(customWordListPath, lines.join(lineEnding) + lineEnding);
145
+ }
146
+ function readFile(file) {
147
+ try {
148
+ return fs__namespace.readFileSync(file, 'utf-8');
149
+ }
150
+ catch (e) {
151
+ return undefined;
152
+ }
153
+ }
154
+ function writeFile(file, content) {
155
+ makeDir(path__namespace.dirname(file));
156
+ fs__namespace.writeFileSync(file, content);
157
+ }
158
+ function makeDir(dir) {
159
+ try {
160
+ fs__namespace.mkdirSync(dir, { recursive: true });
161
+ }
162
+ catch (e) {
163
+ console.log(e);
164
+ }
165
+ }
166
+
167
+ const defaultCheckOptions = {
168
+ checkComments: true,
169
+ checkIdentifiers: true,
170
+ checkJSXText: true,
171
+ checkStrings: true,
172
+ checkStringTemplates: true,
173
+ customWordListFile: undefined,
174
+ ignoreImportProperties: true,
175
+ ignoreImports: true,
176
+ };
177
+ const defaultOptions = {
178
+ ...defaultCheckOptions,
179
+ numSuggestions: 8,
180
+ generateSuggestions: true,
181
+ debugMode: false,
182
+ };
183
+ function normalizeOptions(opts) {
184
+ const options = Object.assign({}, defaultOptions, opts || {});
185
+ return options;
186
+ }
187
+
188
188
  const schema = optionsSchema;
189
189
  const messages = {
190
190
  wordUnknown: 'Unknown word: "{{word}}"',
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @cspell/eslint-plugin v6.18.0
3
- * Copyright 2022 Jason Dent <jason@streetsidesoftware.nl>
2
+ * @cspell/eslint-plugin v6.19.0
3
+ * Copyright 2023 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
6
6
  */
@@ -11,62 +11,6 @@ import * as path from 'path';
11
11
  import { format } from 'util';
12
12
  import * as fs from 'fs';
13
13
 
14
- const sortFn = new Intl.Collator().compare;
15
- function addWordToCustomWordList(customWordListPath, word) {
16
- const content = readFile(customWordListPath) || '\n';
17
- const lineEndingMatch = content.match(/\r?\n/);
18
- const lineEnding = (lineEndingMatch === null || lineEndingMatch === void 0 ? void 0 : lineEndingMatch[0]) || '\n';
19
- const words = new Set(content
20
- .split(/\n/g)
21
- .map((a) => a.trim())
22
- .filter((a) => !!a));
23
- words.add(word);
24
- const lines = [...words];
25
- lines.sort(sortFn);
26
- writeFile(customWordListPath, lines.join(lineEnding) + lineEnding);
27
- }
28
- function readFile(file) {
29
- try {
30
- return fs.readFileSync(file, 'utf-8');
31
- }
32
- catch (e) {
33
- return undefined;
34
- }
35
- }
36
- function writeFile(file, content) {
37
- makeDir(path.dirname(file));
38
- fs.writeFileSync(file, content);
39
- }
40
- function makeDir(dir) {
41
- try {
42
- fs.mkdirSync(dir, { recursive: true });
43
- }
44
- catch (e) {
45
- console.log(e);
46
- }
47
- }
48
-
49
- const defaultCheckOptions = {
50
- checkComments: true,
51
- checkIdentifiers: true,
52
- checkJSXText: true,
53
- checkStrings: true,
54
- checkStringTemplates: true,
55
- customWordListFile: undefined,
56
- ignoreImportProperties: true,
57
- ignoreImports: true,
58
- };
59
- const defaultOptions = {
60
- ...defaultCheckOptions,
61
- numSuggestions: 8,
62
- generateSuggestions: true,
63
- debugMode: false,
64
- };
65
- function normalizeOptions(opts) {
66
- const options = Object.assign({}, defaultOptions, opts || {});
67
- return options;
68
- }
69
-
70
14
  var $schema = "http://json-schema.org/draft-07/schema#";
71
15
  var additionalProperties = false;
72
16
  var definitions = {
@@ -163,6 +107,62 @@ var optionsSchema = {
163
107
  type: type
164
108
  };
165
109
 
110
+ const sortFn = new Intl.Collator().compare;
111
+ function addWordToCustomWordList(customWordListPath, word) {
112
+ const content = readFile(customWordListPath) || '\n';
113
+ const lineEndingMatch = content.match(/\r?\n/);
114
+ const lineEnding = (lineEndingMatch === null || lineEndingMatch === void 0 ? void 0 : lineEndingMatch[0]) || '\n';
115
+ const words = new Set(content
116
+ .split(/\n/g)
117
+ .map((a) => a.trim())
118
+ .filter((a) => !!a));
119
+ words.add(word);
120
+ const lines = [...words];
121
+ lines.sort(sortFn);
122
+ writeFile(customWordListPath, lines.join(lineEnding) + lineEnding);
123
+ }
124
+ function readFile(file) {
125
+ try {
126
+ return fs.readFileSync(file, 'utf-8');
127
+ }
128
+ catch (e) {
129
+ return undefined;
130
+ }
131
+ }
132
+ function writeFile(file, content) {
133
+ makeDir(path.dirname(file));
134
+ fs.writeFileSync(file, content);
135
+ }
136
+ function makeDir(dir) {
137
+ try {
138
+ fs.mkdirSync(dir, { recursive: true });
139
+ }
140
+ catch (e) {
141
+ console.log(e);
142
+ }
143
+ }
144
+
145
+ const defaultCheckOptions = {
146
+ checkComments: true,
147
+ checkIdentifiers: true,
148
+ checkJSXText: true,
149
+ checkStrings: true,
150
+ checkStringTemplates: true,
151
+ customWordListFile: undefined,
152
+ ignoreImportProperties: true,
153
+ ignoreImports: true,
154
+ };
155
+ const defaultOptions = {
156
+ ...defaultCheckOptions,
157
+ numSuggestions: 8,
158
+ generateSuggestions: true,
159
+ debugMode: false,
160
+ };
161
+ function normalizeOptions(opts) {
162
+ const options = Object.assign({}, defaultOptions, opts || {});
163
+ return options;
164
+ }
165
+
166
166
  const schema = optionsSchema;
167
167
  const messages = {
168
168
  wordUnknown: 'Unknown word: "{{word}}"',
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "6.18.0",
6
+ "version": "6.19.0",
7
7
  "description": "CSpell ESLint plugin",
8
8
  "keywords": [
9
9
  "cspell",
@@ -37,7 +37,7 @@
37
37
  "build-rollup": "rollup --config rollup.config.ts --configPlugin typescript",
38
38
  "build-schema": "ts-json-schema-generator --no-top-ref --expose none --path src/options.ts --type Options -o ./src/_auto_generated_/options.schema.json",
39
39
  "watch": "pnpm run build-rollup -- --watch",
40
- "clean": "rimraf dist coverage .tsbuildinfo",
40
+ "clean": "shx rm -rf dist coverage .tsbuildinfo",
41
41
  "clean-build": "pnpm run clean && pnpm run build",
42
42
  "coverage": "echo coverage",
43
43
  "test-watch": "pnpm run test -- --watch",
@@ -57,23 +57,22 @@
57
57
  "@rollup/plugin-commonjs": "^24.0.0",
58
58
  "@rollup/plugin-json": "^6.0.0",
59
59
  "@rollup/plugin-node-resolve": "^15.0.1",
60
- "@rollup/plugin-typescript": "^10.0.1",
60
+ "@rollup/plugin-typescript": "^11.0.0",
61
61
  "@types/eslint": "^8.4.10",
62
62
  "@types/estree": "^1.0.0",
63
- "@types/node": "^18.11.17",
64
- "@typescript-eslint/parser": "^5.47.0",
65
- "@typescript-eslint/types": "^5.47.0",
66
- "@typescript-eslint/typescript-estree": "^5.47.0",
67
- "eslint": "^8.30.0",
68
- "eslint-plugin-react": "^7.31.11",
63
+ "@types/node": "^18.11.18",
64
+ "@typescript-eslint/parser": "^5.48.1",
65
+ "@typescript-eslint/types": "^5.48.1",
66
+ "@typescript-eslint/typescript-estree": "^5.48.1",
67
+ "eslint": "^8.31.0",
68
+ "eslint-plugin-react": "^7.32.0",
69
69
  "mocha": "^10.2.0",
70
- "rimraf": "^3.0.2",
71
- "rollup": "^3.7.5",
72
- "rollup-plugin-dts": "^5.0.0",
73
- "ts-json-schema-generator": "^1.1.2"
70
+ "rollup": "^3.10.0",
71
+ "rollup-plugin-dts": "^5.1.1",
72
+ "ts-json-schema-generator": "^1.2.0"
74
73
  },
75
74
  "dependencies": {
76
- "cspell-lib": "6.18.0"
75
+ "cspell-lib": "6.19.0"
77
76
  },
78
- "gitHead": "6785657a445643ec1c9a17152e3c3733eb0e2a74"
77
+ "gitHead": "f643f0cd6384905618dbca950bd65a39a77dc028"
79
78
  }