Skip to content

Commit bd94b7f

Browse files
committed
chore: add cSpell for spell checking
1 parent d1a3cb6 commit bd94b7f

File tree

9 files changed

+477
-17
lines changed

9 files changed

+477
-17
lines changed

.cspell.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"version": "0.2",
3+
"words": [
4+
"abcxyz",
5+
"addrs",
6+
"anotherhashishere",
7+
"arcanis",
8+
"Builtins",
9+
"complexm",
10+
"endregion",
11+
"entrypoints",
12+
"filesystems",
13+
"hashishere",
14+
"Hierachic",
15+
"jsons",
16+
"Kopeykin",
17+
"Koppers",
18+
"Maël",
19+
"memfs",
20+
"mergeable",
21+
"Nison",
22+
"opensource",
23+
"pjson",
24+
"pnpapi",
25+
"sokra",
26+
"subpaths",
27+
"tapable",
28+
"undescribed",
29+
"unreviewed",
30+
"vankop",
31+
"wpck",
32+
"zapp",
33+
"zipp",
34+
"zippi",
35+
"zizizi"
36+
],
37+
"ignorePaths": ["package.json", "yarn.lock"]
38+
}

lib/ResolverFactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const UseFilePlugin = require("./UseFilePlugin");
7373
* @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it
7474
* @property {boolean=} resolveToContext Resolve to a context instead of a file
7575
* @property {(string|RegExp)[]=} restrictions A list of resolve restrictions
76-
* @property {boolean=} useSyncFileSystemCalls Use only the sync constiants of the file system calls
76+
* @property {boolean=} useSyncFileSystemCalls Use only the sync constraints of the file system calls
7777
* @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules
7878
* @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
7979
*/
@@ -280,7 +280,7 @@ exports.createResolver = function (options) {
280280

281281
resolver.ensureHook("resolve");
282282
resolver.ensureHook("internalResolve");
283-
resolver.ensureHook("newInteralResolve");
283+
resolver.ensureHook("newInternalResolve");
284284
resolver.ensureHook("parsedResolve");
285285
resolver.ensureHook("describedResolve");
286286
resolver.ensureHook("internal");

lib/SymlinkPlugin.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = class SymlinkPlugin {
3434
.tapAsync("SymlinkPlugin", (request, resolveContext, callback) => {
3535
if (request.ignoreSymlinks) return callback();
3636
const pathsResult = getPaths(request.path);
37-
const pathSeqments = pathsResult.seqments;
37+
const pathSegments = pathsResult.segments;
3838
const paths = pathsResult.paths;
3939

4040
let containsSymlink = false;
@@ -47,7 +47,7 @@ module.exports = class SymlinkPlugin {
4747
resolveContext.fileDependencies.add(path);
4848
fs.readlink(path, (err, result) => {
4949
if (!err && result) {
50-
pathSeqments[idx] = result;
50+
pathSegments[idx] = result;
5151
containsSymlink = true;
5252
// Shortcut when absolute symlink found
5353
const resultType = getType(result.toString());
@@ -63,11 +63,11 @@ module.exports = class SymlinkPlugin {
6363
},
6464
(err, idx) => {
6565
if (!containsSymlink) return callback();
66-
const resultSeqments =
66+
const resultSegments =
6767
typeof idx === "number"
68-
? pathSeqments.slice(0, idx + 1)
69-
: pathSeqments.slice();
70-
const result = resultSeqments.reduceRight((a, b) => {
68+
? pathSegments.slice(0, idx + 1)
69+
: pathSegments.slice();
70+
const result = resultSegments.reduceRight((a, b) => {
7171
return resolver.join(a, b);
7272
});
7373
const obj = {

lib/getPaths.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
module.exports = function getPaths(path) {
99
const parts = path.split(/(.*?[\\/]+)/);
1010
const paths = [path];
11-
const seqments = [parts[parts.length - 1]];
11+
const segments = [parts[parts.length - 1]];
1212
let part = parts[parts.length - 1];
1313
path = path.substr(0, path.length - part.length - 1);
1414
for (let i = parts.length - 2; i > 2; i -= 2) {
1515
paths.push(path);
1616
part = parts[i];
1717
path = path.substr(0, path.length - part.length) || "/";
18-
seqments.push(part.substr(0, part.length - 1));
18+
segments.push(part.substr(0, part.length - 1));
1919
}
2020
part = parts[1];
21-
seqments.push(part);
21+
segments.push(part);
2222
paths.push(part);
2323
return {
2424
paths: paths,
25-
seqments: seqments
25+
segments: segments
2626
};
2727
};
2828

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"devDependencies": {
2121
"@types/mocha": "^8.0.3",
2222
"@types/node": "^14.11.1",
23+
"cspell": "4.2.8",
2324
"eslint": "^7.9.0",
2425
"eslint-config-prettier": "^6.11.0",
2526
"eslint-plugin-jsdoc": "^30.5.1",
@@ -42,7 +43,7 @@
4243
"types": "types.d.ts",
4344
"homepage": "http://github.com/webpack/enhanced-resolve",
4445
"scripts": {
45-
"lint": "yarn run code-lint && yarn run type-lint && yarn run special-lint",
46+
"lint": "yarn run code-lint && yarn run type-lint && yarn run special-lint yarn run spelling",
4647
"fix": "yarn run code-lint-fix && yarn run special-lint-fix",
4748
"code-lint": "eslint --cache lib test",
4849
"code-lint-fix": "eslint --cache lib test --fix",
@@ -51,6 +52,7 @@
5152
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/generate-types --write",
5253
"pretty": "prettier --loglevel warn --write \"lib/**/*.{js,json}\" \"test/*.js\"",
5354
"pretest": "yarn lint",
55+
"spelling": "cspell \"**/*.*\"",
5456
"test": "mocha --full-trace --check-leaks",
5557
"test:only": "mocha --full-trace --check-leaks",
5658
"precover": "yarn lint",

test/resolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ describe("resolve", function () {
309309
});
310310
});
311311

312-
it("should not crash when passing undefined everywere", done => {
312+
it("should not crash when passing undefined everywhere", done => {
313313
resolve(undefined, undefined, undefined, undefined, err => {
314314
err.should.be.instanceof(Error);
315315
done();

tooling/format-file-header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require("path");
22
const fs = require("fs");
33

44
// When --write is set, files will be written in place
5-
// Elsewise it only prints outdated files
5+
// Otherwise it only prints outdated files
66
const doWrite = process.argv.includes("--write");
77

88
const allFiles = new Set();

types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ declare interface UserResolveOptions {
432432
restrictions?: (string | RegExp)[];
433433

434434
/**
435-
* Use only the sync constiants of the file system calls
435+
* Use only the sync constraints of the file system calls
436436
*/
437437
useSyncFileSystemCalls?: boolean;
438438

0 commit comments

Comments
 (0)