wip
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run

This commit is contained in:
David Anson 2025-09-05 17:51:13 -07:00
parent cd4d9f2722
commit 93a42ae891
7 changed files with 74 additions and 86 deletions

View file

@ -18,18 +18,18 @@ const options = {
if (true) {
// Makes a synchronous call, uses result.toString for pretty formatting
// Makes a synchronous call
const results = lintSync(options);
console.log(results.toString());
console.dir(results, { "colors": true, "depth": null });
}
if (true) {
// Makes an asynchronous call, uses result.toString for pretty formatting
// Makes an asynchronous call
lintAsync(options, function callback(error, results) {
if (!error && results) {
console.log(results.toString());
console.dir(results, { "colors": true, "depth": null });
}
});
@ -37,7 +37,7 @@ if (true) {
if (true) {
// Makes a Promise-based asynchronous call, displays the result object directly
// Makes a Promise-based asynchronous call
const results = await lintPromise(options);
console.dir(results, { "colors": true, "depth": null });

View file

@ -171,13 +171,15 @@ lintAsync(options, assertLintResultsCallback);
assertLintResultsCallback(null, await lintPromise(options));
})();
const needsFixing = "# Heading\n";
assert.equal(
applyFix(
"# Fixing\n",
needsFixing,
{
"insertText": "Head",
"editColumn": 3,
"deleteCount": 3
"insertText": " ",
"editColumn": 2,
"deleteCount": 2
},
"\n"
),
@ -186,17 +188,12 @@ assert.equal(
assert.equal(
applyFixes(
"# Fixing\n",
[
{
"lineNumber": 1,
"fixInfo": {
"insertText": "Head",
"editColumn": 3,
"deleteCount": 3
}
needsFixing,
lintSync({
"strings": {
needsFixing
}
]
})["needsFixing"]
),
"# Heading\n"
);